@00_Evan@lemmy.world

Some rare seeds will cause an NPC, in this case Wandmaker, to get stuck in an infinite loop trying to spawn.

I could have perhaps made a fix and do a PR on Github, but as there are several ways to address it, as well as the possibility similar issues might happen with Ghost or Imp, I’m posting here.


Issue:

Game freeze. Wandmaker is stuck in an infinite loop attempting to spawn.


File:

.../core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java


Method:

spawnWandmaker(…)


Lines:

305-321


Reproducibility:

Game seed RAT-KCA-BLR will attempt to spawn Wandmaker on floor 8 in a 7x7 room (see screenshot), within the middle 3x3 area. All tiles here are considered not valid due to traps, entrance, or non-solid ground, including the bridge.


Suggestions:

  • Limit number of spawn attempts (ie. 100). If failed, consider trapped locations to be valid, optionally erasing any trap under the Wandmaker.
  • Alternative is to spawn a new room with same width/height after x attempts, overwriting the old room and try again.

  • CamelCityCalamity@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    3
    ·
    18 days ago

    I could have perhaps made a fix and do a PR on Github…

    Ok, so you know how Github works. So why didn’t you post this as an issue on Github?

      • 00-Evan@lemmy.worldM
        link
        fedilink
        English
        arrow-up
        4
        ·
        18 days ago

        That’s a pretty big mischaracterization. I don’t accept code contributions both because I prefer to keep Shattered solo, and due to copyright implications. Community contributions in other forms, such as bug reports, are of course welcome.