TOC
Premise
The main learning goals I had were:
- Learning which programming paradigms work in game dev
- Unity basics
- Unity input basics
- UI basics
The idea was to make a simple 2D twinstick top down shooter about the following idea
Every enemy can be bought to and equipped on either the man body or the “gun” to enhance the modifiers such as, emitter count, health, projectile count, homing strength, cooldown etc.
The idea was mostly inspired by the desire to understand how the additive modifiers of projectiles and characters in rogue-lites like Binding of Isaac could be structured in an extensible way.
Learnings on the way
While working on the project I quickly felt the need to utilize the FSM pattern to manage some of the complexity of the enemy ““AI””, so being as lazy as I am I looked around for ready made FSM solutions for unity and also read a bit through their code. After checking all the big players a full blown graphical FSM seemed way too overkill for this simple project and to be honest I didn’t understand many of the design decisions they made and features they offered.
So as a way of learning I decided to roll my own simple FSM to gain an understanding of the problem space and look when my solution would fall apart.
After iterating over my FSM solution over the course of the prototype the implementation gradually converged on the features and patterns of all the existing FSMs. Gee who would’ve thunk? And also I very very quickly lamented the fact that my FSM did not have a visual graph to manage the states. Without any graphical interface to manage the states it was difficult to properly reason and think about the FSM I was working on. Even just simple machines that only used 5 States took me longer than it should have because accounting for missing or wrong transitions is hard in a linear text file like it is the case in code.
So I vowed that in the next project I’ll try a graphical FSM.