Added a new level opening animation. It zooms in through some clouds. It’s very quick but super cute.
New little element added to the game: keycards. They come in three colors: red, yellow and blue. Just like Doom. Keycards unlock force fields around saucers and other areas.
Before recording new sound effects and adding music, I want to improve the audio engine a little bit.
In this first part, I implemented some fundamentals.
- Envelopes. Automated adjustments of gain, pitch or pan etc. Already replaced old code for fading music in and out.
- Audio bus hierarchy. Apply parameters to all related sounds in one place.
- Lowpass/highpass filter. This has been on my wishlist since Superforce and I finally got around to it. I used this article as inspiration but the code is 100% rewritten for clarity & performance.
- Limiter. Safety guard to avoid clipping.
The big payoff for these features will be ducking. To make important sounds stand out, I want to suppress the less important ones. This can be done with gain but also applying the lowpass filter could make it sound even better.
Recently I ran into a design problem. Some enemies in the game will be immune to bullets and you’ll have to use grenades. Of which you can only carry a few. What if you miss and run out? You’d have to restart the level.
For a moment I considered loot drops. For something you’d be required to get they seemed too random and potentially frustrating. Instead I shamelessly copied Half-Life and added a grenade dispenser!
It’s a box full of… grenades. Just walk up to it and get a refill. The lid opens automatically to indicate you’re not supposed (or able) to break it like the regular ammo crates.
I’d love to see the game running on Steam Deck one day. Until then, I’m using an Xbox controller for testing.
Some menus were impossible to navigate with the gamepad or keyboard. I’m not building any sort of generalized UI framework but this needed to be fixed.
Each menu item contains links to its neighbors and pressing ←↑↓→ changes focus accordingly. In most simple cases, such as the main menu, the autogenerated links were enough but in more complex layouts some were omitted. So added a way to create the missing links manually.
Now I can get right into the game using just the controller, which is cool.
I still really like the base grass texture that I made when updating the tileset.
To add more variety I added a few patches of tall grass here and there. Those are animated and move with the wind. It took a while to make it blend in with the existing graphics but I’m really happy with the result.
Exploding barrels are a nice addition to any game. Devastro 2 already had some but I wanted to make them more fun. Decided to add a burning phase that would indicate a barrel is about to explode.
The fire animation was created in Blender and the smoke is a particle system running live in the game.
Explosion chains are now much more fun too.
This time I focused on the “aim” part… adjusted range and accuracy to make each weapon more unique. There are also new crosshairs which resize based on the accuracy.
The one in the video is my current favorite but there are other options…
The alien AI was a mess. It tried too hard to be clever. The code was fragile and the behaviour unstable.
I threw it all out and implemented a simple flock / boid algorithm. The aliens will stick together and try to approach the player in natural looking groups.
A* pathfinding is gone too. Instead, the player character drops invisible scent markers with a limited lifetime. If aliens cannot get a clear line-of-sight to the player, they will look for the scent dots and follow them. That can eventually lead them back to the player, even around corners etc. It makes it look like the aliens know what they’re doing. Which, of course, they don’t.
The new tileset is coming together nicely. I made a “master sheet” with all the tiles to keep things organized.
I implemented a new material system for tiles. In addition to the visible texture, each tile had a lower resolution bitmap which defined the material at a given spot. This was used for special FX like bullet impacts that vary based on the ground material they hit.
I got rid of that and switched to a polygon based approach which plugs into Box2D. Material polygons are created as invisible objects in Blender and exported into the game.
I also changed the way fences are placed on the map. They are now baked into tiles, so map editing is much easier.
The metatile system is still in place but without the editor. I get enough variety from Blender & Pixelmator alone, so it wasn’t so useful. However I now use its multi-layer feature to draw the fences, because they need to have separate ground / shadow / foreground layers for proper z-ordering.