[Shattered Pixel Dungeon v3.2.5] BUG Report - Infinite loop causing game to freeze

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

11 points · 4 comments · view on lemmy.world

4 Comments

00_Evan@lemmy.world · 4 pts · 282d

I see you've also posted this to Github, will reply there as well. As I mention in my other comment here, I don't accept code contributions/suggestions, but highlighting the bug is of course helpful.

CamelCityCalamity@lemmy.world · -2 pts · 283d (3 replies)

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?

TE_0@lemmy.world · 1 pts · 283d (1 reply)

This man HATES community contributions.

00_Evan@lemmy.world · 4 pts · 282d

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.

BussyGyatt@feddit.org · 1 pts · 283d
[ removed ]