Goal-Oriented Action Planning (GOAP): Writing Smarter NPCs in Go

    Beyond Scripted AI Most game NPCs follow scripted behaviors or state machines: “If enemy seen, attack. If health low, flee.” While predictable and easy to implement, these approaches lack the intelligence to adapt to changing circumstances. What if your NPC could plan their own actions based on goals? Goal-Oriented Action Planning (GOAP) empowers NPCs to dynamically create plans to achieve their goals. Used in games like F.E.A.R. and The Sims, GOAP creates emergent, intelligent behaviors that feel surprisingly alive. ...

    September 19, 2024 · 9 min · Rafiul Alam

    Building Modular Game AI: Implementing Behavior Trees with Go Interfaces

    Why Behavior Trees for Game AI? If you’ve ever built game AI using finite state machines, you’ve likely hit their limitations: rigid transitions, difficulty composing behaviors, and maintenance nightmares. Behavior trees offer a more flexible, modular approach that’s become the industry standard for game AI. In this post, I’ll show you how to implement behavior trees in Go using interfaces, creating reusable AI components that can power everything from enemy NPCs to complex AI companions. ...

    May 22, 2024 · 10 min · Rafiul Alam