Difference between revisions of "Self-regulating Network"
From #openttdcoop wiki
(Categories) |
(replaced with a new updated page :)) |
||
Line 1: | Line 1: | ||
− | + | To get to know SRNW it is important to be aware of features like 2-way eol and mechanisms related to that, like pathfinder trap. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | Note: Sometimes implicit orders can create serious problems and the train order lists need to be filled with 255 orders in order to prevent creation of implicit orders! | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | == | + | == Sideline waypoint SRNW == |
− | + | This is the most basic SRNW design and it is recommended to start with it as the other designs require knowledge of the basics. The basic SRNW will have those key segments: | |
− | + | ||
− | + | ||
− | + | ||
− | + | 1. SL works as a ring, while the only way out of the SL is through pickup stations | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | 2. Trains use a waypoint order to be able to load in any of the stations they could possibly end up in, and to make them "want" to go through the stations. | |
− | + | ||
− | + | 3. As trains do not have a (full load) order in the stations - as they do not have any station orders - we need to make sure that trains get fully loaded. That is solved by various SRNW stations (see junctionary), most typically using dummy trains.''' | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | After the SL exit there can happen any other order, but most typically an unpload order. | |
− | + | ||
− | + | ||
− | + | ||
− | + | [[File:Basic_SRNW.jpg|500px|thumb|center|Basic SRNW concept.]] | |
− | + | ||
− | + | ||
− | + | ||
+ | In the beginnings of SRNW, in public server game 121 and later on 149, we used waypoints which made a border of a SL as a closed mechanism, and trains would regulate over the industries connected to that sideline. | ||
+ | As a specific, every SL typically has an overflow which needs to be controlled by some sort of logic, be it timer, on-demand release or clock which detects how long has no train overflown. | ||
+ | ===Overflow Release Conditions=== | ||
+ | We generally recognize 3 main types of overflow release. Using a '''timer interval'''. Timer is probably the easiest way how to add any overflow control, you have to set it's trigger interval manually though. | ||
+ | Secondly there is the option to''' detect whether there are any free waiting bays''', and releasing trains there eventually. This generally gets to a problem where you release multipler trains towards one waiting bay, because it mostly does not detect trains which are on the way towards the waiting bay. | ||
+ | A good solution could be a '''clock''' - which is made to detect whether any trains have overflown in the last period of time, and eventually release a new train into the circuit if none has overflown. This can work sub-optimally if there is a lot of train waves. | ||
+ | The clock is red all the time, until all the memories become red - by the little running train making a complete loop without being interrupted. Interruption occurs by resetting all memories to green whenever a train overflows. | ||
+ | <gallery> | ||
+ | File:SRNW_Timer.png|A simple timer which blocks trains until going for the next order, usually set by a timetable. | ||
+ | File:SRNW_On_Demand_Release.png|Waiting bay detection for a SL, just like in overflow stations. | ||
+ | File:Mark_Clock.png|Mark's clock | ||
+ | File:SRNW_121orders.png|Typical SRNW orders. Pay special attention to the missing non-stop on the SL Exit order. | ||
+ | </gallery> | ||
+ | {{Archive_ExamplePS|PSG 121|121|The first really large scale SRNW game with a lot of experiments with stations. Many self-regulating twin-sidelines with 2 cargoes used on each.|[[File:SRNW_PSG121plan.png|200px]]}} | ||
+ | {{Archive_ExamplePS|PSG 149|149|Another attempt to make a system of multiple sidelines consisting of 2 cargoes.|[[File:SRNW_PSG149plan.png|200px]]}} | ||
+ | {{Archive_ExamplePS|PSG 172|172|Trying to build a SRNW using 4 cargoes, having a separate network for each cargo. We also noticed that massive stations create huge train waves which can be a problem.|[[File:SRNW_PSG172plan.png|200px]]}} | ||
− | [[ | + | == Orderless SRNW == |
− | [[ | + | Later on we tried to use SRNW globally so that trains would not regulate only within a single SL, but on the whole map. To reach absolute universalness of trains, we gave trains no orders (psg157 orders have no real role). That brought immense amount of new complications of constructing splits which tell trains where to actually go. This instance of self-regulation is limited to doing only one thing - pickup and drop at stations which supply/require the cargo. We also only did this with a single cargo type as that would require more split logic. |
+ | '''ML->SL Split''' is a necessary mechanism which forces trains into the waiting bay if the bay is empty. Also note the necessity of fail-safe mechanism as the 2-way entry signal on the ML could get red at any time, possibly deadlocking a train. | ||
+ | The biggest problem with orderless trains is that their pathfinding is extremely unpredictable as even 2way eol can easily break. | ||
+ | <gallery> | ||
+ | File:SRNW_157flipflop.png|Flipflop to direct ML traffic. | ||
+ | File:SRNW_157split.png|A counting splitter which forces every 8th train to split. | ||
+ | File:SRNW_180split.png|Forced split when waiting bay is empty, with fail-safe mechanism to avoild deadlocks. | ||
+ | File:SRNW_180trap.png|Pathfinder traps neccesary to make 2way eol work with orderless trains. | ||
+ | File:SRNW_PSG180orders.png|This SRNW has complicated orders. | ||
+ | </gallery> | ||
+ | {{Archive_ExamplePS|PSG 157|157|A specific passenger game which made trains split in equal ratios into all 16 ICE stations on the map, using flipflops, counter splits and similar logic mechanisms.|[[File:SRNW_PSG157plan.png|200px]]}} | ||
+ | {{Archive_ExamplePS|PSG 180|180|Truly global self-regulation split in two halves, each having access all sidelines, furtherly split in North/South drop using flipflops, so both ML ends had the same traffic coming out from the drop towards ML->SL splits. The split also helped to get rid of massive train waves from large synchronized stations.|[[File:SRNW_PSG180plan.png|200px]]}} | ||
+ | {{Archive_ExamplePS|PSG 199|199|A system of 8 rings which overflow into the n+1th, and stay within the ring if they succeed loading.|[[File:SRNW_PSG199plan.png|200px]]}} | ||
+ | |||
+ | == Conditional Order SRNW == | ||
+ | |||
+ | We also tried to make a self-regulating network where trains would evaluate what to do based on what percentage of cargo they randomly collected. This is rather typically done in passenger games but we also tried it with cargo. | ||
+ | |||
+ | Closely related to this is also a technique of orders by which you can cycle the conditional orders, so that until a train is 100% full, it will be lost. This creates the same effect as orderless trains and can cause some serious issues with directing trains - unless trains go only in a loop of stations, nowhere else - but you still need them to go somewhere else to unload/transfer the cargo they collected. There is a closer article about this, but the technique is not very usable. | ||
+ | |||
+ | http://blog.openttdcoop.org/2010/12/17/a-different-srnw-sl-concept/ | ||
+ | |||
+ | <gallery> | ||
+ | File:SRNW_200orders.png|The orders are rather simple, when the train reaches the end of the loop, it decides what to do. | ||
+ | </gallery> | ||
+ | |||
+ | {{Archive_ExamplePS|PSG 200|200|As one of the many things we did in this game, we tried SRNW loop with using conditional orders.|[[File:SRNW_200conditionals.png|200px]]}} | ||
+ | {{Archive_ExamplePS|PSG 230|230|One of the stations had a feeder with especially simple conditional orders which even have the exact stations in orders.|[[File:SRNW_230conditionals.png|200px]]}} | ||
+ | |||
+ | == TL1 Leader / Timed SRNW == | ||
+ | There were also attempts to make multi-cargo SRNW by making trains go in a certain pattern behind each other, so we would then be able to distinguis cargo type just by counting the TL1 indicator trains which created the spots. | ||
+ | It was also tried with timing the trains instead of creating spots for real trains by TL1 separators. | ||
+ | |||
+ | There is a detailed article available on the blog: http://blog.openttdcoop.org/2012/07/07/orderless-multi-cargo-srnw-my-first-article/ | ||
+ | |||
+ | Timing the trains is also a possibility http://wiki.openttdcoop.org/images/f/f5/SRNW_NoOrders1_LoPo.sav | ||
+ | |||
+ | This concept can however be done much simplier just by Unreachable waypoints below. | ||
+ | |||
+ | == Unreachable waypoint SRNW == | ||
+ | The concept of this kind of SRNW is having trains chase a destination which they can never reach, but they still see the path to it through pathfinder traps. | ||
+ | First off, unreachable waypoint SRNW was just a concept for psg207 which would make SML work as a SRNW mechanism - making trains want to go towards the center of the circle, able to split there, but never able to reach the waypoint thanks to pf traps. | ||
+ | Later on we realized that trains heading towards a waypoint can be very easily directed, allowing for a very feasible multi-cargo SRNW and global SRNWs in general, which we also tried in psg 223. We found out that this idea completely overthrows Orderless SRNW due to vastly reduced complications and increased amount of possibilities. This concept was furtherly re-applied in psg239 where we did it with a total of 7 cargoes. | ||
+ | <gallery> | ||
+ | File:SRNW_207trap.png|Trains believe they can find beer through the inner ring of the SML. | ||
+ | File:SRNW_223split.png|Two separate splits for ore and coal, each having it's own waypoint. | ||
+ | File:SRNW_239split.png|A split which only makes trains splits if they are required by a certain cargo type. | ||
+ | File:SRNW_207orders.png|Trains heading towards station they can never reach. With 255 orders to prevent implicit order creation. | ||
+ | </gallery> | ||
+ | {{Archive_ExamplePS|PSG 207|207|Unique usage of SML, turning it into a SRNW where trains use the inner ring "bait" as exit, making sure trains will not be able to exit the ML until they manage to get to the inner ring - which adds distance and randomness to the splitting towards various ICE stations.|[[File:SRNW_PSG207plan.png|200px]]}} | ||
+ | {{Archive_ExamplePS|PSG 223|223|Two-cargo SRNW which directs trains based on two waypoints which could never be reached.|[[File:SRNW_PSG223plan.png|200px]]}} | ||
+ | {{Archive_ExamplePS|PSG 239|239|Having 7 cargoes brings some new problems as it is inconvenient to separate all 7 cargoes at each SL split, we even tried to make some splits which would be able to all that at once.|[[File:SRNW_PSG239plan.png|200px]]}} | ||
+ | |||
+ | |||
+ | == Refit SRNW == | ||
+ | |||
+ | When it comes to multi-cargo SRNW, we wanted not only to have a few separate groups of trains running on the same network, each group taking care of their own primaries. We wanted to have all trains be able to adapt to what cargo is needed to be transported on that SL. | ||
+ | Therefore we did a series of conditional orders and refits, refitting until trains find cargo to load. This is typically done by having a waypoint like "Fruit Check". When trains go through the waypoint, they look if they have loaded or not - by conditional orders. If they did not load, they apparently need to refit and try again with another cargo. If they did load, they just proceed towards the drop. Making the "0% load" check behind a reverser is important in order to make trains prefer going towards the loading station (this could also be solved by massive penalties but reversers are more reliable). | ||
+ | <gallery> | ||
+ | File:SRNW_214check.png|The decision point, did the train exit station and is full, or did it pass around empty and needs refit to next cargo? | ||
+ | File:SRNW_214orders.png|Typical train orders for refit SRNW. If empty, refit to next cargo. | ||
+ | </gallery> | ||
+ | {{Archive_ExamplePS|PSG 214|214|Every SL has one group of trains which is able to take care of all the 4 cargoes there, no matter how much of which cargo is available.|[[File:SRNW_PSG214plan.png|200px]]}} |
Revision as of 19:59, 26 November 2012
To get to know SRNW it is important to be aware of features like 2-way eol and mechanisms related to that, like pathfinder trap.
Note: Sometimes implicit orders can create serious problems and the train order lists need to be filled with 255 orders in order to prevent creation of implicit orders!
Contents
Sideline waypoint SRNW
This is the most basic SRNW design and it is recommended to start with it as the other designs require knowledge of the basics. The basic SRNW will have those key segments:
1. SL works as a ring, while the only way out of the SL is through pickup stations
2. Trains use a waypoint order to be able to load in any of the stations they could possibly end up in, and to make them "want" to go through the stations.
3. As trains do not have a (full load) order in the stations - as they do not have any station orders - we need to make sure that trains get fully loaded. That is solved by various SRNW stations (see junctionary), most typically using dummy trains.
After the SL exit there can happen any other order, but most typically an unpload order.
In the beginnings of SRNW, in public server game 121 and later on 149, we used waypoints which made a border of a SL as a closed mechanism, and trains would regulate over the industries connected to that sideline. As a specific, every SL typically has an overflow which needs to be controlled by some sort of logic, be it timer, on-demand release or clock which detects how long has no train overflown.
Overflow Release Conditions
We generally recognize 3 main types of overflow release. Using a timer interval. Timer is probably the easiest way how to add any overflow control, you have to set it's trigger interval manually though. Secondly there is the option to detect whether there are any free waiting bays, and releasing trains there eventually. This generally gets to a problem where you release multipler trains towards one waiting bay, because it mostly does not detect trains which are on the way towards the waiting bay. A good solution could be a clock - which is made to detect whether any trains have overflown in the last period of time, and eventually release a new train into the circuit if none has overflown. This can work sub-optimally if there is a lot of train waves. The clock is red all the time, until all the memories become red - by the little running train making a complete loop without being interrupted. Interruption occurs by resetting all memories to green whenever a train overflows.
PSG 121 | Download: Public Server Game 121 Final / Archive entry for this game |
The first really large scale SRNW game with a lot of experiments with stations. Many self-regulating twin-sidelines with 2 cargoes used on each. |
PSG 149 | Download: Public Server Game 149 Final / Archive entry for this game |
Another attempt to make a system of multiple sidelines consisting of 2 cargoes. |
PSG 172 | Download: Public Server Game 172 Final / Archive entry for this game |
Trying to build a SRNW using 4 cargoes, having a separate network for each cargo. We also noticed that massive stations create huge train waves which can be a problem. |
Orderless SRNW
Later on we tried to use SRNW globally so that trains would not regulate only within a single SL, but on the whole map. To reach absolute universalness of trains, we gave trains no orders (psg157 orders have no real role). That brought immense amount of new complications of constructing splits which tell trains where to actually go. This instance of self-regulation is limited to doing only one thing - pickup and drop at stations which supply/require the cargo. We also only did this with a single cargo type as that would require more split logic. ML->SL Split is a necessary mechanism which forces trains into the waiting bay if the bay is empty. Also note the necessity of fail-safe mechanism as the 2-way entry signal on the ML could get red at any time, possibly deadlocking a train. The biggest problem with orderless trains is that their pathfinding is extremely unpredictable as even 2way eol can easily break.
PSG 157 | Download: Public Server Game 157 Final / Archive entry for this game |
A specific passenger game which made trains split in equal ratios into all 16 ICE stations on the map, using flipflops, counter splits and similar logic mechanisms. |
PSG 180 | Download: Public Server Game 180 Final / Archive entry for this game |
Truly global self-regulation split in two halves, each having access all sidelines, furtherly split in North/South drop using flipflops, so both ML ends had the same traffic coming out from the drop towards ML->SL splits. The split also helped to get rid of massive train waves from large synchronized stations. |
PSG 199 | Download: Public Server Game 199 Final / Archive entry for this game |
A system of 8 rings which overflow into the n+1th, and stay within the ring if they succeed loading. |
Conditional Order SRNW
We also tried to make a self-regulating network where trains would evaluate what to do based on what percentage of cargo they randomly collected. This is rather typically done in passenger games but we also tried it with cargo.
Closely related to this is also a technique of orders by which you can cycle the conditional orders, so that until a train is 100% full, it will be lost. This creates the same effect as orderless trains and can cause some serious issues with directing trains - unless trains go only in a loop of stations, nowhere else - but you still need them to go somewhere else to unload/transfer the cargo they collected. There is a closer article about this, but the technique is not very usable.
http://blog.openttdcoop.org/2010/12/17/a-different-srnw-sl-concept/
PSG 200 | Download: Public Server Game 200 Final / Archive entry for this game |
As one of the many things we did in this game, we tried SRNW loop with using conditional orders. |
PSG 230 | Download: Public Server Game 230 Final / Archive entry for this game |
One of the stations had a feeder with especially simple conditional orders which even have the exact stations in orders. |
TL1 Leader / Timed SRNW
There were also attempts to make multi-cargo SRNW by making trains go in a certain pattern behind each other, so we would then be able to distinguis cargo type just by counting the TL1 indicator trains which created the spots. It was also tried with timing the trains instead of creating spots for real trains by TL1 separators.
There is a detailed article available on the blog: http://blog.openttdcoop.org/2012/07/07/orderless-multi-cargo-srnw-my-first-article/
Timing the trains is also a possibility http://wiki.openttdcoop.org/images/f/f5/SRNW_NoOrders1_LoPo.sav
This concept can however be done much simplier just by Unreachable waypoints below.
Unreachable waypoint SRNW
The concept of this kind of SRNW is having trains chase a destination which they can never reach, but they still see the path to it through pathfinder traps. First off, unreachable waypoint SRNW was just a concept for psg207 which would make SML work as a SRNW mechanism - making trains want to go towards the center of the circle, able to split there, but never able to reach the waypoint thanks to pf traps. Later on we realized that trains heading towards a waypoint can be very easily directed, allowing for a very feasible multi-cargo SRNW and global SRNWs in general, which we also tried in psg 223. We found out that this idea completely overthrows Orderless SRNW due to vastly reduced complications and increased amount of possibilities. This concept was furtherly re-applied in psg239 where we did it with a total of 7 cargoes.
PSG 207 | Download: Public Server Game 207 Final / Archive entry for this game |
Unique usage of SML, turning it into a SRNW where trains use the inner ring "bait" as exit, making sure trains will not be able to exit the ML until they manage to get to the inner ring - which adds distance and randomness to the splitting towards various ICE stations. |
PSG 223 | Download: Public Server Game 223 Final / Archive entry for this game |
Two-cargo SRNW which directs trains based on two waypoints which could never be reached. |
PSG 239 | Download: Public Server Game 239 Final / Archive entry for this game |
Having 7 cargoes brings some new problems as it is inconvenient to separate all 7 cargoes at each SL split, we even tried to make some splits which would be able to all that at once. |
Refit SRNW
When it comes to multi-cargo SRNW, we wanted not only to have a few separate groups of trains running on the same network, each group taking care of their own primaries. We wanted to have all trains be able to adapt to what cargo is needed to be transported on that SL. Therefore we did a series of conditional orders and refits, refitting until trains find cargo to load. This is typically done by having a waypoint like "Fruit Check". When trains go through the waypoint, they look if they have loaded or not - by conditional orders. If they did not load, they apparently need to refit and try again with another cargo. If they did load, they just proceed towards the drop. Making the "0% load" check behind a reverser is important in order to make trains prefer going towards the loading station (this could also be solved by massive penalties but reversers are more reliable).
PSG 214 | Download: Public Server Game 214 Final / Archive entry for this game |
Every SL has one group of trains which is able to take care of all the 4 cargoes there, no matter how much of which cargo is available. |