OverviewEngine: Custom C++ Game Engine
|
|
Scenario Components
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.