Why TSW measures distance like straight line to objective not like real distance which would be measured by rail miles/km? And are there plans to change that?
Apparently it's to do with performance or efficency or something. It could, thus, be perhaps something to do with how routes are actually built, or perhaps could be to do with the fact you can get up and walk around (distances would have to be measured in a straight line there because the game can't dictate a specific path you'll take).
It's a performance decision. The game does a distance calculation between player location and marker most likely either every time movement is made or in rendering each frame (not sure how they actually do it). Assume its the latter... Straight-line distance is just the distance formula which is super quick to calculate. Calculating track distance requires the game to create a path accounting for curves, switches, etc... along the track between player and marker and is more intensive. For simplicity, let's assume the track in the game is laid in segments, of which we know the length. Since the dispatcher knows the path the train is going to take (since DTG have a more scripted/preset dispatcher), the path is technically already there. One way in a very simplistic approach would just be to loop over each track segment of which a distance is known and sum it up between point A and B. Problems also arise when curves, switches, etc. come into play, as its very difficult to calculate a distance along a curved line. Typically, the curve is "flattened" into very small straight line segments to estimate the distance. But all this would have to be done each time the distance is updated, and if that's changing every time the scene is rendered (and you're at 60FPS), that's A LOT to calculate that takes time away from other more important game functions (physics engine, rendering, etc.), especially if you're doing something like an ICE run where the two points are on the opposite side of the map. Of course this is a simplistic example, and there are more optimized ways of doing things, but that takes dev time away from more pressing issues.
When measuring distance to objective it is like straight line. But when driving train and measuring distance to the next speed limit and next signal TSW measures it like rail miles/km. So it seems that there are two measuring systems in place.
I noticed that too. You can have the objective and a signal at the same point and the distance to each shows as being different when quite far from it on a bendy track. I suppose it’s because signals and speed limits etc are only active when driving the train but the objectives can be uncoupling tasks, switches to change, places to walk to etc which are also active when you are on foot.
That is why Train Sim World can't have estimated time of arrival either. I wonder if there is improper distance measurement while driving the train because it will affect system performance?
Yes it can be confusing. On relatively straight routes like HMA it doesn't matter much but on SPG you don't know where you are sometimes. Imagine your car GPS doing the same thing. Gives new meaning to "Daddy, are we there yet?".
wxtr7 makes a good point, but I think there are ways round that issue. The game 'knows' where you're starting and all your way points, which are generally linear, so you only need to hold a small table of the fixed, known distances along the line and then to keep track of how far the loco has travelled (a continuous calculation of speed x time ought to be near enough). There might be some minor issues with different routings, but that can be handled by reverting to 'straight line' distance calculation once you're within (say) 1 mile or 1 km.