Devlog #8 - Touch-ups for the demo
27/05/2025
This week was the last before the demo, so we focused on what was needed for the demo, mainly bug fixes, optimizations and the addition of an ending for the demo.
Optimizations
There were two things that were really slowing down the game, the first was the way the level was made, it was made of a lot of 1x1x1 blocks, everything from the ground to the stairs and the blocks were made of these 1x1x1 blocks (I didn't count the number of blocks, but a quick estimate would be around 1500 blocks). So for the simple shapes (like the ground) I replaced each section with a single block scaled to the right size, and quickly remodeled the stairs in blender to be made of one single mesh instead of a lot of small blocks. This made the level load much faster and run smoother. This solution is not perfect, as the way the texture is applied in unity makes the side of the road look weird, as you cannot scale the texture differently on each face of the block, but it is good enough.
The other issue was with the music changes, we have some points in the demo where the music changes, and it was causing a lot of lag, as the game loaded and decoded the music. At each music change, the game stuttered for approximately 1 second, which felt really bad. To fix this, I've added to the script start function a single line of code:
newBGM.LoadAudioData(); // preload the music
This line of code makes the first loading of the scene take a bit longer, but it removes the lag when the music changes.
Fixes
There were a lot of small bugs here and there and I don't want to describe them all as they were not really important, but here is a (non-exhaustive) list of the most important ones:
- The final staircase had no collision
- The small enemies had a collider but they were missing a reference to the controller so they could not be hit
- The breakable blocks were giving the player multiple power-ups at once (which was not intended)
- The power-up was a
Rigidbody(to allow it to fall) but the player could push it around (and off the level), so I allowed movement only on the Y axis - After the rotation of the map, the chaser enemy was not able to move anymore because it used a
NavMeshAgentand the navmesh was not updated, so I added a call toNavMesh.AddNavMeshData(navMeshData_Rot)and generated the navmesh again after the rotation of the map
All those bugs were fixed and there is not a single bug left in the demo (everything left is a few weird behaviors that were obviously planned all along or undocumented features of the game).
Polishing up the demo
The demo was not really polished, we had no way to restart the game (besides quitting and restarting) and as we didn't have time to add a menu, I added a simple script to reload the scene when the player presses three times on the ☰ button of the left controller. This is not ideal, but it is good enough solution for the demo.
I also added the custom model for the chaser enemy and implemented the animations to replace the placeholder model that we found on the asset store.
Also Johann added an end screen that displays text and restarts the game but unfortunately it was not working in VR, so I made a simple scene that displays the text and restarts the game when the player presses the ☰ button of the left controller three times. And I also added a simple scene with the text "Game Over" for when the player is caught by the chaser enemy.
I also changed the speed of the chaser enemy when it is chasing the player, before, the chaser enemy was moving at the same speed as when just patrolling, which made it really easy to avoid, so I increased the speed of the chaser enemy when it is chasing the player to make it more challenging.
Feedback from the demo
People who played the demo were generally positive about the game. Our biggest fear was that people feel VR-sick while playing the game, but it was not the case, even first time VR users were able to play the game without feeling sick. We also got some improvement suggestions, especially on the atmosphere of the game and suggestions to make the game more challenging.
Conclusion
The demo is pretty good and I'm happy with what we achieved in such a short time. It was not my first time using unity but it was my first time making a game in VR, and I learned a lot about how to make a game in VR. I personally think that some of our design choices were not the best, but I think that we made a good game overall.
This game is far from finished and ready to be released, but I think that we have a good base to work on if we want to continue working on it. I think that the fact that we chose to make a VR game was not the best choice, as it is more work than a normal game, and the testing is more difficult, but I think that it was a good experience and I learned a lot about how to make a game in VR.
I also feel that some games from other students felt more polished and finished than ours, but I'm still happy with the result of our work and the team was great to work with.