After version 0.2.8 I wanted to flesh out more of the level, so I started placing rocks, trees and of course enemies.
I also made some changes in order to better accommodate mouse/keyboard play, most notably you now run at full speed when you hold down shift, making the standard speed a bit more manageable for most players.
Now usually I let people know about this in the controls menu, but it seems a lot of people don’t look at those, like ever. So I decided to add a tips interface, at least until I make an actual tutorial for the game, but that’s not for a few months, so:
As I was testing I remembered my notes: make the enemies disappear more ‘gracefully’, I also noticed that enemies weren’t responding as fast as their number increased.
So first I tackled the ‘dissolve’ effect, since I want to do something similar with the weapons and I had already bought an asset to help me out:
So now the enemies dissolve when they die, from top to bottom, which was pretty easy to setup with ‘Advanced Dissolve’:
Then I tackled the enemy performance issues. Initially I was aiming for more compact spaces, but going around the map and exploring is part of the experience, but that means that enemies are in higher numbers. My first attempt focused on the enemy control script, I disabled it when the enemies were not visible in a way that would keep them working correctly when not.
This worked, but it turns out my script wasn’t the issue, I am using Unity Navmesh for the enemy navigation, the level is big, the enemies are many and the system has a built in system to defer calculations to reduce slowdowns, which means that the enemies weren’t as responsive once I passed a certain threshold.
So I implemented my first idea: divide them into groups/areas and enable/disable based on distance. Their paths are pretty much irrelevant unless you are near them, so having them be alive at all is not needed, this works and lightened the load quite a bit. I’m going to explore more options, but for the moment this is enough, now that I have the enemies in clusters I can set their parameters in clusters as well: for example maybe using a lower quality solve for the Navmesh the further away from the player enemies are.
Anyway, some more adjustments to the stats and general values, clean up and of course dissolving barrels.
0 comments