Contribution
Programmer
Development TimeLine
2 weeks
Framework
Unity
Platform
HoloLens
Description
The Extraction is a comical, theatrical, mixed reality experience where Dr. Xenophon S. Hubris is a live-action confederate of the game. He has a terrible fungus/monster inside of him. The fungus is going to kill the doctor unless the guest helps him kill the fungus.
The guest who arrives at the lab on his first day has to perform a surgery to eliminate the fungi from the doctor's body. This is an immersive experience as only the guest is able to see the skeleton which requires him to have a back and forth conversation with the doctor lying on the table.
The game sets the interest curve in a way that the guest has to tackle with one fungus at the beginning, then deal with several unexpected fungal colonies and at the very end cope with the heart being dragged away by the fungus. The guest then has to place the heart back into its right location which brings the game to a halt and leaves the guest and the audience wondering as to whether the guest was successful in his surgery.
Game State Manager

For this game, I would like to emphasize on the importance of a Game State Manager while developing a game. In the two weeks of making this game, I realized how significant game state managers are. Initially, in week one, which consisted of getting the prototype ready for the interim round, the three parts (Introduction, Main and Ending) of the game were based on transitions handled by functions and couple of flag variables.
As we kept moving forward and iterating our game in the second week, we realized our previous approach was messy and it was time to make it more organised by using states and transitions between them.
Advantages of using finite state machines:
-
State machine diagrams make sense when one has many states to take care of along with time triggered events. By time triggered events I mean specific actions that are stored as procedures that need to be executed at certain intervals or when the game enters a specific state. Every state will take an input and depending on the condition (Float, Int, Bool, Trigger), the next state may or may not be executed.
-
Another advantage is that one can incorporate multiple changes without affecting the existing code.
-
Though Unity’s animation system (mecanim) is generally used for playing animation clips, it can be redesigned as a Game state handler. State machines make the code more intelligible as it gives the developer and designer an idea about how long each state is and what events are triggered in every state. It becomes easier for the developer to debug (as every state is visible and the state with an error can be caught very easily) and straightforward for a designer who wishes to understand the flow of the game very briefly.
-
A state machine can take care of erroneous inputs, scenarios with more than one different state and fostering re-usable states.
-
It helps the current game state to loop until the next action is triggered.
We repurposed Unity’s animation mecanim and used it to make transitions between different game states.
Steps:
-
We first create an animation controller that serves as a basis for the finite state machine.
-
We create states inside the machine. These states may or may not be animations. They can simply be used to accommodate looping conditions or triggering an action independent of animation. For example, tap to initiate scanning-
3. We then add the animator to a gameobject that now holds the finite state machine.
4. A game state manager script is created that contains functions. Each state can now be now be assigned a function as a condition which when true, it will be executed and the next state can be triggered.
Some problems with Game state managers:
-
Transition duration must be set to zero to avoid overlapping between states.
-
Sometimes, the actions in the new state will not be executed because the previous state has not been executed completely. The triggers in the previous state may get set later and persist beyond the current state.
References:
[1] Game state manager - http://gamedevgeek.com/tutorials/managing-game-states-in-c/
[2] Unity's mecanim - https://docs.unity3d.com/Manual/class-Transition.html
[3] Finite state machines - https://medium.com/the-unity-developers-handbook/dont-re-invent-finite-state-machines-how-to-repurpose-unity-s-animator-7c6c421e5785

Want to know more about the Design side of this game?