Skip to main content
Topic: Is there a bug in the routing? (Read 4250 times) previous topic - next topic

Is there a bug in the routing?

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

Re: Is there a bug in the routing?

Reply #1
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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: Is there a bug in the routing?

Reply #2
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:


Re: Is there a bug in the routing?

Reply #3
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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: Is there a bug in the routing?

Reply #4
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.


Re: Is there a bug in the routing?

Reply #6
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


Re: Is there a bug in the routing?

Reply #7
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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: Is there a bug in the routing?

Reply #8
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.

Re: Is there a bug in the routing?

Reply #9
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.

Re: Is there a bug in the routing?

Reply #10
Corner penaly of 90° bend is equivalent to 5 tiles ...

 

Re: Is there a bug in the routing?

Reply #11
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.