

State of Matter

Synopsis
State of Matter is a Sci-Fi First-Person Puzzle/Shooter combo, mixing arena-style combat with intricate puzzle solving.
You, an agent of the Earth Global Council, are tasked with exploring an abandoned mining station on an asteroid to retrieve Plutinite, a newly discovered resource whose state of matter can be altered with ease. Utilize Plutinite in its Gas, Liquid, and Solid states to explore this facility as you discover the truth behind what happened to all of its researchers.
My Roles
Gameplay Engineering
Engine Programming
Level & Technical Design
Music Composition
Team Size
6
Development Time
May 2023 - July 2024
Tools
O3DE, C++, CMake, GitHub, Visual Studio, FL Studio, WWISE
First Commercially Published Product Ever Made with Open 3D Engine
Through a competitive selection process, my team and I were chosen and funded by the Open 3D Foundation, a nonprofit subsidiary of the Linux Foundation, to build our game idea in their new Open 3D Engine (O3DE) to publish as the first ever commercial product using it.​
Check out some of these articles and interviews talking about us!





Engine Programming
Despite having never touched this engine before, my team and I hit the ground running and became familiar with its systems quickly. We successfully delivered our first vertical slice prototype to stakeholders within the first month of development. This was possible because the first thing I did was analyze the engine's source code to examine its core systems in order to understand how to make the most use out of it. I then effectively guided my team with what I learned, bringing everyone up to speed. I continued this cycle of analyzing engine source code and communicating my findings to the team throughout the project, minimizing production overhead from lack of familiarity with the engine.
I've gained much experience diving into the inner workings of a huge codebase as I did with O3DE, even fixing bugs and adding features of my own.
I fixed several issues related to engine and game build compilation. This included O3DE's CMake build scripts which were missing some important generated expressions for compiling its 3rd-party particle VFX plugin PopcornFX in Release Mode. I also fixed a compilation issue with Area Light components caused by ambiguity between different function signatures. I renamed and separated their functionalities more intuitively so there is no ambiguity for the compiler or developers.
Aside from bug fixes, I wrote a level exporter tool for the engine that exports all primitive geometry related to a level's Greybox layout to a file with the click of a single button. This file can then be used by an artist to import into their own 3D modeling software such as Maya or Blender for easy and seamless integration of environmental art! Interested in the code? Check out the commit here.
Gameplay Systems
I built the vast majority of game functionality, including:​​​​
​​
Player's Weapon
Switches between 3 firing modes:
​
-
​Gas - Emits lingering fumes that damage enemies and melt ice inside.
-
Liquid - Fires a stream of super-cooled liquid that damages enemies and extrudes ice formations that exist throughout the game.
-
Solid - Fires a ball of hardened ice that heavily damages enemies, or lodges itself into a wall to become a new source to extrude from using Liquid mode.
-
Supports both Mouse & Keyboard and Xbox controller
​
These modules were implemented as separate components independent of the base weapon functions. This way, one could easily remove or add more modes and they would seamlessly integrate into the weapon.​​​​​​​​​​​

​​Player Movement & Gamepad Support
Much care was taken to ensure the player can comfortably execute tough platforming sections with relative ease. My implementation for player movement and physics includes:
-
Customizable player acceleration and deceleration
-
Coyote Time to add forgiveness for difficult jumps
-
A Dash mechanic for enhanced versatility only Earth's greatest agent is capable of
Player movement was built from scratch for both Mouse + Keyboard and Xbox controller input, both of which feel intuitive and natural. UI tooltips also automatically switch between input methods if the player switches to a different input method at any point during gameplay.



Tooltip UI changes when I start using the controller, then changes back when I go back to the keyboard



Combat and Puzzle Interaction System
State of Matter is divided into combat and puzzle encounters. Completing one causes a change in the environment, such as opening a door, activating a power source, etc.
​
​I built a simple event-based encounter system that allows for scripting custom puzzle and combat encounters that integrate seamlessly into the game without extra setup.
This system is made possible by O3DE's Event Bus system that allows one to call an event with a specific ID, and all listeners subscribed to that event on that same ID (a.k.a. "bus") will be invoked.
​
This system was used to implement every puzzle mechanic and combat encounter in the game, many of which I also designed myself.


