The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: davidh on September 25, 2009, 03:42:43 pm

Title: Is there a bug in the routing?
Post by: davidh on September 25, 2009, 03:42:43 pm
Hi

I'm wondering if there's a bug in the route calculations or is this done by design?

I've a transport that travels loaded from A to B and then back again empty. When it's empty it travels by the shortest route; but when it's full it takes a roue that must be twice as long as the shortest route.

Here's a screen shot. The outbound route (loaded) is marked in red, the return route is marked in green.

Any idea why it's doing this?

Regards

David
Title: Re: Is there a bug in the routing?
Post by: jamespetts on September 25, 2009, 03:58:17 pm
Your screenshot has not been attached. I suspect, however, that this is caused by the weight limits: a convoy will always avoid a route for which it is too heavy, and it may well be the case that the shortest route is one for which it is too heavy only when it is loaded.
Title: Re: Is there a bug in the routing?
Post by: davidh on September 25, 2009, 05:40:58 pm
Hi James

Thanks for your reply. However the roiute the convoy takes when loaded covers poorer quality dirt road than the return journey which is all on coblestome road. I think that both these two have the same weight limit of 80tonne?

What happened to that screen shot I linked too? Let's try that again:

(http://simutrans-germany.com/files/upload/simscr05.png)
Title: Re: Is there a bug in the routing?
Post by: jamespetts on September 25, 2009, 10:06:55 pm
That does seem somewhat odd. However, apart from weight limits, there has been no change to the code for the routing of vehicles in Simutrans-Experimental. Are you sure that you don't have a waypoint set? If this is a bug, it might well be in Simutrans-Standard, too.
Title: Re: Is there a bug in the routing?
Post by: prissi on September 25, 2009, 10:15:51 pm
Depends also on the weights for slopes: The red one has two extra slopes but two 90° curves less. That should only be effective when slopes cost less than curves.
Title: Re: Is there a bug in the routing?
Post by: helifino on September 26, 2009, 03:29:13 am
If this is a bug, it might well be in Simutrans-Standard, too.

I've noticed it in my Standard games, too.
Title: Re: Is there a bug in the routing?
Post by: davidh on September 26, 2009, 07:56:52 am
So it's to do with the number of curves then for the looks of things. Seems like an awful long way round just to avoid a bend or two.`It has to be the curves because there's the same number of up slopes on each route, red and green. It's not possible to see them all on that screen shot.

OK, I can set a way point for the outbound journey so that the convoy follows the green route both loaded and unloaded.

Cheers

David

Title: Re: Is there a bug in the routing?
Post by: jamespetts on September 26, 2009, 10:05:15 am
I have moved this topic to the general development and bug reports section because it appears that this issue is not specific to Simutrans-Experimental.
Title: Re: Is there a bug in the routing?
Post by: prissi on September 26, 2009, 01:48:27 pm
The number of curves is two more; and the total distance is also not very different. The only thing I do not understand why loaded/unloaded should play a role.
Title: Re: Is there a bug in the routing?
Post by: davidh on September 26, 2009, 02:42:30 pm
The number of curves is two more; and the total distance is also not very different. The only thing I do not understand why loaded/unloaded should play a role.

The red route (outbound) is exactly 40 tiles whereas the return green route is only 27 tiles. Whilst the total tiles isn't that different the red route is more than 25% longer than the green route.
Title: Re: Is there a bug in the routing?
Post by: prissi on September 26, 2009, 05:12:45 pm
Corner penaly of 90° bend is equivalent to 5 tiles ...
Title: Re: Is there a bug in the routing?
Post by: helifino on September 27, 2009, 03:49:51 am
in my case, distance and # of corners is the same, but one way is mostly city (55km/h) where the other mostly highway (130km/h).  Also, the bus is often fully loaded in both directions.

*edit* Actually, the city road portion is four tiles longer.