Serve interrupt only once per tick

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Wyverex42
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Dec 08, 2022 6:18 pm
Contact:

Serve interrupt only once per tick

Post by Wyverex42 »

TL;DR
Add a checkbox to an interrupt that prevents its condition from passing twice in the same tick, globally

What?
The way it would work is that if this interrupt's condition became true for any train globally, it cannot become true again in the same tick. This way, multiple trains passing the condition would have to wait and serving the interrupt would be spread out over several ticks, potentially failing on subsequent ticks.
Why?
These videos are the closest I found to implementing an LTN style train network in Vanilla 2.0
https://www.youtube.com/watch?v=EggDldJVggM
https://www.youtube.com/watch?v=rRGAVDndFwk

The one annoying hurdle that couldn't be solved in this approach is that more than one train could be sent to service a request because the interrupt's condition became true for all trains at once. It was solved with a global clock, assigning a unique Id to each station and then only passing the condition if the clock's signal equals the station's id (the O signal in the condition). However, the more stations you add, the longer it takes to wrap around. And you also need to ensure that station Ids are unique which makes stamping down blueprints more of a hassle.
11-05-2024, 09-19-40.png
11-05-2024, 09-19-40.png (88.25 KiB) Viewed 193 times
Once the interrupt has been served, the provider's train limit increases immediately, so next tick the interrupt might no longer pass (which is what we want). So if we had a way to say that a given interrupt should only be served once per tick, this would be quite a simple solution towards a truly generic LTN.

Thanks for considering!
Pongard
Inserter
Inserter
Posts: 21
Joined: Wed Oct 02, 2019 7:18 pm
Contact:

Re: Serve interrupt only once per tick

Post by Pongard »

This is so essential, I wonder why it doesn't get more responses. I played around a lot to get my trains to do what I want with interrupts, and it goes all down the drain because trains react to the signal faster, than the actions of a train who picked up the signal, update the signal. As an example in my case on the signal it says e.g. 4 iron ore, each train going to a iron ore pickup station reduces the amount by one. If the trains would react a bit delayed, 4 trains would start. This is not the case, much more trains start from the train hub :cry:
Post Reply

Return to “Ideas and Suggestions”