CitiesSkylinesMods / TMPE

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

Separate car/track routing #1501

Closed kianzarrin closed 2 years ago

kianzarrin commented 2 years ago

TMPE.zip

minor changes:

This serves as a precursor to #354. also fixes #1053. Test:

originalfoo commented 2 years ago

build fail

kianzarrin commented 2 years ago

oops ... extra bracket

kianzarrin commented 2 years ago

Now it passes test. its ready to review.

kianzarrin commented 2 years ago

@aubergine10 do you understand enough of this code to be able to approve it? the routing detector PRs are based on this so you can use them to see the routings.

kianzarrin commented 2 years ago

@WildQuoll can you please test this. you can use the TMPE.zip link at the top of the page. image

if you stress test it in your tram city it would be nice (don't save just test).

kianzarrin commented 2 years ago

EDIT: this is also a problem in vanilla CS. image when I change lane connections tram sometimes gets stuck. I didn't add lane connection to the tram lane though. I think what triggered the problem was publish segment changes. Routing does exist though: image Is this know issue?

EDIT: I can reproduce with master too and STABLE too. image

kianzarrin commented 2 years ago

@aubergine10 what is the plan for this PR? when will it be reviewed?

originalfoo commented 2 years ago

Code looks good, but haven't had chance to test in game yet. Did you create issue for that tram sinking issue you found?

kianzarrin commented 2 years ago

@krzychu124 trolleybuses are not track or lane-arrow-following vehicle. which one should they be? EDIT: I think trolleybuses don't have tracks (even though they are connected to the wires) so they should obey lane arrows.

originalfoo commented 2 years ago

@kianzarrin I think we should treat trolleybuses as following "overhead tracks" (the overhead wires). That being the case, they should be able to ingore lane arrows. If user wants more control over the "overhead tracks", maybe we could do something with lane connectors?

As for trams, similar thing - they should be able to go wherever the in-road tracks allow them to go. And if player wants to control the connections of tracks at junctions use lane connectors.

I think same with buses - if there's a bus lane the bus should be able to use it, regardless of lane arrows (obviously lane direction is still obeyed), otherwise why is the bus lane there? It's only on normal road lanes that buses should be following lane arrows, I think.

krzychu124 commented 2 years ago

I think we should treat trolleybuses as following "overhead tracks" (the overhead wires). That being the case, they should be able to ingore lane arrows. If user wants more control over the "overhead tracks", maybe we could do something with lane connectors?

I also think they should ignore lane arrows. Trolleybuses actually don't care if there are overhead wires or not. They only require a lane with Trolleybus vehicle type so they work more or less like trams but unlike trams they should be able to ignore turn angle just like other road vehicles.

kianzarrin commented 2 years ago

@aubergine10 @krzychu124 Note that Trollybuses can use any of the road lanes regardless of the position of the "overhead tracks". currently there is a option about "buses can ignore lane arrows". I think that option should influence trollybuses too.

In the image bellow I think both bus and trolley bus should use the left-most lane to turn left: image

But here I think they can use either: image

Do you agree?

EDIT: now that I take a closer look CO asset editor has decided trolleybuses cannot use the left most lane at all for some reason: image

maybe they should ignore lane arrows regardless of that option. What do you think?

krzychu124 commented 2 years ago

Note that Trollybuses can use any of the road lanes regardless of the position of the "overhead tracks".

@kianzarrin That's not true -> oneway trolleybus road image

They should always ignore arrows. Just try Dedicated turn lanes feature and try creating route on one-way trolleybus roads (left/right will become only right on screenshot above).

Also.. pathfinding still does not work. I can create trolleybus line but vehicles cannot be spawned (flicker 0/1),

I would make trolleybuses to completely ignore lane arrows. Later when Lane connector will get option for tram connections it could support trolleybuses if such lane type was selected.

kianzarrin commented 2 years ago

Also.. pathfinding still does not work. I can create trolleybus line but vehicles cannot be spawned (flicker 0/1),

because they were following lane arrows.

I made them ignore lane arrows. it works now. but I am yet to test cargo ships and ferries.

kianzarrin commented 2 years ago

@krzychu124 are ships/ferrys/planes even handled by CustomPathFind?

krzychu124 commented 2 years ago

I made them ignore lane arrows.

Does not work... 😞

https://user-images.githubusercontent.com/19638970/164943677-4ad8eac1-ab5e-47ab-b90d-10ca7c76f924.mp4

are ships/ferrys/planes even handled by CustomPathFind?

Everything. If we don't patch their StartPathFind then they just don't use any TM:PE features so don't touch Pathfinding if not needed (in 99% cases it is not required).

kianzarrin commented 2 years ago

Tested with this city too: https://steamcommunity.com/sharedfiles/filedetails/?id=2561345715 It has everything but trolleybus. Screenshot (47) LOM test profile for city

originalfoo commented 2 years ago

Is this PR suitable for inclusion in to 11.6.5.2?

originalfoo commented 2 years ago

Bit late, but finally got round to testing this in game and didn't encounter any problems so LGTM 👍