Bean Battle

Worked in a team of two with another programmer to demonstrate proficiency working with procedural generation and AI agents. Developed in Unity using navigation meshes for pathfinding and finite state machines in order to keep characters and enemies constantly moving and acting. Later returned to the project to expand on the improve controls and user interface, add visual clarity, add menus and tutorial, improve pathfinding, and round out the experience with win and loss conditions.

Role: Programmer

Sample Work - Character State Machine

The code included here is used by all the actors in the scene, including both player and enemy characters.

The abstract class implementations are shown for Agents and AgentStates:

  • Each type of unit in the game implements their own agent and individual agent states.

    • Individual agents add necessary information, like health, projectile prefabs, and attack distances.

    • Enemies have another parent Agent that inherits from this Agent class and adds information for a targeted player unit, as well as information for tracking how many enemies have been defeated.

    • The enemy Agent subclass has a couple of methods to find the closest target player character and then store that reference for later pathfinding.

  • The agent delegates all of its behaviors to the state, allowing for adjustments in behavior based on the active state.

    • This can be observed by looking at the Update() method of the Agent, which relies on the Update() method of the AgentState.

  • All agents have a NavMeshAgent to allow them to interact with Unity’s Navigation for pathfinding, an active state, and a flag to check if they are unable to be attacked.