News:

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

r8133 Time-accelerated train

Started by Ters, March 31, 2017, 08:08:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ters

I just noticed some very odd behavior in a train. It was moving much faster than it should. First I though I had hit fast-forward, but it wasn't moving quite as fast (or jerky) as that, and the rest of the world was moving at regular speed, including the train's identical brethren. Unfortunately, the effect doesn't survive a save-load cycle, so I have no save game to share. I do however think the trigger was sending the train back into the depot before it fully emerged (twice). The really strange thing is that the train did not report a higher speed than normal in its information window. In fact, I could find no values that were out of the ordinary in the information window or the detail window. Speed, power, weight and friction were all the same as the other identical non-accelerated trains.

Dwachs

Was the train sent to depot and then started again?
Parsley, sage, rosemary, and maggikraut.

Ters

#2
It departed the depot, but hit a red signal before it had fully emerged. This was a deadlock due to another train heading towards the depot, so I sent it back into the depot. Then I started it again too early before the other train had made its reservation, so the same thing happened again. When I started it for the third time, I noticed it was going too fast. It might have gone to fast the second time as well, but I didn't have the time to notice.

Edit:
It takes only one trip into the depot to reproduce. In pak64, it can be done with a kkStB91 with 7 stake cars exiting from a depot, with a 90 degree (right hand) turn immediately outside the depot followed by a straight tile with a red signal. Once the train stops at red, send it back to depot. I then made the signal green by sending the train beyond to the same depot, and then sent the aforementioned train out again (I gave the start command before the second train had entered the depot, but after it had reserved the route into it).

DrSuperGood

This is a long running bug? I noticed that long 12 tile trains in my multiplayer networks were getting truncated to only 3-4 tiles while emerging from a depot due to signals. When the train turns around at a terminal it fixes itself, mostly, but could also end up being stuck at the intersection during a save/load cycle. It also is likely the result of some uninitialized stuff as sending orders to those trains has a high chance of OOSing a Windows client from Linux server.

I am guessing that some of the cars/coaches are not being factored into the physics. The UI and payment systems approximate the potential maximum speed, not the actual maximum speed which is produced by repeated sampling of a different formula. It is possible and well known that they have different long term results, but usually not that different.

Please provide this problem in an easy to reproduce way. This includes...
Version numbers of Simutrans used.
Version numbers of pakset used.
Save file with everything set up to reproduce the problem.
Instructions to go from loading save file to reproducing the problem with a high reliability of the problem occurring.

Ters

Quote from: DrSuperGood on April 01, 2017, 09:49:51 PM
Please provide this problem in an easy to reproduce way. This includes...
Version numbers of Simutrans used.
Version numbers of pakset used.
Save file with everything set up to reproduce the problem.
Instructions to go from loading save file to reproducing the problem with a high reliability of the problem occurring.

I already have, except that you have to build a short section of track yourself and assemble the trains, but that is the easy part. Timing the trains is the tricky part.

Quote from: DrSuperGood on April 01, 2017, 09:49:51 PM
This is a long running bug? I noticed that long 12 tile trains in my multiplayer networks were getting truncated to only 3-4 tiles while emerging from a depot due to signals. When the train turns around at a terminal it fixes itself, mostly, but could also end up being stuck at the intersection during a save/load cycle.

I don't know how long this bug been around, but the train was not truncated, nor does it fix itself in any way when turning around at stations.

Quote from: DrSuperGood on April 01, 2017, 09:49:51 PM
I am guessing that some of the cars/coaches are not being factored into the physics. The UI and payment systems approximate the potential maximum speed, not the actual maximum speed which is produced by repeated sampling of a different formula. It is possible and well known that they have different long term results, but usually not that different.

I was thinking something like that (messed up friction factors, messed up weights), but when trains move faster than maximum speed, they usually correctly report their actual speed. In this case, the train is not only moving faster than its stated maximum speed, it is moving faster than its actual reported speed. (I just did a race with a similar locomotive without cars. Although I failed to start them exactly at the same time, the time-accelerated train still outpaced the other one once both got up to the same reported speed.) Friction factors and weights do update correctly when turning and loading/unloading respectively. There must be some factor which is stored in the vehicle or convoy objects, but are not displayed anywhere nor saved or loaded.

Dwachs

@Ters I cannot reproduce this: If I send the train waiting at the signal back to the depot it does not turn and still wants to go through the signal to the depot.
Parsley, sage, rosemary, and maggikraut.

Ters

Is your signal one-way? I didn't explicitly state that my signal is two-way, since it has to be in order for a train coming in the opposite direction causing a dead-lock (and a two-way signal is the default unless you drag).

Dwachs

I build one-way signals, did not see your statement about deadlock.
Parsley, sage, rosemary, and maggikraut.

DrSuperGood

QuoteI already have, except that you have to build a short section of track yourself and assemble the trains, but that is the easy part. Timing the trains is the tricky part.
It is most ideal if it literally is a 1 press to reproduce situation. This avoids potential misunderstandings when trying to reproduce.

Is it possible the convoy is being added twice to the convoy list? In that case it would be iterated twice per tick, resulting in it moving twice as fast as intended while still reporting the intended metrics.

An_dz

Quote from: DrSuperGood on April 03, 2017, 02:55:44 AM
Is it possible the convoy is being added twice to the convoy list? In that case it would be iterated twice per tick, resulting in it moving twice as fast as intended while still reporting the intended metrics.
But wouldn't this survive a save-load cycle? Ters said it doesn't.

Ters

Quote from: DrSuperGood on April 03, 2017, 02:55:44 AM
It is most ideal if it literally is a 1 press to reproduce situation. This avoids potential misunderstandings when trying to reproduce.

Indeed, but I have no way to do that. Perhaps with scripting it can be done, but I have not looked into Simutrans scripting at all.

However, I have been able to simply the steps to recreate. Just have a train that is long enough so that you can send it back in before it has fully emerged. It doesn't have to stand still when you send it back, so no need for a signal or a second train to create deadlock, or even the turn. The important thing seems to be that the train will not drive back into the depot, it will just disappear into the depot in an instant (or maybe two). When you send it back out, it is time-accelerated.

Quote from: DrSuperGood on April 03, 2017, 02:55:44 AM
Is it possible the convoy is being added twice to the convoy list? In that case it would be iterated twice per tick, resulting in it moving twice as fast as intended while still reporting the intended metrics.

That is indeed an interesting theory. I can't say for sure whether it is moving 100% faster or just 50%, though. That would require holding a ruler up to the screen and timing it with a with a stop-watch, or some long parallell course where I can see otherwise identical trains side by side at full speed.

Dwachs

Indeed the train is added twice to the sync list. Not sure how to fix this.
Parsley, sage, rosemary, and maggikraut.

Ters

Added twice, or not removed once?

Dwachs

Not removed once, then added again when leaving depot. Should be fixed with r8174.
Parsley, sage, rosemary, and maggikraut.

Ters

That's excellent! It was perhaps not the most likely bug to trigger, but not exactly completely unlikely either.