Rivens Realistic Train Acceleration (based on cargo) - Space Age


This mod makes train acceleration more realistic and depend on the amount of Cargo. (youtube demo included)

Tweaks
10 months ago
1.1 - 2.0
3.76K
Trains

b Crash

10 months ago

356.801 Error MainLoop.cpp:1435: Exception at tick 295750427: The mod Rivens Realistic Train Acceleration (0.1.25) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event TrainSpeeds::on_tick (ID 0)
Trying to change direction of automatic train moving on a path.
stack traceback:
[C]: in function 'newindex'
__TrainSpeeds
/control.lua:46: in function 'apply_speed'
TrainSpeeds/control.lua:256: in function 'get_trains'
TrainSpeeds/control.lua:287: in function <TrainSpeeds/control.lua:272>
356.802 Error ServerMultiplayerManager.cpp:84: MultiplayerManager failed: "The mod Rivens Realistic Train Acceleration (0.1.25) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event TrainSpeeds::on_tick (ID 0)
Trying to change direction of automatic train moving on a path.
stack traceback:
[C]: in function 'newindex'
__TrainSpeeds
/control.lua:46: in function 'apply_speed'
TrainSpeeds/control.lua:256: in function 'get_trains'
TrainSpeeds/control.lua:287: in function <TrainSpeeds/control.lua:272>"
356.802 Info ServerMultiplayerManager.cpp:806: updateTick(295750427) changing state from(InGame) to(Failed)
356.805 Quitting: multiplayer error.

10 months ago

Very odd, I actually have code that (supposedly) makes this impossible. Are you using trains that have locomotives oriented in both directions?

10 months ago

Do you have other mods installed?

10 months ago
(updated 10 months ago)

Yes i have double sided Locomotives and also use Electric Trains (https://mods.factorio.com/mod/ElectricTrains)

James' Electric Trains Plus (https://mods.factorio.com/mod/James-Train-Mod) is only installed but not in use right now.

It works fine with the fork (https://mods.factorio.com/mod/CargoWeight) but would like to go back to the original.

10 months ago
(updated 10 months ago)

Interestingly, I cannot reproduce it. Does the crash happen immediately, or does it take minutes or hours before it happens?

I have added some code that should reduce the odds, and made the 0.1.26 release, but... the code should really make it impossible already. At the beginning of each tick I note the speed of the train, and when adjusting the train-speed I already check whether it is in the same direction as the original direction. I added some margin, for very slow moving trains, to just 'leave it alone' ^_^

If you have a save-game that shows the crash, I'd be grateful if you could share it.

Also, I made the electric trains more realistic as well - they still accelerate faster than the default locomotives, but not by as much.

10 months ago

Usual it crashed few seconds after it loaded 1-3sec.
The update fixed it for me. I had no crash. Only difference i noticed on my side is, all my trains was all in stations this time and not moving while i changed the mod. Anyway it works now :) Thank you very much! Love this mod <3

10 months ago
(updated 10 months ago)

I think I found it... there is this pesky difference between +0.00 and -0.00 ...stares into the void

New response