CitiesSkylinesMods / TMPE

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

Support for Taxiways and Runways (DLC and non DLC) #1368

Open Aferiac opened 2 years ago

Aferiac commented 2 years ago

In short: It would be very useful if we could use stuff like the lane selector and the speed limit tools with taxiways specially (runways to an extend considering they are significantly more complex than taxiways, at least to my knowledge.). This will give us some tools to provide more realism to our builds and allow us to "fight" some weird AI behaviors.

Some examples to the weird AI behaviors. Green and Blue lines would be the correct way and the red lines show how the AI sometimes gets out of its way to be weird 🀣

Example

Example 1: The blue line on the left runway indicates the correct way for taking off there, yet sometimes some planes decide to take a right turn at the end and then proceed to take off from that short end of the right runway. Very unrealistic.

Example 2: I made those V-shaped taxiways to allow planes in a out in a realistic way for the small planes stand located in the middle of the first portion of the terminal. Some middle sized planes that have to keep going as there stands are located on the L shaped portion of the terminal (green line) still take the V-Shape instead of going straight which would be the logical way (red line). In both cases the lane selector tool would be amazing to correct this issues.

The speed limit addition would make sense for super realistic builds since in real life there are rules for the taxiways and speed limits on grounds. Also for bigger airport we could even use the Vehicle restriction tool to separate taxiways (and maybe runways too) usage between cargo and passengers to better manage our airports.

Now, I know very little about how the AI works in game and obviously don't expect it to be easy to port this Features over to airport but if there is a chance I think it would be a great addition to the mod.

Hope you all have a nice day and I'll keep an eye on the thread to see how this develops.

krzychu124 commented 2 years ago

Example 1 is a bug in vanilla, AFAIK devs are working on fix. As for Example 2 it may happen right after you added it and should fix itself after some time, when all vehicles get new paths.

Anyways, adding any support for any of existing feature will require a lot of work. I need to check what exactly needs to be changed. Thanks for suggestion! πŸ‘

Aferiac commented 2 years ago

Interesting! I had no idea it was a bug but this would make sense. And of course! I didn't expect this to be easy or feasible. Thanks for your hard word :D

krzychu124 commented 2 years ago

@aubergine10 I've started experimenting with Aircraft related things and I feel like we should isolate it from current logic since road/rail vehicles won't meet each other on roads/taxiways. E.g. when it comes to priority manager we have there MayChangeSegment, which is checking ton of things we don't really need for aircrafts and part of calculations need to be performed for flying aircrafts, also would be cool to add built-in support for two-way taxiways in the future (it's not super hard) which may increase complexity even more.

Also I think we don't need traffic lights for taxiways but we might add a bit more advanced vehicle restrictions not only for planes (passenger/cargo) but also their size small/medium/large/(other?) that could work also in asset editor so user could create, let's say invisible taxiways/runways dedicated for small aircrafts that could be later plopped on the grass or dirt to give a lot more flexibility with our "native" support in the pathfinding.

Basically we could use that info to block class of aircrafts from using specific runways/taxiways. I'm still experimenting with additional runway turn-outs (can be added with NMT) so having info about class of taxiway could help with dividing traffic going in/out the runway - assuming we'll add a little bit of code in pathfinding to ignore turn-out segments of specific class (either penalty or recommendation) by comparing class of the plane for which path is being look for, let's say small aircraft can use all taxiways but prefers small if available, since vehicle will not require full length of runway to slow down/stop and could also serve as high speed exit(if angled), to clear runway quickly. unannounced project, cough cough

originalfoo commented 2 years ago

I've started experimenting with Aircraft related things and I feel like we should isolate it from current logic

For the most part, I agree - certainly for airborne aircraft.

...since road/rail vehicles won't meet each other on roads/taxiways.

That would be true if it weren't for proliferation of "fake buses" (but also things like fire engines, etc) used as airport support/service vehicles: https://steamcommunity.com/workshop/filedetails/?id=2738721349 ...

And the service roads users add to their airports to let them move around, which often intersect with taxiways and even sometimes runways: https://steamcommunity.com/sharedfiles/filedetails/?id=1379972166

Since getting Airports DLC I've been addicted to cutomising my airports. Based on that new experience:

In addition to the three main aircraft sizes (small/medium/large) I think we should also add a "tiny" category for use with "Aviation Club" :) Would be super if we could merge that in to an airport just like we can merge cargo and passenger.

originalfoo commented 2 years ago

Ok, so while I'm spamming issues with brain dump of ideas.....

Would be super cool if we could have water runways, eg. to allow sea planes.

