Bits and pieces about signals and AI
The following is a collection of links to stuff I posted over time, with some stealing from others. I put the more systematic stuff on top, and the bits and pieces below.
Messages sent by the system.
Influence factors on AI speed.
Two systematic write-up based on my experiments.
Nice scripting resource set up by Tankski
Mark's guide to the default signal, Part 1 - Semaphores and Part 2 - Light Signals. Both are indispensable to get started as they contain a complete reference of all the signals with their sometimes confusing names.
John's guide to British Signalling Practice to give you a first idea of the prototype. But don't ask too much about implementation of that using RW default signals, please.
If you want better UK semaphores here and now, get Mark's packs.
There are other signal sets using his scripts on UKTS:
China Clay for Export Route by Creative [post stating this]
IOW Network (contains items not in the signalling packs)
LNWR signals by Anthony Brailsford
Less widely known system calls (discovered by various people)
Searching for their names on UKTS gives you an overview of the current state of discovery in the not-so-clear cases.
General
secondsSinceMidnight = SysCall ("ScenarioManager:GetTimeOfDay")
Season = SysCall ("ScenarioManager:GetSeason") -- Spring = 0, summer = 1, autumn/fall = 2, winter = 3
Cab signalling
metresPerSecond = Call("GetCurrentSpeedLimit")
type, speed, distance = Call("GetNextSpeedLimit", direction, distance)
type, state, distance, aspect = Call("GetNextRestrictiveSignal", direction, distance)
I don't fully understand the distance parameter, most likely the upper limit for the distance returned.
See original post and erratum for full details.
For in-cab signalling to show nice results, route building must be flawless, too, and scripts must ensure that signals clear as far ahead as the cab displays them.
AI passes signals at red
AI stops at clear signals
AI refuses to take a certain path (not related to signal)
Consider the track type (passenger only/freight only) and direction. Also electrification type. Remember that visuals are nothing. What counts is the service type set in scenario editor, the colourful bands shown in route editor when you press space repeatedly, and the electrification type specified in the engine's .bin file.
Optional further reading
Bits and pieces
What is the difference between the various UK disk shunting signals?
Signal properties
How to place signals correctly
When to start the signal placement
Using German Zs2 as a theatre box for UK signals
Information on German signalling in the prototype
Scripting a scenery item to show animated advertisement
Modifying signal plates
Vague stuff about signal arm animation
Edits:
April 13: Added references to Mark and John, and fixed some typos and tweaked the formatting.
April 15: Added reference to signals using Mark's scripts.
Messages sent by the system.
Influence factors on AI speed.
Two systematic write-up based on my experiments.
Nice scripting resource set up by Tankski
Mark's guide to the default signal, Part 1 - Semaphores and Part 2 - Light Signals. Both are indispensable to get started as they contain a complete reference of all the signals with their sometimes confusing names.
John's guide to British Signalling Practice to give you a first idea of the prototype. But don't ask too much about implementation of that using RW default signals, please.
If you want better UK semaphores here and now, get Mark's packs.
There are other signal sets using his scripts on UKTS:
China Clay for Export Route by Creative [post stating this]
IOW Network (contains items not in the signalling packs)
LNWR signals by Anthony Brailsford
Less widely known system calls (discovered by various people)
Searching for their names on UKTS gives you an overview of the current state of discovery in the not-so-clear cases.
General
secondsSinceMidnight = SysCall ("ScenarioManager:GetTimeOfDay")
Season = SysCall ("ScenarioManager:GetSeason") -- Spring = 0, summer = 1, autumn/fall = 2, winter = 3
Cab signalling
metresPerSecond = Call("GetCurrentSpeedLimit")
type, speed, distance = Call("GetNextSpeedLimit", direction, distance)
type, state, distance, aspect = Call("GetNextRestrictiveSignal", direction, distance)
I don't fully understand the distance parameter, most likely the upper limit for the distance returned.
See original post and erratum for full details.
For in-cab signalling to show nice results, route building must be flawless, too, and scripts must ensure that signals clear as far ahead as the cab displays them.
AI passes signals at red
- Be sure that the signal .bin has this line:
- Code: Select all
<Stopping d:type="cDeltaString">eTrue</Stopping>
- Be sure that no numbered link is too far from the farthest switch, so a train may stop there. Some people love to push the numbered links of signals protecting a platform track beyond the platform. On motivation is that the speed limit in HUD matches German rules then. There might be other reasons, like covering a crossover at the far platform end.
What happens in my opinion is this: The dispatcher monitors trains like the script, i.e., all the area between link 0 and the numbered links is lumped together in one "inner block". Now if switches change while there is "something" inside, the dispatcher can either block this junction forever or forget about whatever was inside. I guess he opts for the second choice to keep the game going, relying on other parts (like the scenario editor) to rule out conflicts. Now, your train stopping at the platform becomes invisible if it is still "inside the junction", and the next AI train will crash into it.
This has also been observed for movements in opposite direction where the paths cross after stopping at the platform (inside the links of the signal for the opposite direction, which is cleared for AI during the stop). - If you modified the route (or signals) or otherwise have the slightest motivation to do so, load the scenario in scenario editor and move the trains concerned by a metre or so. That will make the dispatcher reconsider everything, possible introducing more red Xs, instead of staging the crash.
- You have 100% of all switches passed by AI wrapped in signal links, in all directions used, don't you?
AI stops at clear signals
- AI performs rule 39 everywhere which means that if the block beyond the next block is occupied and the next block is clear, it comes to a near halt and the resumes travel speed. Of course, this is only correct for UK semaphore home signals without a distant arm (slightly simplified). All you can do about it is setting the path for the tarrying AI train as far as possible. If two blocks are cleared, the AI train will still perform "half a rule 39 application", same for three, so the more blocks you can clear, the less time is lost. Of course it is hard to give a general advice how to set a clear route, you depend on the dispatcher setting the path well in advance, which he does most of the time.
- In very rare cases, someone put
- Code: Select all
<Stopping d:type="cDeltaString">eFalse</Stopping>
AI refuses to take a certain path (not related to signal)
Consider the track type (passenger only/freight only) and direction. Also electrification type. Remember that visuals are nothing. What counts is the service type set in scenario editor, the colourful bands shown in route editor when you press space repeatedly, and the electrification type specified in the engine's .bin file.
Optional further reading
Bits and pieces
What is the difference between the various UK disk shunting signals?
Signal properties
How to place signals correctly
When to start the signal placement
Using German Zs2 as a theatre box for UK signals
Information on German signalling in the prototype
Scripting a scenery item to show animated advertisement
Modifying signal plates
Vague stuff about signal arm animation
Edits:
April 13: Added references to Mark and John, and fixed some typos and tweaked the formatting.
April 15: Added reference to signals using Mark's scripts.