News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Road "adequate diversion" criteria

Started by AP, December 17, 2017, 02:00:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AP

Just a bit of feedback, having been doing some city editing to build urban canals. I think the "adequate diversion" max distance setting is a bit too strict at the moment. I'm not sure exactly what it is set at, but it seems to preclude doing some emminently sensible things.

City blocks at 2x5 seem quite common, which means it's 18 tiles around. Yet it won't let the road on one side be severed, because the diversion is "too far". Obviously you need to sever it to build a bridge in the same spot.

Sometimes you can work around this with temporary roads, but then you find yourself unable to demolish the temporary roads afterwards, because as soon as you build them, in an urban context the game considers them critical immediately.  E.g. see (5464,1307) in the canterbury server game now.

The situation is exacerbated when the city in question is on a slope, because "extra" tiles are used up accounting for changes in levels, before bridges and junctions can be formed as necessary by the new configuration.

jamespetts

The maximum diversion is a simuconf.tab setting, max_diversion_tiles. It is set at 16, but can be changed to player preference in a single player game. Do you think that increasing this to 18 would be sensible? It would be difficult to do this retrospectively on the existing online games, however, as these values are saved with the saved game.
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.

AP

I'm inclined to say go to 20 tiles for the default, assuming there may be a change in level in play as well.

Otherwise players have to demolish large numbers of city buildings in ever more complex expansive roadworks, just to stay within the rigid criteria. Which means we end up causing the very demolition the measure is meant to control.

(The situation isn't helped by the fact that the bridgebuilding mechanism cannot cope with building a bridge that starts on the flat and finishes on a half-slope; it only likes doubleslopes. I'll be reporting that issue separately).

jamespetts

Can I ask why the specific number of 20? I understand the numerical basis for 18 (the 5 x 2 city blocks), but I do not understand the significance of 20. 20 tiles amounts to a 2.5km diversion from a public right of way (and remember that this mechanism does not only operate in towns).
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.

AP

Because a change in level means a tile is a ramp i.e. cannot take side connections. Assuming a city block, what goes up, must come down again, so 18+(2n). 22 would work as well, for hilly maps.

I don't entirely accept the 2.5k equivalence. If you look at the city grids, there's 10 buildings in a 2x5 city block. It all gets a bit sketchy. The grid density defines the minimum space you can configure things so it has to be defined in terms of tiles.

jamespetts

Quote from: AP on December 17, 2017, 09:00:41 PM
Because a change in level means a tile is a ramp i.e. cannot take side connections. Assuming a city block, what goes up, must come down again, so 18+(2n). 22 would work as well, for hilly maps.

I am not sure that I understand this - are city blocks that are greater than 2x5 because they are spread over slopes common?

QuoteI don't entirely accept the 2.5k equivalence. If you look at the city grids, there's 10 buildings in a 2x5 city block. It all gets a bit sketchy. The grid density defines the minimum space you can configure things so it has to be defined in terms of tiles.

The point is that increasing the number of tiles has universal effect, and so would allow a 2.5km diversion of a straight road or river a long way from a town. That, therefore, has to be taken into account when calibrating this distance.
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.

AP

Quote from: jamespetts on December 17, 2017, 10:17:17 PM
I am not sure that I understand this - are city blocks that are greater than 2x5 because they are spread over slopes common?

Sorry if I wasn't clear. I mean that by having slopes involved,  knocks out some tiles from being 'useful' when making a diversion.  The sloped pieces of road are a handicap.  I've done a few bits of urban editing recently and once slopes get involved it gets a lot trickier trying to make it work within the limits.

I don't see a problem with slightly longer deviations being permitted in rural areas if that's what it takes to make the urban editing mechanism balanced. The point is to avoid people needing to demolish everything in sight.

jamespetts

Thank you for your feedback: this is helpful.

Before I make any changes, I should be interested in feedback from others on this point. Does anyone else have any views on the most appropriate length required for an adequate diversionary route (given that this is the maximum to which other players may divert your convoys if using public rights of way)?
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.