Save/Load System
This singleton system automatically handles the saving and loading of player data, including their last checkpoint, associated spawn point, which weapon upgrades they have, and which sublevels of the game's open world are loaded.
​
I created a basic API for creating custom save points that updates the player's checkpoint, respawn point, etc. I used this API frequently to save the player's data upon the completion of cutscenes. I also used it to create a Checkpoint Trigger prefab that designers can simply drag and drop into the scene and define what checkpoint to set the player to. When the player enters this trigger, it automatically saves their current location as their respawn point, then saves their checkpoint according to what the designer specified. The player will then spawn at this point in the game when starting a new session or dying.
Buff / Debuff System
Designers can script custom Buffs and Debuffs. One can define what it does when it is applied to an enemy, what it does while it is active, and what it does when it expires. These behaviors are function objects in C++ as part of the buff/debuff data structure.
Applying debuffs to enemies is as simple as a line of code, allowing for rapid iteration of creative combat interactions.
​
An example of a debuff in State of Matter is Burst, which causes an explosion at the target's position when applied, then takes damage continuously over its 5 second duration.​​
An enemy's applied debuffs are housed in an unordered map so that an applied debuff that is already active simply overwrites the one in the map, preventing duplicates.





UI Systems
I implemented State of Matter's UI's, such as the main menu, options, collectibles UI, pause menu, and most importantly, the player's Heads-Up Display.
​
The HUD is handled with a single HUD Controller Component, and is entirely event-driven. It subscribes to various events such as firing the weapon, switching weapon modes, etc. and executes different animations and displays corresponding info when those events fire. This means it does not directly refer to anything else in the game, and nothing else directly refers to it. With this elimination of dependencies, one could easily disable HUD functionality without breaking anything unintentionally. This also means it can be changed without any compatibility issues with other systems.
​
This approach to the HUD UI system is an excellent example of how I programmed everything else in the game, and why we were able to implement so much content in only 1 year, despite being in an engine we'd never touched beforehand.
Enemy AI
​Behaviors are built with a component-based approach. For anything that can be damaged by the player, an Enemy Stats Component can be added to the entity. Designers can customize its HP value, how much ammo it drops on death, etc.
​​
Different enemy behaviors and abilities are also created as components, of which there are melee types, ranged types, stationary turret types, and a unique type for one of the game's big bosses. Designers can mix and match these components to create interesting combat encounters.





Prop Physics
Another significant mechanic of the player's weapon is its ability to push and pull various objects in front of it. This mechanic involved a target lock-on functionality that lets the player easily target an object in front of them by aiming in its general direction.
To implement this functionality, I wrote a custom Cone cast function that acts similar to Ray casting and Sphere casting but queries the scene in the shape of a cone instead of a line or sphere going in the specified direction. Players are able to easily lock onto an object without needing to aim precisely at it with this, leading to much more fluid gameplay.
Event-Driven Programming and Data-Oriented Design
All of State of Matter's systems were built using an event-driven, data-oriented mindset, resulting in highly maintainable, robust, and scalable code. It is for this reason that our game ended up being so complex in scale despite only having about a year of development, all the while having minimal bugs and running consistently above 60 FPS on release.







Level Design & Music Composition
I designed 3 of the 5 main levels in the game:
The Surface (Level 1), with another designer
-
The player begins here, on the surface of the asteroid. I blocked out the initial tutorial scenario that familiarizes players with the movement controls, the basement rooms that onboard the player's new weapon and its associated Gas Mode, and the massive reddish room that houses the final puzzle.
The Plant (Level 2), with another designer
-
I blocked out the majority of this level, including the first part that onboards the player to the weapon's Liquid Mode, the various combat and puzzle encounters afterwards, the narrative transition area (which I won't talk about due to spoilers), and the room housing the final puzzle challenge putting the player's understanding of Liquid Mode to the test.
The Mines (Level 3), solo
-
This level features a giant tower built deep underground that the player must climb up. I blocked out this entire level, including the initial part that onboards the player to the new Solid Mode mechanic, all associated platforming and puzzle sections they encounter as they climb the tower, the introductory bossfight that occurs in the middle of the tower, and the final fight that occurs on the rooftop.
​
I also composed the entire soundtrack, comprised of 13 songs! I implemented music using WWISE to make on-beat stingers unique musical transitions based on the game state, such as beating a boss fight or level.

