Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Trains reserve track by tile, not by segment #11

Open
BenLubar opened this issue Mar 2, 2024 · 0 comments
Open

Feature request: Trains reserve track by tile, not by segment #11

BenLubar opened this issue Mar 2, 2024 · 0 comments

Comments

@BenLubar
Copy link

BenLubar commented Mar 2, 2024

Right now, trains reserve an entire section of the track and don't un-reserve it until they're out of that section. That means if you have two signals in a station's loop like this, you can end up with both trains stuck waiting for each other:

image

If you instead only put in one signal, the entire track gets reserved by the first train and the second train can't get anywhere near the station:

image

If we try to add a signal at the end to close off the second train's section, we end up with this:

image

My suggestion is that trains should reserve the pieces of track they want to pass through, starting with the first tile the train will enter, and ending with the tile the train wants to move to (either a station or a signal). Then, the train only un-reserves a tile when it passes off of the tile (or to avoid making cosmetic differences in trains have a gameplay effect, keep a queue of the last four tiles the train engine has exited and unreserve the tile that gets kicked out of the queue each time).

This means that in the scenario shown above, when a train is arriving, it looks like this:

image

The red train can't move at all because it can't reserve every tile along the path it wants to take. However, once the blue train has arrived at its signal, the red train can immediately depart through the track segment that the blue train is on because the tiles the red train needs to cross are no longer reserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant