Auto-planting gratuitously paths into dangerous terrain #37928
Labels
<Bug>
This needs to be fixed
[C++]
Changes (can be) made in C++. Previously named `Code`
Fields / Furniture / Terrain / Traps
Objects that are part of the map or its features.
Good First Issue
This is a good first issue for a new contributor
Describe the bug
When using (O) to Far(m) plots, the pathing for the player can be taken into dangerous territory when completely unnecessary. This can generate the "Really step into barbed wire fence?" type of message a LOT, especially if the farm plot is bordered by dangerous territory like a barbed wire fence.
Steps To Reproduce
Two basic use cases that feel like they should be dealt with:
As a real-world example, in this screenshot, the player has two isolated squares to the west that are plantable. They are zoned as farm plot. In many cases, doing O-m will immediately generate the "Really...?" message. (Probability seems roughly equal to the distribution of adjacent tiles that are fence -- e.g. 3/8 for edge-facing squares, 5/8 for corner squares)
OR
Same happens if the needed tool (a digging tool, if the earth is untilled) is on the other side of the fence.
Another real-world screenshot of the above: in this screenshot, the digging tool is to my east-southeast outside of the fence, the plot is to my west. There is a safe gap in the fence, but (m) does not path through that, it gives the "Really...?" message 100% of the time.
Expected behavior
In case 1 above, it seems pretty simple that if there is a destination planting square, the game should not attempt to place me on the most dangerous adjacent tile to plant that square. It should select the safest adjacent tile to do the planting. This would prevent the "Really...?" message when the border-level tiles get planted in most cases.
Case 2 is obviously a LOT more complex, and less critical, but ideally I should select a path that is safe if it's not massively out of the way of the most direct route. This will take some cost-based pathing but this same issue has come up in other issues like auto-move so maybe will be re-usable logic?
Screenshots
See above.
Versions and configuration
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
Beta National Guard Camp [national_guard_camp],
More Locations [more_locations],
Fuji's More Buildings [FujiStruct],
More City Locations [cityside],
Urban Development [Urban_Development],
No Fungal Monsters [No_Fungi]
]
The text was updated successfully, but these errors were encountered: