Monday 28 August 2017

Level Exit, Boss Fights, HUD, Statistics, Chaos Engine Reference

Busy month - well they're all busy months, it's just that sometimes more stuff end up working than others.

I coded a level exit system which ends with a boss fight, which is currently a big placeholder cube with a charging attack. The exit itself is shielded and the player has to find and activate a seperate node ("NODE ON!" Chaos Engine was a great game back in the ... er ... early 90s?). This unleashes the level boss, and once defeated the exit's final shield fails, the exit opens and all hell breaks loose whilst the player runs to escape the level.

Deactivated nodes have a padlock item above them and a single shield of falling energy particles (which is an animated texture mesh), whilst the exit can have multiple shields (one for each node and an extra one for the level boss). Exits have a revolving exit sign above them. Currently both nodes nad exits are using the same model but that will change in the future. so that exits look unique. In the first level the node will be next to the exit to teach the player the clear relationship between them. In all future levels the node and exit will be randomly placed away from each other and there may be multiple nodes which require unlocking. Nodes are unlocked in the same way SWAG is bought, stand over them and press BUY button and spend that cash.




After successfully completing the level, the player is shown a progress screen which displays multiple statistics and a big scroll list of all the swag that they have picked up.


Testing the gameplay for an hour and then viewing the statistics it became clear that the scoring system needed some tweaking. Sixty minutes of blasting the hell out of everything and collecting nearly 90 power-ups made the score not seem particularly charitable. To this end, I decided that doing anything would increase the score. Kill enemy score++, pickup cash score++, take damage score++, spend cash score++, etc. I also decided to throw in a score multiplier system. This works like a rage system in fighting games (or at least I "think" it does because I've never been a fan of fighting games). I called it "Momento Mori" because dead enemies boost the bar and it can go through 3 levels of muliplication for kill scores before sticking at level x4 for 30 seconds and multiplies all points from all sources. Using heavy attack boosts Momento Mori the most, light attack less and item kills the least.



Which brings me to changes to the HUD and general player interface. I added icons to all the bars and other player display objects. Cash and Points are animated meshes embedded in the HUD which rotate. Cash is a silver coin  - gold for a king, silver for a gentleman ;), score is a gold star in a ring (cos it looked better than just a star), health is a heart whilst energy is a lightning flash and Player Status is still a placeholder banana. Experience and Leveling was a little more awkward. Initially it was just "XP" though I eventaully settled on a bar chart with a small arrow at the end.


When the player exits the level - or dies, whichever comes first - their remaining cash is transfered into points at a rate of x10. Originally there was a whole load of text explaining this but I replaced that with an icon which hopefully does the same. This now displays for a few seconds before the whole screen fades out and the statistics interface fades in. I may in the future replace the text in the statistics with symbols.


I also declared a major victory in the on-going struggle against console spam. When a trigger was deleted, it would list the objects in it for a final onExit callback - except it didn't have a list anymore because it was being deleted. A quick "if ( gEvalState.thisObject->isProperlyAdded() )" put paid to these needless warnings and lines of red highlighted text in the IDE and console. Hurray!