Thursday, April 20, 2017

Dissonance Blog Week 14

This is the final weekend to work on the game. The code lock is this Monday, April 24. We may not have completed everything that we wanted to accomplish. But I believe we achieved so much. I have personally learned Unreal Engine and working with the Vive. I am truly grateful to be working on Cosmic Beep. It wasn't always a smooth ride but it was a fun, interesting and educational journey.

Going into this final weekend, we still have one huge bug to try to fix. The bug is that the game crashes when a player touches the radio, cassette or piano. It doesn't always happen, so it is difficult to tell what causes it. The only consistent thing about the crashes is that the player has to spend a long time, 5 - 10 minutes, in the previous level. Then the game has a higher change of crashing. This is confusing because it crashes when the game talks to the API. The three things that make the game crash are special functions that use blueprints to talk to the C++ code. The API shouldn't care how long the player takes in a previous level. Since it only cares about updating the puzzles. The last message in the debug log on the Unreal's crash report is "assert size >= 0". The game crashes when the Puzzle API doesn't initialize the puzzles and the code is trying to access the puzzle list. I'm confused why the game crashes when the game is doing a safety check.

I was contemplating for a while how to fix this or why this was happening. The fix that I put into the API was checking to see if the puzzle list had a last index greater than zero. If it doesn't the blueprint will reinitialize the puzzle manager and puzzles for that level. This technique might work or it could just crash when it tries to initialize the puzzles for a level. If this doesn't fix the game, then I have to rethink what is causing the problem and implement it extremely fast.

After Implementing this technique and testing it multiple times, it works.