Carriers searching for warehouse may stop on flags

Bug #1784180 reported by ypopezios
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Low
Unassigned

Bug Description

Steps to reproduce:
1. Start a new game with an HQ (or pick a warehouse in the middle of a game).
2. Build one road from the HQ (better small and straight).
3. Build another road from the end of the first road (one road is not enough).
4. Wait for the carriers of the two new roads to take their idle positions.
5. Set game speed to pause (this seems important).
6. Destroy the first road (the one close to HQ).
7. Destroy the second road (order matters).
8. Set game speed back to normal.
9. Watch the two carriers walk around. If they reach a flag, high chances they stop there (they are supposed to stop for a moment, but in this case they don't resume walking).

Tags: economy
GunChleoc (gunchleoc)
tags: added: economy
removed: carriers
Changed in widelands:
milestone: none → build20-rc1
Revision history for this message
kaputtnik (franku) wrote :

Hm, i can't reproduce this. Maybe i do something wrong:

Destroying the road by removing a flag or removing a road?
In step 6: Do you mean the whole road, or just the first segment of the road?
The stopped carrier(s) are the one from the second road, build in step 3?

What does 'high chances' mean? Sometimes the carriers do stop at a flag and sometimes not? So one has to repeat the given steps until this happens?

Can you provide a screenshot?

description: updated
Revision history for this message
ypopezios (ypopezios) wrote :

Don't remove any flag, remove the two roads (or segments) in the specific order.

Both carriers may stop (like in the screenshot). The reason there are some chances of not stopping, is because of the randomness in their movement, since they become lost. The smaller the length of the roads, the higher the chances to reproduce the bug. It's easy to reproduce, just don't give up on first failure.

Revision history for this message
kaputtnik (franku) wrote :

OK, got it. Just build the first road until the first flag is possible, then build the second road until the first flag is possible. The console output says:

Warning: Economy::handle_active_supplies didn't find warehouse
Warning: Economy::handle_active_supplies didn't find warehouse

The annoying thing is that one carrier is standing still at the flag of the headquarters...

The main question is IMHO: Do we allow modifying the game when the game is in Pause modus? I remember in the settlers games, they had a similar problem and decided two prevent any interaction if the game was paused.

Revision history for this message
ypopezios (ypopezios) wrote :

In my case, modifying the game during Pause mode has been useful with debugging.

GunChleoc (gunchleoc)
Changed in widelands:
status: New → Confirmed
GunChleoc (gunchleoc)
Changed in widelands:
status: Confirmed → In Progress
assignee: nobody → GunChleoc (gunchleoc)
Revision history for this message
GunChleoc (gunchleoc) wrote :

I have attached a branch that will solve the problem - I am wondering if there's a more efficient solution though. It feels quite hacky.

Revision history for this message
ypopezios (ypopezios) wrote :

The attached branch is indeed a hack, cause it addresses the warning message instead of the underlying issue, which is that road-removal does not update the game's state properly.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I don't want to dig into this deeply for Build 20, since players should be able to get around the bug by destroying the flags, and carriers are a free resource anyway.

Would you enjoy working on this? You already know the road system better than I do.

Revision history for this message
ypopezios (ypopezios) wrote :

Try destroying the flag of your HQ... You may as well leave the code untouched, since this is a long-existing bug and nobody else complained.

I wish I knew the road-system well enough. I only know the code that I have touched, which doesn't include the 1000 lines of economy.cc . If it was something easy, I would have already made a branch instead of a bug report. I may look at it in the future, but probably not in time for B20.

GunChleoc (gunchleoc)
Changed in widelands:
milestone: build20-rc1 → build21-rc1
assignee: GunChleoc (gunchleoc) → nobody
status: In Progress → Confirmed
importance: Undecided → Low
Revision history for this message
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.