CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
571 stars 85 forks source link

Which traffic does "clear traffic" clear? #35

Closed originalfoo closed 5 years ago

originalfoo commented 5 years ago

Doing new docs for "clear traffic" tool and it's not clear from old docs what traffic is cleared.

I assume all road traffic, but does that include cims, busses, trams, bicycles? What about other forms of traffic, such as cargo ships, ferries, trains, balloons, etc?

Is it possible to determine from the code what it clears?

krzychu124 commented 5 years ago

Yup is is possible, look (easy stuff, I think ) 😉 https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/blob/f574f0dc24ece8a5abe08769561008aacbbdba2b/TLM/TLM/Manager/Impl/UtilityManager.cs#L22-L33

It simply releases(despawn) every spawned vehicle (car, bus, tram, train etc.) and resets traffic data from all road segment(traffic flow, relative speed per lane etc.)

originalfoo commented 5 years ago

Does vehicle manager include pedestrians, dogs, seagulls, etc?

My assumption is that cims and animals are handled by CitizenManager and other things?

krzychu124 commented 5 years ago

Yes they are. Vehicle manager is managing following types of vehicles: Rocket | Balloon | Blimp | CableCar | Monorail | Ferry | Vortex | Meteor | Helicopter | Tram | Bicycle | Plane | Ship | Train | Metro | Car

Animals have separate AI based on AnimalAI which is managed by CitizenManager, I think: BirdAI(Seagull) | LivestockAI(Cow, Pig) | PerAI(Dog) | RescueAnimalAI | WildlifeAI

originalfoo commented 5 years ago

Are vans, trucks, emergency services, etc, grouped as CAR?

krzychu124 commented 5 years ago

Yup, 'Car' is general type, I will check that 😉 [Edit] Yes, that's what I thought, TMPE just splits Car to more specific types of RoadVehicle see: https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/blob/f574f0dc24ece8a5abe08769561008aacbbdba2b/TLM/TLM/Traffic/ExtVehicleType.cs#L7-L37

originalfoo commented 5 years ago

That's missing cargo planes?

Also, what about things like postal vans/trucks?

originalfoo commented 5 years ago

I notice Pedestrian is in there too... So shouldn't their `PerAI animals also be despawned?

krzychu124 commented 5 years ago

Ooops, wrong branch 😅 https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/blob/559b624c4ddb720ded7488ef7baba189e398e1d5/TLM/TLM/Traffic/ExtVehicleType.cs#L7-L38

In addition I have no idea why there is Pedestrian. Interesting that my code editor points that it is never used and I think that dogs can't spawn without cim (IIRC)

originalfoo commented 5 years ago

Added a list of affected traffic to the FAQ in docs: https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/wiki/Clear-Traffic