Spawn trains evenly between stations on multi-station rides #17842
Replies: 3 comments 4 replies
-
This got me thinking so I whipped up a proof of concept: This touches a lot of the code surrounding Ride::CreateVehicles(). It first gets a list of all the valid spawn locations (stations, and if block sections are used, block brakes and chain lift tops). When spawning the trains, it divides up the trains per station as evenly as possible - any trains left over go to the last station. This introduces some potential for improvements over the current implementation for block sections. Currently, it spawns all the trains at Station 1, then simulates their path along the track all in one frame, until they reach their actual stopping points. This can cause a noticeable bit of lag when spawning the trains. With this change, it could simply use the list of spawn locations, completely eliminating Ride::MoveTrainsToBlockBrakes(). Maybe there's some reason to do it the current way that I'm unaware of, but if not, it could simplify things quite a bit. There's also an existing bug that could interfere with this: If you build a station piece in simulate mode, it breaks the station indices. If you're building a ride in a launch mode, this straight up breaks the ride permanently, but it silently occurs with all other rides too. That might interact with this in weird ways. This is just a rough POC, there's still a lot of work that it would need - I did break block section mode a little, and I'm not sure how to handle it if the overflow from one station intersects with the next. |
Beta Was this translation helpful? Give feedback.
-
Would there be a way to make it a togglable option to check or uncheck in ride operation settings, in the event someone somehow doesn't want that, or would that not be a feasible or good idea? |
Beta Was this translation helpful? Give feedback.
-
If this is implemented it should for sure be a toggle as it would else possibly break a lot of "shoestring" rides which often have multiple stations but not all are used the same. |
Beta Was this translation helpful? Give feedback.
-
Currently, when you open/test a ride for the first time that has multiple stations and multiple trains, all trains will spawn at station 1.
I think it would be much better (and theoretically not that difficult to accomplish) to instead evenly divide the number of trains by the number of stations and spawn that number of trains at each station.
For example:
Advantages:
Disadvantages:
Beta Was this translation helpful? Give feedback.
All reactions