Cataclysm-dda: Auto-planting gratuitously paths into dangerous terrain

Created on 11 Feb 2020  路  1Comment  路  Source: CleverRaven/Cataclysm-DDA

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:

  • Create a farm plot tightly bordered by barbed wire (e.g. a 3x3 plot, bordered by a 5x5 barbed wire fence).
  • Zone it as a plot, then (O) and (m) to "Farm plots" while inside the plot and holding the given seeds.
  • Very often, you will get interrupted with the "Really step into barbed wire fence?" message when attempting to plant the barbed-wire-bordered tiles because the algorithm is trying to place you on the fence tiles to plant.

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)

image

OR

  • Create a farm plot with a barbed wire fence on one border (e.g. a 3x3 plot, with a 3-long barbed wire fence to the direct east).
  • Zone it as a plot for a given seed. Stand directly east of the fence with the seeds in hand.
  • Do (O) and (m) to "Farm plots".
  • The character will not do a simple path around the fence, you will get the "Really step into barbed wire fence?" message.

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.

image

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

  • OS: Windows

    • OS Version: 10.0 1903

  • Game Version: 0.D-11809-g78e6e40 [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    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]
    ]
<Bug> Fields / Furniture / Terrain / Traps Good First Issue [C++]

Most helpful comment

It should probably just never path into dangerous terrain period.

>All comments

It should probably just never path into dangerous terrain period.

Was this page helpful?
0 / 5 - 0 ratings