Author Topic: r8133 Time-accelerated train  (Read 879 times)

0 Members and 1 Guest are viewing this topic.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4812
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
r8133 Time-accelerated train
« on: March 31, 2017, 08:08:42 PM »
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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4247
  • Total likes: 175
  • Helpful: 149
  • Languages: EN, DE, AT
Re: r8133 Time-accelerated train
« Reply #1 on: April 01, 2017, 04:54:50 PM »
Was the train sent to depot and then started again?
Parsley, sage, rosemary, and maggikraut.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4812
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: r8133 Time-accelerated train
« Reply #2 on: April 01, 2017, 05:34:49 PM »
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).
« Last Edit: April 01, 2017, 05:52:14 PM by Ters »

Offline DrSuperGood

Re: r8133 Time-accelerated train
« Reply #3 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. 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4812
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: r8133 Time-accelerated train
« Reply #4 on: April 02, 2017, 07:28:44 AM »
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.

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.

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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4247
  • Total likes: 175
  • Helpful: 149
  • Languages: EN, DE, AT
Re: r8133 Time-accelerated train
« Reply #5 on: April 02, 2017, 05:48:33 PM »
@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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4812
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: r8133 Time-accelerated train
« Reply #6 on: April 02, 2017, 06:16:09 PM »
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).

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4247
  • Total likes: 175
  • Helpful: 149
  • Languages: EN, DE, AT
Re: r8133 Time-accelerated train
« Reply #7 on: April 02, 2017, 06:40:15 PM »
I build one-way signals, did not see your statement about deadlock.
Parsley, sage, rosemary, and maggikraut.

Offline DrSuperGood

Re: r8133 Time-accelerated train
« Reply #8 on: April 03, 2017, 02:55:44 AM »
Quote
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.
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.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2592
  • Total likes: 289
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: r8133 Time-accelerated train
« Reply #9 on: April 03, 2017, 05:01:33 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4812
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: r8133 Time-accelerated train
« Reply #10 on: April 03, 2017, 06:00:19 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.

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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4247
  • Total likes: 175
  • Helpful: 149
  • Languages: EN, DE, AT
Re: r8133 Time-accelerated train
« Reply #11 on: April 03, 2017, 04:51:19 PM »
Indeed the train is added twice to the sync list. Not sure how to fix this.
Parsley, sage, rosemary, and maggikraut.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4812
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: r8133 Time-accelerated train
« Reply #12 on: April 03, 2017, 05:41:07 PM »
Added twice, or not removed once?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4247
  • Total likes: 175
  • Helpful: 149
  • Languages: EN, DE, AT
Re: r8133 Time-accelerated train
« Reply #13 on: April 03, 2017, 06:45:31 PM »
Not removed once, then added again when leaving depot. Should be fixed with r8174.
Parsley, sage, rosemary, and maggikraut.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4812
  • Total likes: 191
  • Helpful: 108
  • Languages: EN, NO
Re: r8133 Time-accelerated train
« Reply #14 on: April 03, 2017, 07:28:16 PM »
That's excellent! It was perhaps not the most likely bug to trigger, but not exactly completely unlikely either.