Project 2

Project Goal

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.

How To Play

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.

Method of Making AI Behavior

Elemental Harmony Gameplay
First method (Unused)

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.

Elemental Harmony Gameplay
Second Method (Used)

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 Behaviors

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.

Elemental Harmony Gameplay
Idle State

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.

Elemental Harmony Combat
Roam 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.

Elemental Harmony Player interactions
Sleep State

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.

Elemental Harmony Gameplay
Pursue / Chase

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.

Elemental Harmony Combat
Attack State

In combat, NPCs damage their targets and gain happiness when victorious. This mechanic serves as a natural way to regulate the elemental population.

Elemental Harmony Player interactions
Interacting State

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.

Elemental Stats

To create fun, surprising, and sometimes even frustrating moments, I developed a system where all objects dynamically interact with each other and NPCs.

Elemental Harmony Gameplay
Fire Type

Fire-type NPCs gain temporary stat boosts when near a campfire.

Elemental Harmony Gameplay
Water Type

Water-types heal when close to a pond.

Elemental Harmony Gameplay
Nature Type

Nature-types reproduce faster when in their natural environment.

Environmental Interactions

Elementals are born with randomized stats and exhibit different behaviors when near structures associated with their type.

Elemental Harmony Gameplay
Camp Fire

Spawns embers that burn trees, but can be put out by water type elementals.

Elemental Harmony Combat
Pond

Increase growth rate of nearby trees but can be sucked dry by nature types.

Elemental Harmony Player interactions
Tree

Grows faster when near ponds, can be burned down, can be restored when burnt

Player Interactions

Elemental Harmony Player interactions
Spawning Objects

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.

Elemental Harmony Player interactions
Collecting Objects

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.

Learn About Me