My goal for this project was to design AI behavior that creates moments of surprise, fun, and even frustration for players — the kind of dynamic interaction that makes gameplay memorable. To achieve this, I focused on building an AI that actively reacts to the world around it, responding to player actions and environmental changes in real time.
Use WASD to move camera.
Scroll wheel to zoom in/out.
Use your Cursor and left click to select and place items, to pick up currency.
To create a more realistic simulation, I began researching behavior trees. As I deepened my understanding of how they function and are structured, I realized that—given the project’s time constraints—they wouldn't be the most practical solution for this scope.
I pivoted to using a finite state machine, a system I’m more experienced with, which allowed me to deliver a more viable product within the project timeline. With this transition, the project’s focus shifted toward creating a simulation emphasizing NPC-to-NPC interactions, reducing direct player influence and fostering a more dynamic world.
The AI behavior is driven by a Finite State Machine, with variations in how each AI type interacts with the world to create distinct personalities and behaviors.
When in this state, the NPC remains still while scanning its surroundings. During this time, it has a chance to spawn a structure related to its type.
If an NPC is uncertain about what to do, it defaults to the idle state.
NPCs choose a random direction to move in, keeping their behavior unpredictable and engaging.
This allows them to explore their environment, discover interactable objects, or encounter other NPCs.
While in this state, NPCs recover health and stamina at an accelerated rate, adding realism and giving them a variety of states to select from when deciding their next action.
When engaging with another NPC, they may either flee in a random direction or charge toward the aggressor, depending on their individual stats.
This dynamic choice adds believable behavior and improves the survival chances of weaker elementals.
In combat, NPCs damage their targets and gain happiness when victorious. This mechanic serves as a natural way to regulate the elemental population.
Additionally, NPCs interact dynamically with the environment and placed structures, with different NPC types responding uniquely to various objects, enriching the simulation’s depth and complexity.
To create fun, surprising, and sometimes even frustrating moments, I developed a system where all objects dynamically interact with each other and NPCs.
Fire-type NPCs gain temporary stat boosts when near a campfire.
Water-types heal when close to a pond.
Nature-types reproduce faster when in their natural environment.
Elementals are born with randomized stats and exhibit different behaviors when near structures associated with their type.
Spawns embers that burn trees, but can be put out by water type elementals.
Increase growth rate of nearby trees but can be sucked dry by nature types.
Grows faster when near ponds, can be burned down, can be restored when burnt
Players can spawn objects that influence the development of the Elementals. I developed a system that translates 2D UI inputs into corresponding actions within the 3D game world.
Players earn currency by keeping Elementals well cared for. I developed a system that lets players click on currency drops to collect them and also allows players to focus in on individual Elementals for closer interaction.