AP

Hi James

As comments on other thread, I discovered last night a difference in behaviour when removing road, between the bulldozer tool, and the road removal tool. So I am unsure which is behaving correctly.

Knowing that at present the "adequate diversion" criteria is set at 16 tiles, please can I just check how that is measured?  Is it from one side of the tile being bulldozed "all the way around" to the tile immediately on the other side of the bulldozer?  Or does it start counting "back at the junction" where the two branches, which demolishing the tile brings into being, diverge.

Knowing how it counts I should be able to quickly establish which function is at fault.

This may affect my comments above.

jamespetts

Thank you for this. I should be grateful if you could open a new bug report in a new thread once you have confirmed the issue, although I understand why you are enquiring here first.

I cannot now remember the exact implementation of the system for checking the diversion, but, if I recall correctly, it measures the total number of tiles that a vehicle needs to bridge the gap newly created by any deletion: I do not think that there is any algorithmically simple way of working out what counts as the junction to the new route.
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.

DrSuperGood

QuoteI cannot now remember the exact implementation of the system for checking the diversion, but, if I recall correctly, it measures the total number of tiles that a vehicle needs to bridge the gap newly created by any deletion: I do not think that there is any algorithmically simple way of working out what counts as the junction to the new route.
Such algorthim is not useful in the first place because it counts one making a shortcut as trying to destroy public ways.

For example I remove a 20+ tile diversion around a hill or mountain with a direct route and cannot remove the old, never will be used again, long route without having to spend 50,000+ on new road tiles to destroy it piece by piece. If you refuse to let me remove the roads I am having to pay for, at least do not charge me for them.

Further more the algorithm is clearly broken when it comes to road loops. Some cities with road grids allow me to fragment a road for terminals (any human can see there is a way around to both sides of the road), while others do not.

The algorithm should only kick in if one really fragments a road such that 2 separate disconnected way pools are created. It should also prevent one from removing all road tiles away from houses. It should not try to do anything ultra smart such as considering travel distance.

jamespetts

Quote from: DrSuperGood on December 22, 2017, 08:15:17 PM
Such algorthim is not useful in the first place because it counts one making a shortcut as trying to destroy public ways.

For example I remove a 20+ tile diversion around a hill or mountain with a direct route and cannot remove the old, never will be used again, long route without having to spend 50,000+ on new road tiles to destroy it piece by piece. If you refuse to let me remove the roads I am having to pay for, at least do not charge me for them.

Any other algorithm would require much more complexity and take a huge amount of work. If someone were willing to implement a more sophisticated algorithm, I should be happy to incorporate it, provided that it works without anomalies. Would you be interested in working on this? I am afraid that I have a gargantuan list of higher priority things on which to work at present.

QuoteFurther more the algorithm is clearly broken when it comes to road loops. Some cities with road grids allow me to fragment a road for terminals (any human can see there is a way around to both sides of the road), while others do not.

Can you post a proper bug report in its own thread with a detailed description of the steps necessary to reproduce this issue and a saved game in which, with those detailed steps, it can reliably be reproduced?

QuoteThe algorithm should only kick in if one really fragments a road such that 2 separate disconnected way pools are created. It should also prevent one from removing all road tiles away from houses. It should not try to do anything ultra smart such as considering travel distance.

I am afraid that I do not follow. Precisely what is a "way pool"?
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.

DrSuperGood

This system clearly is not working as intended. I strongly recommend disabling the public right of way system until a point it is developed sufficiently for use. The system is neither realistic and currently appears to exist only to annoy and frustrate players.

It is very easy for loops to become completely degenerate. Unlike in real life one cannot give off the maintenance to proxy companies which eventually hand the ways back to the government. One cannot even fix AI mistakes such as making low bridges over other ways.

AP

Personally I think it works fine. It restricts to an extent but not absolutely.  It could probably be cleverer but given the other areas the developers have to look at,  I think it's a fair compromise.

