XaiJu
Shattered Pixel
Shattered Pixel

patreon


v1.4.0 Beta! | Patreon Weekly #173

Hey Patrons!

Firstly, there’s an audio Q&A attached to this weekly! There were 18 questions asked by 10 different patrons. You can find question timestamps at the end of this weekly. I also mention a game’s soundtrack in the audio Q&A, which you can find here: https://www.youtube.com/playlist?list=PLvK9pRNXoVoM5rEd0d6NqXR4JwEtDaLab 

In this weekly, I’m going to do a deep dive on an annoying bug that was introduced during the alpha, and which took a few tries to fully fix.

Auto-resting?

As those of who played the v1.4.0 alpha (and a few unlucky folks who played the beta) will know, there’s a bug that caused the player to automatically start spending turns when they walk onto traps.

This bug popped up because of a small new QOL feature I was trying to implement into v1.4.0: Tapping on the hero would cause them to trample grass or activate traps that they happened to already be standing on. This is accomplished by having the hero essentially move in place.

A move action is triggered whenever the player taps on a location where no other game actions (e.g. pick up item or attack) are available. Normally when you try to move onto your own tile, the game sees that moving isn’t possible and just cancels the action. In the v1.4.0 alpha I changed this so that you can move onto your own tile if you aren’t levitating and there is either tall grass or a trap there.

The problem of course is that deactivated traps are still traps, so tapping to move onto one of them would cause the hero to move there, and then rather than ending movement (as you’re now on the tile you were moving towards) the game would instead keep constantly moving in place.

Oops.

I fixed this in the beta by changing it so that only active traps count. Problem solved right? The problem now is that if you’re under the effects of time freeze, traps don’t actually activate right away. This leads to the exact same bug as before, just in a much more specific situation.

The fix this time is going to be to just remove the interaction with traps entirely. The main point of this change was to trample grass that grew onto you, and the cases where an active trap is under the player were added as an afterthought. I’m not actually sure there even are cases where the player can be standing on a trap that hasn’t activated.

It’s very, very easy to make changes like this that have unintended consequences. Even a relatively simple game like Shattered has so many moving parts, and very often some specific niche interaction can cause unintended behaviour like this. A majority of new bugs are caused by oversights like this, though usually the situations they trigger in are very specific. To be fair though, I should have seen the deactivated trap problem coming, as that situation was pretty common.

Audio Timestamps


More Creators