Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATMs spawned en masse #76200

Closed
JohnHenryEton opened this issue Sep 4, 2024 · 12 comments · Fixed by #76228
Closed

ATMs spawned en masse #76200

JohnHenryEton opened this issue Sep 4, 2024 · 12 comments · Fixed by #76228
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@JohnHenryEton
Copy link

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

test-trimmed.tar.gz

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

Screenshot 2024-09-04 151048

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

@JohnHenryEton JohnHenryEton added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Sep 4, 2024
@GuardianDll
Copy link
Member

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 33970f5 [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]
    ]
    image

@GuardianDll GuardianDll closed this as not planned Won't fix, can't repro, duplicate, stale Sep 4, 2024
@JohnHenryEton
Copy link
Author

JohnHenryEton commented Sep 4, 2024

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.

@HadeanLake
Copy link
Contributor

HadeanLake commented Sep 4, 2024

  • OS: Linux
    • OS Version: LSB Version: n/a; Distributor ID: Arch; Description: Arch Linux; Release: rolling; Codename: n/a;
  • Game Version: 705ea52-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]
    ]
    2024-09-04-233804_1920x1080_scrot
    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

@GuardianDll
Copy link
Member

something fishy going on
is it ter_furn_migration from #76051 causes some issues on game load?

@GuardianDll GuardianDll reopened this Sep 4, 2024
@JohnHenryEton
Copy link
Author

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.

@HadeanLake
Copy link
Contributor

HadeanLake commented Sep 4, 2024

is it ter_furn_migration from #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

@JohnHenryEton
Copy link
Author

Is there a good way to remove these ATMs from a save when this gets fixed?

@CoroNaut
Copy link

CoroNaut commented Sep 5, 2024

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's

Alternatively, 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

@mqrause
Copy link
Contributor

mqrause commented Sep 5, 2024

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.

@HadeanLake
Copy link
Contributor

HadeanLake commented Sep 5, 2024

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:
2024-09-05-124101_1920x1080_scrot
ATM corruption-trimmed.tar.gz

@mqrause
Copy link
Contributor

mqrause commented Sep 5, 2024

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

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.)

@JohnHenryEton
Copy link
Author

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's

Alternatively, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants