Fixed crash bug with final boss


New version v1.0b (version # is on title screen) has been uploaded: fixed a crash bug someone found with the final boss under certain conditions (if the player beats the whole campaign without ever saving / reloading).

Internal bug details / devlog, for people who care:

  • This game was hitting the hard resource limits in PICO8 and I needed to save some space to fit in desired features and content, so I did a few... dubious things to save a few tokens (code size), such as not initializing every variable to 0 on game start. 
  • This works by design in most cases, because either they are initialized when you start each level (so initializing on game start is a waste of code), or because I test them with boolean conditions e.g. if wongame then [...] -- and a not-yet-initialized variable returns Nil which evaluates to False. It's fine if wongame only equals Nil or True, there's no need to explicitly initialize it to False...
  • However, near release I added a variable "campaign_wins(number of times player has won game). At the end of the game, this variable gets 1 added to it, and if it's not-yet-initialized this is a crash error: can't add 1 to Nil
  • Why wasn't this caught in playtesting? Well, the save/load functionality sets all variables it touches to zero if they aren't defined in the save file, so as long as you went through a save/load cycle once during the campaign, "campaign_wins" would have been set to zero by the time you beat the campaign-- and during the playtests after that variable had been added I always did test the save/load cycle during a campaign.

Files

picohaven_v10b.zip Play in browser
Nov 08, 2023
picohaven2_v10b_linux.zip 760 kB
Nov 08, 2023
picohaven2_v10b_osx.zip 3.2 MB
Nov 08, 2023
picohaven2_v10b_windows.zip 1,000 kB
Nov 08, 2023

Get Picohaven 2

Leave a comment

Log in with itch.io to leave a comment.