Page 1 of 1

[kovarex] [0.17.11] Trains waiting at chain signals keeping changing state

Posted: Wed Mar 13, 2019 12:56 am
by GotLag
In Honk, I use the change of state to defines.train_state.arrive_signal to sound the horn for trains coming to a stop at signals.

I've received complaints from users and done some testing, and found that trains waiting at a chain signal for a red normal signal will, every 5 seconds or so, change state from defines.train_state.wait_signal to defines.train_state.arrive_signal, and then on the next tick flip back to defines.train_state.wait_signal, but only if the rail signal they are waiting for has been set to red by a circuit condition. It doesn't happen when waiting for a signal that is red due to traffic.

I've linked a screenshot below. The text output is from adding the following to the train state event handler:

Code: Select all

game.print(event.train.locomotives.front_movers[1].backer_name .. " entered state " .. TRAIN_STATE[event.train.state] .. " on tick " .. event.tick)
TRAIN_STATE is table to convert the numeric define to a readable string

S is signal, C is chain signal, the green circle shows the signal that's been set to red by circuit condition.
Image
(there's a third train waiting at another chain signal but it's hidden behind the minimap, the setup is the same as the other two)

if I turn off the constant-combinator and let the signals operate automatically the state-flipping behaviour stops and trains only change state when arriving at signals for the first time.

Sorry for the crappy screenshot and writeup but I'm a bit pressed for time right now.

Edit: the screenshot shows Fat Controller active but disabling it made no difference, and I have no running mods that exert any control on trains, only Honk that reads train state

Edit 2: apologies, forgot version info in title

Re: [0.17.11] Trains waiting at chain signals keeping changing state

Posted: Wed Mar 13, 2019 3:44 am
by invisus
GotLag wrote: Wed Mar 13, 2019 12:56 am I've received complaints from users and done some testing, and found that trains waiting at a chain signal for a red normal signal will, every 5 seconds or so, change state from defines.train_state.wait_signal to defines.train_state.arrive_signal, and then on the next tick flip back to defines.train_state.wait_signal, but only if the rail signal they are waiting for has been set to red by a circuit condition. It doesn't happen when waiting for a signal that is red due to traffic.
This wouldn't happen to be this here issue would it?

I've got trains in a.. what do they call them, stacker? Anyway, I've got trains waiting at chain signals and with the configuration below:
Honk.png
Honk.png (56.22 KiB) Viewed 2490 times
However, giving my cooldown is configured for 30 seconds, I get honks from each waiting train every 2-5 seconds. But...

I am NOT using circuit conditions.

My trains are waiting at chain signals for trains currently unloading at a group of identically named stations.

I can attempt this... "adding the following to the train state event handler" business (with a bit of guidance?), if it would help, or by uploading a save file.

Edit: Whoops, also on 0.17.11

Re: [0.17.11] Trains waiting at chain signals keeping changing state

Posted: Wed Mar 13, 2019 6:41 am
by GotLag
Odd, I could only get it to happen on my save when using circuit conditions. My trains were waiting for the same one station, held back by chain signals.

Re: [kovarex] [0.17.11] Trains waiting at chain signals keeping changing state

Posted: Tue May 07, 2019 10:13 am
by kovarex
Thanks for the report.
It is fixed for the next release now.