Reserve and Delay constructions that have pawns blocking them

Started by erdrik, August 16, 2018, 11:09:05 AM

Previous topic - Next topic

erdrik

The problems:
-If a pawn is constructing something, and another pawn walks on the construction, the constructing pawn will cancel their task and walk away.

This results in the constructing pawn prioritizing other tasks. At which point the construction will not be completed until either the originally constructing pawn finishes the new priority and returns, a new pawn(potentially on the other side of the map) takes over to finish the construction, or the player forcibly re-prioritizes the original construction.

-If a pawn is hauling materials to a construction and a pawn is standing on the blueprint, the hauling pawn will drop the material at the blueprint, but it will not actually be added to the blueprint.

This results in the material that was dropped being hauled back to the stockpile, and a different pawn re-hauling another set of the same material to the blueprint once it is no longer obstructed.

The Suggestions:
Instead of blind canceling the tasks associated with construction in these situations, I suggest two potential options:

1.
Reserve and delay the tasks.
The pawn does not drop the materials, or cancel the construction task. Instead inserting a "waiting for obstruction" task that causes them to stand and wait until they can return to the task. Every X amount of time(0.25 seconds for example) they would check if the obstruction is gone and if so return to the original task.

2.
Push the jack ass out of the way.
If a pawn is obstructing their task then instead of canceling the task, push the pawn that is obstructing the task to a free adjacent tile. If the pawn being pushed is doing a task push that pawn in a way to allows both pawns to continue their work.

EDIT:
Also it may be a good idea to add a pathing cost to blueprints with materials already in them.
It makes sense since those materials shouldn't just "vanish" just because they are apart of the blueprint, and it would go a long way to preventing situations like this to begin with.

AileTheAlien

I agree that pawns interrupting my builders is rather annoying. Making pawns path around in-progress blueprints would probably be the cheapest option to solve this.

deshara218

if a pawn goes to build a building and another pawn is blocking it, forbid the construction and spawn an invisible script that keeps querying if the pawn is still there, and once they've moved un-forbids the construction and deletes itself. Easy fix.

Pawn walks up to build a door, sees another pawn on that spot working on the door frame (wall), pawn in the way goes "oh sorry I'll let you know when I'm done" and does, is effectively all this is.