Cataclysm-dda: NPCs dance instead of farm if zones cross

Created on 11 Nov 2019  路  10Comments  路  Source: CleverRaven/Cataclysm-DDA

Describe the bug

When there are overlapping farm zones NPCs get confused as to what they're supposed to be doing and move back and forth across the zones instead of planting. It seems to occur regadless of seeds, whether the plot is set to no seed or whether the NPC has relevant seeds in their inventory.

Steps To Reproduce

  1. Set more than one farm zone overlapping with enough room to move around in.
  2. Talk to NPC: 'l' (for lima) to farm.
  3. Give them some seeds if they don't seem confused, I might be wrong about the seedless bit.

Edit:

Looks like the bug is triggered when an NPC exhausts the seeds in their inventory before completing all assigned tiles. If those tiles overlap another farm zone that they're due to work on they'll dance about, even if that zone is set to no seed.

Expected behavior

Anything but dance. Complaining and quitting would be better than that. I'd suggest using a random seed, but using whatever plot is first to pick might be best. Having an 'any' seed farm plot would be ideal really, plus a stockpile for it.

  • OS: Windows

    • OS Version: MINGW/CYGWIN/MSYS2 on unknown Windows version

  • Game Version: 0.D-9308-g1d6366e [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Aftershock [aftershock],
    C.R.I.T Expansion Mod [crt_expansion],
    Magiclysm [magiclysm],
    Makeshift Items Mod [makeshift],
    More Survival Tools [More_Survival_Tools],
    Mythological Replicas [nw_pack],
    Hydroponics [hydroponics],
    Mutant NPCs [mutant_npcs],
    No Rail Stations [No_Rail_Stations],
    Folding Parts pack [deoxymod],
    Vehicle Additions Pack [blazemod],
    Tanks and Other Vehicles [Tanks],
    Roadheader and other mining vehicles [Heavy miners],
    Disable NPC Needs [no_npc_food],
    No Fungal Monsters [No_Fungi]
    ]
<Bug> Inventory / AIM / Zones NPC / Factions

All 10 comments

I cannot reproduce, I have two farm zones, of equal size overlapping each other, the NPC does one of the zones fine. no dancing
do you have a reproducible save?

I'm not sure what the precise trigger is, but it's too do with overlapping zones. I made a few on this save and gave the NPC seeds for all of them. The NPC is currently dancing, on closer inspection it may be due to running out of strawberry seeds. (edit: In this case it's strawberry seeds but I've seen it with every farm plot I've overlapped)

... Seems I can't upload a save here. Where can I do that?

You can upload a save here
image

Yes, but not the save folder. It refuses to accept the folder.

git

.... Ahhhhh, zip it. Right.

Farming.zip

Yep Im seeing it now on that save, must be a combination of the seed zone + a "no seed" zone + running out of seeds, working on a fix.

Nice one, thanks! I was pretty sure it happened without a "no seed" zone, too, but I might have overlapped that one by accident before.

Yeah it goes like this :
1 ) NPC assesses the tile there , runs zones::get_zones() over the zones there, the first one the NPC has seeds for it considers a success and NPC goes " right I can do this, I have wheat seeds" and travels there,
2 ) then when the NPC is there it runs zones::get_zone_at() which iterates over the zones there ( in reverse order for some reason ) and then it decides it cant do the planting cos it looks at strawberry zone first and donst have strawberry seeds, and goes back to 1) repeat forever.

The fix is to ensure that he assessment and the doing of the planting are comparing the exact same zone every time, or at least iterating over them in the same order.

Aha! So it wasn't just with "No seed" zones then. Thanks for the fix!

Not merged yet, so I think you closed too fast?

Urgh, hit the wrong button, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ituluwituluwzev picture ituluwituluwzev  路  3Comments

busterbogheart picture busterbogheart  路  3Comments

jeremyshannon picture jeremyshannon  路  3Comments

Taberone picture Taberone  路  3Comments

Coolthulhu picture Coolthulhu  路  3Comments