The International Simutrans Forum

Simutrans Extended => Simutrans-Extended gameplay discussion => Simutrans-Extended gameplay help requests => Topic started by: zook2 on June 07, 2022, 06:04:54 AM

Title: Stuck because of private cars turning around
Post by: zook2 on June 07, 2022, 06:04:54 AM
This is outside of Baffwick on the BB server (I've rebuilt the road since taking the screenshot).

The concrete road south of the bridge is mine, built many months ago. The city road leading to the bridge is where the city limits end (i.e. the buildings there are the southern edge of town). All my convoys have been stuck for three months because all private car traffic coming over the bridge turns around where the city limits end, i.e. in front of my buses, and builds up a huge pile of cars.

I've had my share of trouble with private cars but this one is new...
Title: Re: Stuck because of private cars turning around
Post by: Matthew on June 07, 2022, 03:19:20 PM
The private car routing algorithm still has a bunch of bugs and at one stage all cars were set to turn around where city limits end. However, I thought that algorithm had been removed.

A couple of questions. Firstly, someone said in server chat that someone had withdrawn access from the Ministry of Transport. Was that you? If so, that might explain why the private cars did not use your road.

Secondly, it would be interesting to know what the buildings either side were. It makes complete sense to hide citybuildings so that we can actually see the cars, but my impression is that certain citybuildings can generate huge numbers of private cars in this era, so that might also be a factor.
Title: Re: Stuck because of private cars turning around
Post by: zook2 on June 08, 2022, 08:17:55 AM
The buildings are Detached Houses and Hovels. And I don't even know why I withdrew the Ministry's access. I never suspected that all these cars are owned by HM government...
Title: Re: Stuck because of private cars turning around
Post by: Ranran(retired) on June 08, 2022, 01:29:16 PM
    if(player != NULL && player->get_player_nr() != 1 && !player->allows_access_to(1))
    {
        // Private cars should have the same restrictions as to the roads on which to travel
        // as players' vehicles.
        time_to_life = 0;
        return false;
    }
The code seems to indicate that the private car is intended to evaporate if it tries to break into a player's road that is not friendly to public player.
But I think this bug suggests it's not working. Perhaps the private car routing code has changed course so that the private car does not evaporate before doing this.
Or the tile may be a tile that does not exist for private car. In any case, the evaporation check in private_car_t::can_enter_tile() is not performed.
(When time_to_life=0, the private car will be forced to die. But many Japanese businessmen have the characteristic that they do not die even if life becomes 0.)
Title: Re: Stuck because of private cars turning around
Post by: jamespetts on June 08, 2022, 03:24:13 PM
Private cars should certainly not evaporate if they turn onto players' ways that do not allow access to private cars (by withdrawing access from the public player ("Board of Trade", "Ministry of Transport", etc.)), as this would unbalance the game: it would allow players to build "car traps" to remove cars from towns without actually building good road routes to allow traffic to bypass towns.
Title: Re: Stuck because of private cars turning around
Post by: Matthew on June 08, 2022, 04:41:40 PM
Quote from: zook2 on June 08, 2022, 08:17:55 AMThe buildings are Detached Houses and Hovels.

Well that rules out that theory, as I don't think those particular citybuildings generate large amounts of traffic.

QuoteAnd I don't even know why I withdrew the Ministry's access. I never suspected that all these cars are owned by HM government...

Must be because James is a great supporter of nationalization....(not)  ;D  ;D  ;D
Title: Re: Stuck because of private cars turning around
Post by: Mariculous on June 08, 2022, 05:40:01 PM
Quote from: jamespetts on June 08, 2022, 03:24:13 PMit would allow players to build "car traps" to remove cars from towns without actually building good road routes to allow traffic to bypass towns.

I don't think so.
It seems legit to me that players can reject access to private cars on their own roads if that road is not flagged PROW.
There is currently no way to reject "unowned" vehicles, as opposed to "publicly owned" vehicles. (all private cars are actually owned by the public player)
It is not exactly clean to have public-player-owned private cars, but it's fair enough. Might be preferable if these were actually "unowned", but in that case it is mandatory that access to "unowned" vehicles can be withdrawn, at least by player gates.

Expected Behavior:
- Withdrawing access to the public player does also withdraw access to those public-player-owned private cars.
- Access rules do not apply on any way that is flagged as PROW.

I did not test if these expectations are actually met.
Title: Re: Stuck because of private cars turning around
Post by: PJMack on June 08, 2022, 10:42:00 PM
One thing to note is that there is a delay between the time a road is added, removed or made private and when private vehicles are aware of it.  Private car routes are stored in each road tile which are essentially invisible signposts with lists of destinations and directions to go.  If a road closes is is made private, those signposts would persist sending cars to a non-existing road (now a dead-end) until the private car routing algorithm cycles.  The algorithm can take multiple real life hours to cycle in larger maps.
Title: Re: Stuck because of private cars turning around
Post by: jamespetts on June 09, 2022, 12:07:37 AM
Sirius - you may have misunderstood what I wrote. The point about car traps was a response to a suggestion that cars should disappear rather than turn back when they reach a road on which they are not allowed to drive because it is not a public right of way and the player who owns it has withdrawn access from the public player. I agree that players should be entitled to prevent private cars from using their own roads where they are not public rights of way and not adopted by a town.

PJMack - that is indeed correct. One other thing to note is that the private car routing algorithm runs even when no players are connected, so it can often be fully refreshed when players join a game to which nobody has been connected for a while.