Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

[Convoy] All trams on map get negative speed, unable to move

Started by CK, January 19, 2022, 04:21:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


In my game which started in 1950 and went on into 1993 all trams (even on unlinked tracks) suddenly went to a negative speed where they're unable to move. Clicking the schedule button to make them recalculate their route did not help. If a bit of track that is reserved is clicked it shows some insanely large figure for speed for the reserving vehicle suggesting that some kind of integer/buffer overflow is taking place. Restarting the vehicle by clicking the schedule button and then closing the window works intermittently. I have no idea how to reproduce it. I've tried running a circuit with similar trams in a separate save and the fault did not develop.

I'm on the latest build (c5c9a97 as of today) and here is my save


Oh, maybe this issue is involved.,21334.msg198466.html

Ahh, I thought it was just an error in the expression and fixed it, but the variables were also wrong.
max_speed_drive_by_sight_tram must be max_speed_drive_by_sight_tram_kmh.

max_speed_drive_by_sight_tram = kmh_to_speed(max_speed_drive_by_sight_tram_kmh);


I have pull-requested a countermeasure to this. #471.
However, tram that is already behaving strangely needs to be rescheduled. Is it possible to improve this further?
The fix is to replace the default values to fix the broken setting values.
Anyway, I didn't implement this so I don't know much about how it works. There may be a better solution. Please check again.


This fix, together with a supplemental fix, have been implemented on the current nightly - I should be grateful if people could confirm whether this is now working.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.


It hasn't occurred since the update so I assume it's been fixed now.