SheerSt / pokewilds

PokeWilds - A Gen 2 Game/Engine using libGDX
2.67k stars 202 forks source link

[Bug]: Total Soft-Lock with small house (+ a building bug) #461

Open Eleiyas opened 6 months ago

Eleiyas commented 6 months ago

Game Version

v0.8.11

Platform

Windows 11 64-Bit

What happened?

I had a tiny little starter house, which was 5Lx2H roof and then a row of wall with a door in the middle. This gave me enough room on the downstairs and allowed me to put stairs and have a tiny 2x2 space on the upstairs.

This was fine to put a bed on the right-most 2 tiles, as when getting out of the bed, I had 1 spare tile to stand on to "refresh" the stairs and go back down to the ground-floor of the house.

However, I had a party of 6 and caught a Bronzong, which then ended up being put inside my house. So, I go back to my house, upstairs to the bed and... well, I then got entirely soft-locked:

This meant that I had to go into the saveData (thank god you used JSON!), edit my position there, go back to my base from across the map, leave a party member outside and then go into the house to remove the Bronzong.

However, what then happened, is that because I tried to un-block myself by building stuff, the game did not register the stairs tile in the bedroom as existing any longer and put me in some random unused/un-walkable tile on the other side of the bed.

I therefore had to reload the save I had when I was outside, deconstruct the house (which left Bronzong in the void), then reconstruct the house to finally be back to where I was and be able to grab the Bronzong.

What should've happened? (Optional)

The best "fix" I can think of, is a check/script when a Pokemon gets put inside a house. If there isn't 1 free floor tile in every cardinal direction of the Pokemon, it simply cannot be placed there - this would ultimately stop any soft-locks from Mons' being put in tiny areas.

Eleiyas commented 6 months ago

I now realise you can actually build floor tiles to expand on any second stories of houses, so I might have been able to get out of this softlock...

UrsineRaven commented 2 months ago

This happened to me, too, but in a small one story outpost. There were 4 tiles, left two were bed, right bottom was a door in the over world (so I could leave out the right or bottom from it), and the top was a chest. When I caught a pokemon with a full party, it was placed in the bottom right. I realized I couldn't interact with the pokemon, so broke the chest and stupidly walked up to the top right. At this point I was trapped. I couldn't cut the bed (can you not cut it from the top tile?), and I couldn't move past the pokemon in the bottom right to exit or pick it up. I ended up saving and restarting the game in dev mode and using that to walk through the pokemon.