News:

SimuTranslator
Make Simutrans speak your language.

Solving deadlocks in road traffic - "patience" meter

Started by dantedarkstar, May 20, 2009, 09:26:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dantedarkstar

We all know that road traffic has one major problem, that is extremely artificial - deadlocks. These are speciality of the citycars, although with little help even player vehicles can get stuck, each waiting for another to clear the way. This can happen on any loop, and a mixture of randomly-going and street-clogging cars and player vehicles that will only take fixed route, the potential is very large.
The problem is, where traffic jams are expected and realistic outcome, the deadlocks are not. Humans are smarter than waiting for each other infinitely and don't have enough patience for that.

My proposal is to introduce sort of "patience" or "timeout" to solve the deadlocks:
>if a player vehicle is completely stuck (not a single move) for a given time, it will drive forward and enter the next tile, regardless of blocking vehicles (but only one tile, since moving forward would reset the patience)
>if a citycar is completely stuck (not a single move) for a given time, it will just disappear or do the same as player vehicles (this is up to decide)
Note: all this would apply ONLY to road vehicles.

While it may seem like strange idea - intentionally allowing vehicles to "overlap", given sufficient "timeout" it will really only happen when deadlock occurs. And when a traffic jam like that occurs, people tend to get creative with their driving. Squeezing two vehicles where normally only one fits wouldn't be so out of place. After all, people will try to manouvre and finally find a way to solve a deadlock, and while this cannot be probably implemented in the game, a "representation" of that could.
Links+Tutorial: Make heightmap of any part of world !
http://forum.simutrans.com/index.php?topic=2210.0

jamespetts

This is an interesting idea - but would it not be better (and more realistic) for city cars simply to turn back and take a different route if their timeout expires? It is easier for city cars to do this than player vehicles.
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.

Spike

Quote from: dantedarkstar on May 20, 2009, 09:26:14 PM
While it may seem like strange idea - intentionally allowing vehicles to "overlap", given sufficient "timeout" it will really only happen when deadlock occurs.

In the early Simutrans versions, city cars could drive through each other, so deadlocks never really happened. Then people complained that it is unrealistic, and citycars got collisions checks. Now we have deadlocks and people want the old features back ;D

On a more serious note, I also think it's good to let citycars bypass each other if stuck.

prissi

Since the vehicles waiting in front of crossings, deadlock became for infrequent. But then, this means you assinged too many vehciles to the task. (Citycars will self destruct after three month without moven, by the way ... )

jamespetts

Would it perhaps be better to have them attempting to turn back earlier, before they get to the stage of self-destructing?
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.

prissi

Please have a look at the code: They should try this but it is almost never working out. (I think there is a bug still in the code.)

jamespetts

Ahh - if the bug were fixed, good things would happen! :-)
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.