jamespetts

Quote from: DrSuperGood on January 25, 2018, 10:36:07 PM
This system clearly is not working as intended. I strongly recommend disabling the public right of way system until a point it is developed sufficiently for use. The system is neither realistic and currently appears to exist only to annoy and frustrate players.

I am afraid that this is not a sensible approach: the public right of way system was implemented to solve specific problems which were real and serious problems in previous network games. It is not at all clear that they create more problems than they solve: indeed, the problems that have been suggested seem to occur in more limited circumstances than the problems that this system was designed to solve occurred.

I am afraid that it is not a constructive approach to state blandly that something does not work as intended; what I need in order to be able to understand the issues is a clear description of the precise problems.

QuoteIt is very easy for loops to become completely degenerate. Unlike in real life one cannot give off the maintenance to proxy companies which eventually hand the ways back to the government. One cannot even fix AI mistakes such as making low bridges over other ways.

I do not understand what you mean by loops becoming "completely degenerate". Can you elaborate (and, if this is a bug, post a proper bug report in its own thread)?

As to proxy companies, I am not sure what you mean here. How did this work in reality historically? Can you link to a source describing this?

As to low bridges over ways, I have looked into trying to deal with this for rivers, and implemented a partial solution, which works when the rivers are at the same level as the town road. However, solving this is significantly hampered by the fact that it is not possible (even in Standard) to make a high bridge starting from a single height slope. There was some discussion of this in the Standard bug reports forum a week or two ago (the bug report bieng made in the Extended subforum and redirected to the Standard subforum on being confirmed that this is a limitation, rather than a bug as such, in Standard), but nothing came of it.

However, why should this be a problem specifically of public rights of way? What is to stop a player in the case where the town has built a road over a river from building a taller bridge next to the bridge in question and then demolishing the lower bridge, there being an adequate diversion over the new bridge?
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.

DrSuperGood

#15
On the server the one town built a bridge over my canal. Now this normally is no problem because one can delete the road back to the bridge and remove the bridge. But instead the town looped the road into another road, creating what I call a degenerate loop. There is no reasonable way for me to demolish this loop and hence cannot demolish the bridge.

To get around this I have built some completely nonsense and unrealistic canal bridge bypass.

On the server it is @4658,2222. Neither bridges can be demolished and one of them is owned by me.

AP

The only reason a city block including two canal bridges should be undeletable is if it is greater than 3x4 tiles in size. If so, you just have to divide it up with a road down the middle.

I did suggest James increase the max diversion distance from 16 to around 20 to include 4x4 city blocks, since they are quite common, and help with hilly cities too. Not sure if that went forward.

jamespetts

Quote from: DrSuperGood on January 26, 2018, 01:26:25 AM
On the server the one town built a bridge over my canal. Now this normally is no problem because one can delete the road back to the bridge and remove the bridge. But instead the town looped the road into another road, creating what I call a degenerate loop. There is no reasonable way for me to demolish this loop and hence cannot demolish the bridge.

To get around this I have built some completely nonsense and unrealistic canal bridge bypass.

On the server it is @4658,2222. Neither bridges can be demolished and one of them is owned by me.

Thank you for the report. I think that I have fixed the issue with bridges not being checked properly for public rights of way diversion; I should be grateful if you could re-test with to-morrow's nightly build.
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.

DrSuperGood

Might also want to check the industry logic. This has caused the one fish processing factory to order over 500 units of fish (several years supply) and last I checked there was no sign of it stopping ordering.

If it persists I will file a bug report.

jamespetts

Quote from: DrSuperGood on January 26, 2018, 11:25:54 PM
Might also want to check the industry logic. This has caused the one fish processing factory to order over 500 units of fish (several years supply) and last I checked there was no sign of it stopping ordering.

If it persists I will file a bug report.


Please do - I will not have a hope of tracking down the issue without full information.
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.