Would be super cool if we could have runway bridges (has anyone done those yet) - eg. for crossing highways or jutting out in to a lake if there isn't enough land.

And why aren't there fire/ambulance/police airplanes...?!

EDIT: There should also be some way for users to determine amount of runway required for the various plane sizes to land and take-off. Currently as a user I have no clue how long my runway should be, or where I could add exits (if it were possible to do *sigh* lol) for small/medium aircraft to exit sooner. Also, runway length (and type - eg. grass runway could handle tiny planes only) should determine which planes can land on it.

krzychu124 commented 2 years ago

allow sea planes.

cough, cough

https://user-images.githubusercontent.com/19638970/154829000-d327740e-1148-4697-9a60-91803c68efdb.mp4

There should also be some way for users to determine amount of runway required

See previous comment tiny text




bonus planned πŸ™ƒ

https://user-images.githubusercontent.com/19638970/154829083-4b42f33c-9905-4094-8bc0-6078f4e13bd1.mp4

originalfoo commented 2 years ago

bonus

It didn't faceplant the runway! Hurrah!

BTW, it would be freaking awesome if the plane AI took wind direction/speed in to account and planes had to adjust accordingly while landing.

Also, planes should fly straight ahead for like 500m or more after taking off - ie. gain some altitude before making a turn which IRL often drops some altitude.

What else? Hrm... aviation club aircraft should be like plane version of passenger helicopter :)

krzychu124 commented 2 years ago

BTW, it would be freaking awesome if the plane AI took wind direction/speed in to account and planes had to adjust accordingly while landing.

Do we have wind in game? I think there is something but I have no idea if direction and speed is available. Looks like it's doable but requires a bit more math :)

Also, planes should fly straight ahead for like 500m or more after taking off - ie. gain some altitude before making a turn which IRL often drops some altitude.

Yes, I started experiments from landing since it was easier, but take off also requires tweaking.

What else? Hrm... aviation club aircraft should be like plane version of passenger helicopter :)

You mean aviation toursplanned or just airport-airport connections, say only for small planes because of small maps?

originalfoo commented 2 years ago

Do we have wind in game? I think there is something but I have no idea if direction and speed is available. Looks like it's doable but requires a bit more math :)

Direction and speed of wind turbines changes, and there's also this mod: https://steamcommunity.com/sharedfiles/filedetails/?id=627096876

You mean aviation toursplanned or just airport-airport connections, say only for small planes because of small maps?

Small airports in mountainous terrain where it's nightmare to build huge airports.

krzychu124 commented 2 years ago

There is a problem with aircraft acceleration and braking properties and how they affect vehicle speed. I've spent 3h figuring out why when I check speed at taxiway (1f in the asset) aircrafts are moving 72km/h instead of 50... Changing braking from 1.5 to 2.0 increases plane speed on taxiway from 72km/h to 84 or something. It does not make sense - behaves completely different than for road vehicles. They move way faster than speed limit set in the taxiway asset -> setting the limit with TM:PE will be inaccurate. I've tested changing limit to 20km and medium planes(vanilla default without DLC) are moving 40km/h, at limit 50km/h(default) they move 72km/h, so assuming that each plane class has different acceleration and brake settings they will move with different speeds, in any case a lot faster than the limit.

I also noticed they tend to half enter taxiway junction when they should stop and wait. Normally vehicles stop before node and even add small gap for pedestrian crossing so vehicle front is right in front of the crossing, but for planes there is no gap and vehicle tries to stop at the stop location but with its center position (so half of it is already on the junction). I have no idea why is that but feel like it might be related with speed limit. I'm not sure if it is a bug in TM:PE (stop position) or vanilla thing, need to recheck.

Small airports in mountainous terrain where it's nightmare to build huge airports.

With DLC min length is (400f ?) so a bit too long if you want small (general aviation) aircrafts only. (I can add building/terrain collision detection, similar to Blimps πŸ˜„). Also would be cool if runways could be not perfectly flat and two-way: Lukla Airport, Nepal πŸ˜„

img

originalfoo commented 2 years ago

just dumping these here for no particular reason...

Aircraft sizes:

Landing / going to stand:

krzychu124 commented 2 years ago

@aubergine10

https://user-images.githubusercontent.com/19638970/157146307-4ca2ad63-c405-4105-93d1-adc6b273829a.mp4

krzychu124 commented 2 years ago

...a bit of automation πŸ™ƒ

https://user-images.githubusercontent.com/19638970/157166503-0d00f408-aee4-4b81-baec-bce89d1feaaf.mp4