Skip to main content
Topic: Trains sometimes takes a tile more (Read 5419 times) previous topic - next topic

Trains sometimes takes a tile more

Hi. I have very complex saegame and there I sometimes experience, that a train is longer than it should be. The train have one BR 155 engine and 13 Goods Flachwagen. The declared length is 7 tiles. The most of the trains are that length but sometimes appears one or two, which takes a tile more. The tile is usualy in a crossings just before the station and block the track for all trains. The trian takes a tile more at all stations it stops. The only help is to send it to depot and dissasemble it. I can send a savegame, but it is a bit big.

Re: Trains sometimes takes a tile more

Reply #1
I've noticed that one too! I just add an extra tracktile to the station to avoid problems. The train will load 100% in these cases, so every wagon is inside the station, but the track behind it just stays reserved.
Bob Marley: No woman, no cry

Programmer: No user, no bugs



Re: Trains sometimes takes a tile more

Reply #2
This is due to the internal movement code. Any fix to this has 1001 error in other places.

Re: Trains sometimes takes a tile more

Reply #3
How about working around this by changing the display of (the number of) required tiles in the depot, only for those cases where it is needed?

Re: Trains sometimes takes a tile more

Reply #4
I did some experiments. The problem is a property of train (convoy). If a trains "overtakes" in one station, it will do it everywhere. When I send the train to the depot, remove the last wagon and then put it back, the train got repaired. MAybe you coud add some "just stopped" test, which could re-count the tiles and free the last one, if it is overstepped.

Re: Trains sometimes takes a tile more

Reply #5
The problem should occur only in north and east directions, but not south or west.

Re: Trains sometimes takes a tile more

Reply #6
But why this problem doesn't happen to all same convoi ?
Front convoi of attached image doesn't have problem. Only this convoi turned direction.

I think older version of simutrans didn't have this problem.
So, this should be a bug.

Re: Trains sometimes takes a tile more

Reply #7
Does this help?

Code: [Select]
Index: simconvoi.cc
===================================================================
--- simconvoi.cc        (revision 2615)
+++ simconvoi.cc        (working copy)
@@ -589,7 +589,7 @@
                                // now actually move the units
                                while(sp_soll>>12) {
                                        uint32 sp_hat = fahr[0]->fahre_basis(1<<12);
-                                       int v_nr = get_vehicle_at_length((steps_driven++)>>4);
+                                       int v_nr = get_vehicle_at_length((++steps_driven)>>4);
                                        // stop when depot reached
                                        if(state==INITIAL) {
                                                break;
Parsley, sage, rosemary, and maggikraut.

Re: Trains sometimes takes a tile more

Reply #8
At least for me, it does! How do you found this? :award:

Re: Trains sometimes takes a tile more

Reply #9
Thank you. It solved my problem above.

Maybe, we confounded this topic's problem with old known problem. :)

Re: Trains sometimes takes a tile more

Reply #10
Lets wait for prissi's opinion  8)
Parsley, sage, rosemary, and maggikraut.

Re: Trains sometimes takes a tile more

Reply #11
This looks good, although I did not look at the code for a month or so, so everything is from memory. I suppose this is the problem with 127/255 internal steps, which of course do not match, especially with the above wrong statement. Better to do this in two lines anyway, I suppose.

Re: Trains sometimes takes a tile more

Reply #12
This patch had been denied ?
Someone will write a different solution to solve this problem ?

Re: Trains sometimes takes a tile more

Reply #13
I don't know. It would be the first one to be proud member of "denied patches" board :)
Parsley, sage, rosemary, and maggikraut.

Re: Trains sometimes takes a tile more

Reply #14
The bug with too short trains at a signal is unsolved,obviously. However, please, Dwachs you can submit too. Please submit your own bugfixes.

 

Re: Trains sometimes takes a tile more

Reply #15
incorporated in 2644.
Parsley, sage, rosemary, and maggikraut.