FS#1063 - train head and tail move at different speeds when passing a curve

Attached to Project: OpenTTD
Opened by Phazorx (Phazorx) - Saturday, 21 July 2007, 15:24 GMT
Last edited by Remko Bijker (Rubidium) - Monday, 06 August 2007, 20:21 GMT
Type Bug
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
  • Vladimir Guryanov (Wowanxm) (2013-07-09)
  • Bauke (bcmpinc) (2013-03-02)
  • christopher booth (Chris_Booth) (2010-01-07)
Private No


Can be also described like: while passing a curve train grows by a quarter.

Roots of the issues are in how diagonal tracks are handled by the game - traveled distance and visual length are calculated differently on diagonal tracks and same on straight tracks. For sprite drawing and representation purposes each tile fits 2 standard wagons on straight or diagonal tracks, however, for speed/distatnce calculation it is 2 per for straight tile and 2.5 for diagonal. This becomes more apparent and problematic with longer trains, 20 tile trains (40 cars) would gain extra "5 tiles of drag" by the time it is fully diagonal, and following train in same track would have to stop/slow down.

This affects all releases starting form original TTD, so this is "inherited behavior".

I understan complexity of correcting it to be more realisitc (changing representation part and not using 2 cars per diagonal for drawing purposes) so I'd rather see change on speed/distance part and instead of using a factor of 0.75 for diagonal travel make it 1, matching "visual" ratio.

Attached savegame illustrates the problem
This task depends upon

Closed by  Remko Bijker (Rubidium)
Friday, 07 September 2007, 21:48 GMT
Reason for closing:  Won't fix
Additional comments about closing:  See last comment.
Comment by Ammler (Ammler) - Saturday, 25 August 2007, 23:33 GMT
As this Problem does not only exists in OpenTTD, It's there since TTO. I attached a Save for the Patch too.
Comment by Remko Bijker (Rubidium) - Friday, 07 September 2007, 21:47 GMT
Fixing this means shortening vehicles, which means:
- 500+ modified vehicle graphics for trunk (different angles, 256 vehicles). If you change the trains, you also have to change the road vehicles, ships and aircraft.
- basically ditching NewGRF support as the basic principle of the game becomes totally different

Furthermore there's the fact that TTD is not designed to have the vehicles run diagonally.

Fixing it the other way around, by increasing the speed of trains won't fix it *at* all, because you need to accelerate the whole train, which causes the whole train to go even faster on diagonal tracks, which makes even more money.

I just think this is the penalty you have to pay for "cheating" the system into getting your goods quicker at the destination (and thus getting more money).
Comment by Bauke (bcmpinc) - Monday, 08 July 2013, 16:42 GMT
This patch, based on vanilla openttd, svn revision 25057, fixes this bug by correcting the speed of all wagons, except the head. So the speed of trains remain the same, but they no longer grow and shrink while passing corners.

This patch introduces a new bug. Diagonal train segments will be drawn overlapping. As Remko mentioned, this cannot easily be fixed.

Savegames with/without this patch can be loaded fine without/with this patch, but trains need to be sent through depot to fix the distances between wagons.