Project Information

  • Category: Software Design & Programming
  • GitHub Repository:

To Make My Game Endevours Easier

Nebula is a collection of reusable tools that I've built to make my game dev journeys easier and quicker. This is my favorite type of software; build a complicated system once and then use it indefinitely.

State Machine: This tool is my design for an easily configurable state machine. In traditional state machines, transitions between states can have a somewhat annoying coupling between different state classes. With my design you add states to a state machine with a list of allowed transitions and a state priority. The state machine will handle the state transitions based off of each state's conditions for entry and priority. In practice this has helped me with two things: I can visualize my state graph easier, often without the use of a physical diagram, and modifying state transitions is quicker. Furthermore, I tried to eliminate more coupling with what I'm calling delegated states. Along with my state machine I have an abstract state class that I've implemented using completely delegated functions. This means a single manager class can manage all the state implementations and the data that each state needs doesn't need to be passed around, copied, or referenced more than once for the state machine to function properly. When I put all of this together I've been able to easily and quickly put together a state system. This generic code is in my Nebula repository on GitHub, which is linked above, but if you'd like to see a more detailed example/implementation of this system please view this platformer project that I'm working on here; I also used this state machine for the player controller in my puzzle game that is posted in my portfolio.

Sound Manager: This tool is my design for a scene's sound management. It will configure and manage four types of in game sounds: Background, Ambient, Conditional Background, and Conditional Ambient. Background sounds are sounds that can always be heard by the player such as backgound music. Ambient sounds are sounds that have an in game location associated with them such as fire. These sounds will respond to where the palyer is in the scene; if the player is far away the sound will be quieter. Conditional sound types carry the same attributes as their respective bases but do not loop. These are things such as footsteps which should only play while the player is walking. The largest challenge with this system was implementing conditional, ambient sounds because there can be, practically, an infinite amount of objects that need a location for the sound source but also there needs to be a way for programatic access and modification of these sources. The details are slightly too combersome to explain concisely here but it is all documented in the code on GitHub.

Utils: This is simply a collection of one off functions that perform a task that I had found myself needing constantly. Examples include: rotating a vector by a specified angle, printing text to the screen for debugging, and smoothing vector values by a specified ratio.