Development of Memoriam


Memoriam is a submission for Brackey’s Game Jam August 2023. It was made by a team of 5 developers using Unity. My main roles for this project were Gameplay Programmer and VFX artist.

The game overall turned out super polished for a game jam and we have been ranked in the top 50 entries out of 900 submissions. In this blog, I would like to talk more in depth about some of the features in this game to showcase my thought process for developing the game.

Managing Game states

Memoriam’s core game loop goes through multiple states but to summarize:

  • Exploration / Combat

  • Fragment (Item pickup)

  • Defeat (When player lost)

Each of these different states lead to multiple sequences occurring. For example when the player dies, we needed to replace the music playing in our level.

In order to facilitate all of these events in a scalable method, I’ve decided to use use delegates and enumerators to process switching states.

What I have is a static class “Gameplay Statics” which acts as my Game Manager. The main purpose of this class is to simply handle what state the game is currently on. The class contains a SetGameState function which takes in our enumerator. Once the change has been made, it invokes a static delegate that other objects can subscribe to and handle any additional functionalities.

Going back to my previous example when the player dies, I can handle all local functionalities within the player script and then set the game state to “Defeat”. Resulting in decoupled systems.

Warning: When dealing with static delegates, don’t forget to unsubscribe to them when they’re not needed anymore. Particularly during OnDestroy / OnDisable.


UI Management

An example of how this has been utilized is through our UI management. There is a specific canvas childed for each of our game states. This is all stored within a dictionary that takes in our state enum as the key and returns the canvas gameobject it is representing.

Whenever the state has changed, the script below iterates through all the canvases and disables them. After, we turn on the canvas that represents the state that we are currently in.

The nice thing about this implementation is that I don’t have to write any more logic inside my gameplayStatics script to facilitate any new features. Any additional state dependent logic can be implemented in its own class.