CARLOS GUTIERREZ
  • Home
  • Professional Work
    • PREY MOONCRASH
    • PREY
  • Student Work
    • Team Projects >
      • From The Ashes
      • Project Island
      • Sky Knights
      • Ethereality
    • Individual Projects >
      • Thesis - Fuzzy Fitness Scoring for Companion AI Strategy
      • Fighting Ants AI
      • CUDA Raytrace Rendering
      • Goal Oriented Action Planning
      • Data-Driven Roguelike
  • Resumé
  • About Me
Picture

Overview

Engine: Custom C++ Game Engine
  • AI goal is to continuously obtain more food to sustain themselves
  • Goals and Actions for the AI are decoupled, unlike in a FSM. The AI uses A* to path through a graph made up of "world states" (nodes) and Actions (edges) to find the best plan in order to satisfy the assigned goal
  • Several methods of getting food require multiple steps with dependencies. GOAP allows the AI to form a plan to get the food using the AI's available Actions

Scenario Components

Picture

What Went Well

  • After finalizing the design of the base "GOAP Action" class,  I was quickly and easily able to add new actions and behaviors to the AI
  • My Data-Driven Roguelike provided a great environment to test the algorithm, and the Data-Driven nature of it allowed me to easily add, remove, and test actions and items
  • I spent a significant amount of time implementing a variety of console commands and conveyance that made debugging the AI much more pleasant

What Went Wrong

  • I had initially tried to make GOAP Actions too atomic. This resulted in unneeded redundancy and a massive increase in complexity of graph of actions, which in turn led to noticeable slowdowns early in development. 
  • For some early actions, I spent too long trying to find "ideal" solutions instead of doing smaller, more frequent iterations, which was demoralizing.
  • Initial scenario did not have the right requirements for GOAP to be effective, so I had to make what became the current scenario

What I Learned

  • Design your AI and algorithms carefully based on the scenario that design needs them to perform in
  • When building AI especially, start small and simple and iterate up instead of trying to get the perfect answer the first iteration
  • AI can be difficult to debug, so ensure that your debugging tools and utilities are robust as possible

Code Sample

Below is an example of one of the "GOAP Actions." The behavior of the AIs would be determined by what actions they had in their list of possible actions. "Move to Target" is used to move to AI to a particular target, such as food, an oven, or a prime fishing spot.

GOAPAction_Movetotarget.h

goapaction_moveToTarget.cpp

Copyright © 2020
  • Home
  • Professional Work
    • PREY MOONCRASH
    • PREY
  • Student Work
    • Team Projects >
      • From The Ashes
      • Project Island
      • Sky Knights
      • Ethereality
    • Individual Projects >
      • Thesis - Fuzzy Fitness Scoring for Companion AI Strategy
      • Fighting Ants AI
      • CUDA Raytrace Rendering
      • Goal Oriented Action Planning
      • Data-Driven Roguelike
  • Resumé
  • About Me