Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Final Push on Final Storm

A topic by bitbionic created Oct 19, 2017 Views: 683 Replies: 6
Viewing posts 1 to 7

I've been writing a bit in my project Devlog on the Final Storm project, but I don't think anyone views those things. I think if I post here there might be a bigger since of accountability since more eyes tend to peruse this area.  And with 2 weeks left until release, I'm in crunch mode and thought I'd use the log as a "debrief". I'm going to try to post daily between now and release.. If I don't, someone should call me out on it :)

Optimizations

As I mentioned in the previous devlog, optimizations were something I really wanted to look into. Let me be clear - the game runs very well on my 5 year old laptop, but it also has an NVIDIA GTX 660 in it. I've tested on a few more laptops from the same era (2012) with integrated Intel graphics and also an android build on my 2013 Nexus 5 and the game runs but not AS smooth. I wanted to change that. So yesterday and today I did a few things. 

1 - I was using KinematicBody2D for all of the bullets and that was really unnecessary. I did it in the spirit of "make it work, optimize later". Well now is later. So my first optimization was to remove that and back up to an Area2D implementation that I had read was faster. It was in fact faster (I didn't measure, but performance improvement was obvious just by playing on the low end devices).

2 - Next I looked at memory pooling. Rather than instancing and destroying every node as needed I thought I'd create a pool of bullets and "borrow and return" them. I grabbed a pool implementation no github (MIT license) for the Godot engine and the code looked reasonable, but when I tied it in, the performance was abysmal! It was at this time someone on Discord pointed out that Godot had a "Shower of Bullets" demo that I should checkout.

3 - Shower of Bullets took a different approach. It created a bullet manager (sort of like a pool) but didn't create a bunch of scene nodes to represent the bullets. Instead the manager entity was the only node - and it would draw all the bullets in it's draw function, and "tap into" the Physics Engine notifying the engine where the bullets were and where they were moving. This seemed perfect. I tied it in, and on my worst performing device (Android), performance was smooth as silk! But there was a problem. The collision detection events were not delivering any information on which bullet hit it's target! Upon examining this with a few developers on Discord, we THINK this is an engine bug. So I posted an issue on github about it. I did pull up the engine code but at this point with 2 weeks left, I have too many other things to code before worrying about that. It'll have to wait until I get the remaining features in the game.

4 - With only the one optimization (Area2D) in place I figured I could also reduce draw calls on the bullets. The bullets were layering a few sprites together to create lighting effects and so I was able to merge them effectively cutting the number of sprites drawn per bullet by at least half! That's a big savings in itself.

Art

So with that done I turned to do some light graphics work today. The game needed a splash screen to replace the default splash screen so I threw this together - I'm not sure if it's final or not - I'll probably iterate on it but it's a start. I wanted to make sure to get the "Powered By Godot" in there because I'd really like to build awareness for that engine. That engine is making incredible strides daily!

WARNING - NOT MY FINEST WORK

I also didn't like the fact that I was using the same graphics for Rail Gunners and Sentinels so I busted out the GIMP and created a new Rail Gunner graphic that I think will do the trick:

That said I'm continually amazed at how nice tools like GIMP, Krita, Blender and Godot are. 

Well - that's it for tonight - Tomorrow I'm going to start putting in logic for boss battles and try to wrangle together at least one boss. I'm also thinking about throwing achievements in there :)

YouTuber video helps me to smash 2 bugs.

I debated writing this post because to be quite honest, it feels a little "vulnerable" talking about bugs that I should have caught, or exposing things I didn't think about. However, if other new devs are viewing this, hopefully it encourages them to know that these things happen, and this is just how it goes sometimes (at least in my experience). That said, there's nothing more motivating to patch bugs than seeing them broadcast by independent parties on Youtube. I sent keys out to some folks to help get coverage and feedback. One of them was  https://voiagamer.itch.io/ who posted this video today:

I'm super grateful for his post (he has nearly 7,000 followers), but the very public exposure of some bugs made me cringe a little inside. There was one GLARING bug that I was aware of but as a developer you sometimes become "numb" to because in your mind it's minor.. That is the score increments when you die but your last life there's a discrepancy between your printed score and your High Score.  It turns out a race condition of the enemy death vs the player being cleaned up b/c it was his last life was the root cause. That was an easy fix.

The second was new to me and I ALMOST missed it watching his video. In the middle of the video he starts a new game and dies once, then almost clears the FIRST wave and dies with 2 enemies left on the screen. Then you see "Wave 4" pop up as he starts his new life.

Wait a minute! How did he jump from Wave 1 -> Wave 4? At first I thought just video edited to bypass some gameplay but I rewatched it and sure enough the score stayed the same, there was no cut, that was in fact a bug. 

Thanks to it being recorded I was able to replicate pretty easily. What I realized is that I had the logic for broadcasting events in an if statement in the main update loop of the Spawn Controller (those orange things that spit out enemies). There's a few boolean logic conditions that come together to fire a "wave update" signal to the game and it seems when there are 3 or fewer enemies left in the wave and you die - that get's fired for a few frames before the slots / callbacks respond to them! I realized I didn't need that check every frame and moved it to the logic that only gets fired when an enemy dies. So far, I can't reproduce the issue now!

So that's how my day began - now onto creating bosses :)

Boss Battles

Today I got the framework setup for "Boss" battles - though they may be more like challenge battles. At the end of every 5th Wave the game now goes into a separate battle mode. This means the enemy spawners disappear, and battle music and a red vignette cover the screen. I created the first Challenge by 1 rail gunner on each wall and giving them a health that has to be knocked down. Previously all enemies just died upon impact with a bullet so this was a minor change to the enemy base classes, but for the better I think.

Gameplay

The change made me consider other gameplay elements. Like - should power-ups be earned during boss battles? What happens when the player dies in a boss battle - do they keep their existing power-ups? I had to think thru questions like these and determine how they impacted the balance of the game. 

Speaking of balance - I think that is probably the hardest aspect of writing this game. It is way too easy to make a minor tweak in the game that makes it way too hard or way too easy. I very much underestimated how challenging it is to create good balance in a game.

Two Steps Forward, One Step Back

After all is said and done, I have a framework for boss battles. But in the process I introduced one bug that is hard to pin down. Sometimes the spawners don't turn off when I begin the boss battle and there is just no way to survive in that situation. I'm sure I'm just tired this evening and when I look at it with fresh eyes in the morning I'll see the problem. Also my High Score bug is back again :( It seems like such a simple thing but yet it's keeps popping up. I'll look at that tomorrow as well.

Today was entirely creating boss waves and patching bugs in the framework. In creating these waves I'm back to the balance challenge. I need to make the boss waves slightly harder than their previous level, but not so hard that it seems impossible. With this game, that's a fine line.  

The Tank

Anyway this is "The Tank" - not an original name, I know, but it works.. I'll replace the center ship graphic with a more tanky thing later - it's just a place holder right now. This boss has a shield that takes punishment before the ship does. It fires "Seeker" missiles on a regular basis and also has a scatter shot cannon. Combine this with anything else on the screen and it can be challenging. 2 of them are really hard to defeat and 3 .. well I don't think it can be done - And so now I'm playing the balancing game. Tweaking shield values, firing rates, turn rates. All of those to make it challenging but not impossible. 


Fixed the Spawn bug

I solved the spawn bug problem - there were a couple of conditions in the code that could trigger the enemy spawners to fire while in a boss battle and that's not what I wanted. So today I put code in to disable them before the battle starts and re-enable them after the battle is over.

Fixed an enemy bullet bug

Sentinels can fire bullets and so can this tank. I noticed when testing the tank that the Player shields didn't stop the bullet. This has probably been the case since I introduced Sentinels, but they show up so late in the game that when you die you figure you just got nailed with something. So in finding this it was an easy fix to make sure the collisions were behaving properly and now the player shields actually have value against the bullets :)

Started adding a health bar for Boss Battles

My wife was play testing last night and she didn't really have an indicator of how many times she needed to shoot boss wave ships. Because they can take more than one hit (often 30 - 50) she didn't feel like she was doing any damage to them. So today I started adding a health bar. I actually added it and in the process introduced a bug because of the way I designed it's update cycle. So now I'm redoing it - no worries though. It'll get there.

Tomorrow will be a short day so probably just trying to fix the health bar bug.

Fix Scoring Bug  --- Check!

Fix Boss Health bars --- Check!

4 Boss waves taking players up to wave 25 --- Check!

Test play balance --- Check!

It was a busy day getting the above working. Scoring bug was an interesting race condition between the event system and the destructor being called on the player.

In play testing I do have a bug that has popped up once but I am having a heck of a time trying to reproduce it. Sometimes (very rarely) the spawn portals are not getting shutdown when the boss waves start. I saw this a few days ago and thought I had fixed it - apparently I didn't. This is the last bug that I'm aware of in the game (I've closed out all other bug related tickets). Since it's very hard to reproduce I'm assuming it's probably another race condition. I'll have to very closely inspect the code around starting new waves and boss levels tomorrow AM.

This is exciting though - I'm confident I'll get that bug knocked out (first priority) and then I want to put a mechanic in to keep people from camping near the edges to much (that should be easy). Beyond that I'm looking into achievements as the final feature before release. I don't know if they'll be Steam integrated yet or not - I started looking at the Steam API but that seems like something I could address later if there's enough demand. For now it's LOTS of play testing to try to find any more bugs and make sure everything feels right.

Today was finishing the Achievement system. The game has 15 achievements - In the screenshot below I was testing their visibility on the achievement screen and making sure serialization was working.



After getting the achievements working I moved onto that elusive bug with the enemies spawning during boss waves. I realized I was not pausing the emitters correctly and made adjustments for that. Though something was still off. I would occasionally get odd behavior like more than one powerup being offered after finishing a boss wave. So I added a TON of logging and found that for some reason an event is occasionally triggering more than once when it should only trigger once. Adding more logging I was determined to track this issue down. And so I played for hours ....... And couldn't reproduce the bug :(

That said - the anomalies that occur now are almost imperceptible, but I notice them. I'll leave the logging on and play some more - we'll get to the bottom of this. 

Other than what I just listed - I'm not aware of any more bugs (though I'm sure some exist). I cracked out a build and pushed out to my testers. We'll see what they find.

These last couple of days have been building and testing v1.0, pushing to Itch, pushing to Steam and making a Demo.

Building the Demo

Yesterday I finished the demo. It's an interesting challenge on a game this size of how to give enough in the demo to entice a user but not so much that they basically have the entire game available to them. I opted to provide 3 waves in the game and let them sample 2 power ups in the process. The 3 waves jump pretty substantially in difficulty and, using my wife as a measure of a non-gamer trying it - seemed to be balanced just about right. She wanted to play more after the 3 waves were completed (she had to try more than a few times to finish all 3). So in my opinion that's exactly what you want in a demo. Leave them wanting more. I found myself having the same reaction when testing it. I'd "forget" it was a demo until the 3rd wave ended and I'd feel the urgency to play again. Of course I may be biased.


Smashing Bugs

I feel like I've knocked out all of the "major" bugs in the game. I patched a very minor one today where not all of the enemies were giving you a directional indicator when the amount of them in a wave got sparse. I'll be pushing another build with that patch shortly.

An Appreciation for Itch.io Platform

So, I had heard rumors that setting up your Steam presence and submitting your application had some "challenges" associated with it. I can say now that I have gone thru that process that Itch.io is FAR, FAR easier to work with. I am SUPER thankful for Butler - it is simple to work with and for me has just worked. I think Steam should take a few notes and update their pipeline!

In the Final Stretch

I looked for a way to submit status on this DevLog to 90 or 100% but didn't see an option to do so. With that said, I think the game is done and I am just wrapping up a bit of polish and marketing before it goes live! This has been an awesome experience and I'm looking forward to repeating it with my next project!