Tried to make my AI smarterโฆ and it somehow became dumber ๐
A few days ago, I decided to level up the enemy AI in our game. I wanted them to intelligently decide when to:
Link - https://www.youtube.com/shorts/r6rXx5WZ-_4
- Charge toward the player
- Take cover
- Peek and shoot
- And smoothly cycle through these decisions
The result? Pure chaos (video attached ๐)
While it looked hilarious, it was a classic reminder of how tricky game AI can be.
When designing behavior with finite state machines, itโs easy to focus only on the individual states while overlooking two critical things:
- What happens between state transitions
- What happens when the AI qualifies for multiple states at the same time
This leads to conflicting behaviors, awkward freezes, or funny (but broken) enemy actions.
The fix, in most cases, isnโt complicated, it just requires:
- Better condition reevaluation logic
- Proper handling of overlapping states (sometimes by introducing composite or priority-based states)
Now the AI feels significantly sharper.
If you want to see the fixed version in action, weโre launching a playable demo on May 7th. Would love for you to try it and share your feedback!
Drop a comment if youโve faced similar AI struggles in your projects. Whatโs the funniest (or most frustrating) AI bug youโve encountered?
Discussion