ATMs spawned en masse
Describe the bug
After downloading a newer version from the experimental branch, ATMs are appearing in unexpected places. Possibly only in previously explored areas. Going through walls, other unoccupied areas, etc. At first I noticed it in a newer area I was looting, but as I was returning home I found a spot where I was sure there weren't loads of ATMs before. I'm guessing it's a bug.
Attach save file
Steps to reproduce
Drive around to previously explored places that spawn ATMs. or teleport to one like gas stations? Get invaded by the ATM hoard?
Expected behavior
Not being invaded by the ATMtide
Screenshots
Versions and configuration
- OS: Windows
- OS Version: 10.0.22631.4112 (23H2)
- Game Version: 9633d7f [64-bit]
- Graphics Version: Tiles
- Game Language: System language []
- Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], Slowdown Fungal Growth [no_fungal_growth], Magiclysm [magiclysm], <color_cyan>Arcana and Magic Items [Arcana], <color_light_blue>BL9-100%-monster-resilience-version [BL9_100monres], Bionic Professions [package_bionic_professions], Magiclysm Revamp and Additions [magicrevamp], Mind Over Matter [mindovermatter], DinoMod [DinoMod], <color_cyan>Arcana/DinoMod Patchmod [Arcana_Dinomod_Patch], <color_cyan>Arcana/Magiclysm Patchmod [Arcana_Magiclysm_Patch], Mythical Martial Arts [MMA], <color_yellow>Mythical Martial Arts - Mods Extension [MMA_Mods_Extension], Crazy Cataclysm [crazy_cataclysm], Vampiric Stuff [vamp_stuff], Vampiric Stuff + Arcana Mod Extension [vamp_stuff+arcana], Miscellaneous Magiclysm Expansions [demon_spider_a], Bombastic Perks [bombastic_perks], Xedra Evolved [xedra_evolved], Stats Through Kills [stats_through_kills], SpeedyDex [speedydex], No Bionic Slots [no_cbm_slots], <color_light_blue>Hamm's teaks for things [HammTweaks] ]
Additional context
No response
Can't reproduce on the most recent experimental i suspect the issue is in some of out of repo mod, please confirm it happens in vanilla
- OS: Windows
- OS Version: 10.0.19045.4780 (22H2)
- Game Version: 0.G-11844-g 33970f51ee [64-bit]
- Graphics Version: Tiles
- Game Language: English [en]
- Mods loaded: [
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
Portal Storms Ignore NPCs [personal_portal_storms],
Slowdown Fungal Growth [no_fungal_growth]
]
I couldn't get it to happen on a new save at all. Either with my current modlist or otherwise. Only happened with an ongoing save, and I don't have another ongoing save.
- OS: Linux
- OS Version: LSB Version: n/a; Distributor ID: Arch; Description: Arch Linux; Release: rolling; Codename: n/a;
- Game Version: 705ea526-dirty [64-bit]
- Graphics Version: Tiles
- Game Language: System language []
- Mods loaded: [
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
Portal Storms Ignore NPCs [personal_portal_storms],
Slowdown Fungal Growth [no_fungal_growth]
]
created save in cdda-linux-tiles-x64-2024-08-14-0103 , explored the gas station loaded save and teleported in cdda-linux-tiles-x64-2024-09-03-0707 - was not bugged yet loaded save and teleported in cdda-linux-tiles-x64-2024-09-04-0626 - it was like on screenshot
something fishy going on
is it ter_furn_migration from #76051 causes some issues on game load?
I was about to comment that I had just replicated the issue by downgrading to a build from the 2nd, finding an atm, upgrading again with a repo only list.
is it ter_furn_migration from https://github.com/CleverRaven/Cataclysm-DDA/pull/76051 causes some issues on game load?
Yes. "to_ter" is missing in ter_furn_migration JSON (causes terrain to be nothing under first one), and code processing it does not reset furniture after placing it once
Here is rough and only briefly tested draft patch to fix this:
--- a/data/json/obsoletion_and_migration_0.I/obsolete_furniture.json
+++ b/data/json/obsoletion_and_migration_0.I/obsolete_furniture.json
@@ -91,6 +91,7 @@
{
"type": "ter_furn_migration",
"from_ter": "t_atm",
+ "to_ter": "t_thconc_floor",
"to_furn": "f_atm_off"
}
]
--- a/src/savegame_json.cpp
+++ b/src/savegame_json.cpp
@@ -4925,6 +4925,9 @@ void submap::load( const JsonValue &jv, const std::string &member_name, int vers
iid_furn = it->second.second.id();
}
}
+ else {
+ iid_furn = furn_str_id::NULL_ID().id();
+ }
if( terstr.is_valid() ) {
iid_ter = terstr.id();
} else {
there is probably a better way to reset iid_furn
Is there a good way to remove these ATMs from a save when this gets fixed?
to remove furniture:
- debug menu
- map
- map editor (disables achievements)
- scroll overtop your ATM
- 'r' furniture
- '/' filter for 'null' (optional to make it easier to get to the 'nothing' furniture)
- select "nothing" furniture.
- repeat for all other ATM's
Alternatively, you can just regenerate the whole overmap chunk.
- debug menu
- map
- map editor
- 'o' overmap/mapgen
- '/' filter for "s_gas_1_north" (im pretty sure this is the exact gas station in your picture)
- '3' Apply
there is probably a better way to reset iid_furn
To me it looks like both iid_ter and iid_furn should only be declared inside the loops, so they reset automatically.
should only be declared inside the loops,
Their value is used outside of the iteration it was assigned. Game checks if next tiles are same, writes amount of same tiles into remaining var and uses it to skip some logic
checking !remaining again before iteration ends and resetting iid_furn there (where we had run out of same tiles to assign it to) fixes it, but the whole thing probably needs a rewrite
--- a/src/savegame_json.cpp
+++ b/src/savegame_json.cpp
@@ -4951,6 +4951,9 @@ void submap::load( const JsonValue &jv, const std::string &member_name, int vers
if( iid_furn ) {
m->frn[i][j] = iid_furn;
+ if ( !remaining ) {
+ iid_furn = furn_str_id::NULL_ID().id();
+ }
}
}
}
if( remaining ) {
When testing fix for this, it is important to have multiple ATM's in a row and one on the next line. I tested using this save:
ATM corruption-trimmed.tar.gz
Their value is used outside of the iteration it was assigned. Game checks if next tiles are same, writes amount of same tiles into
remainingvar and uses it to skip some logic
Oh, right, I was misreading things. So instead of resetting iid_furn, I'd suggest simply always setting it, and not just if it's not the NULL_ID. (And maybe also add a check if the furniture id is actually valid.)
to remove furniture:
1. debug menu 2. map 3. map editor (disables achievements) 4. scroll overtop your ATM 5. 'r' furniture 6. '/' filter for 'null' (optional to make it easier to get to the 'nothing' furniture) 7. select "nothing" furniture. 8. repeat for all other ATM'sAlternatively, you can just regenerate the whole overmap chunk.
1. debug menu 2. map 3. map editor 4. 'o' overmap/mapgen 5. '/' filter for "s_gas_1_north" (im pretty sure this is the exact gas station in your picture) 6. '3' Apply
The latter is probably better given the number of spawned ATMs, thanks.