This article was published for PREMIUM members, available by subscription. You can join here in a minute or less. If you're already a member, log-in from the top right menu.

Premium Teaser

Goal-Based Action Optimization and the Hybrid Hero AI in DEMIGOD

Alex J. Champandard on September 9, 2009

Demigod is an innovative hybrid between RPG and RTS games, challenging the player to control and manage a Hero-like unit to accomplish a variety of missions (e.g. Dominate, Conquest, Fortress) in a set of predefined maps. It's built mostly as a multi-player experience, but includes an offline Skirmish mode for both quick games and tournaments against the AI. Since the implementation is based on a goal-oriented action planner, I've been keen to play the game and dig into the Lua code for the last week.

I was expecting to find a textbook application of the goal-oriented action planner (GOAP) from F.E.A.R. pioneered by Jeff Orkin. On the surface that seems to be the case, as the architecture and many of the high-level concepts are similar. However, under the hood, almost everything is done differently — to the extent that it's more similar to other game AI approaches than goal-oriented planning. And indeed, due to the RPG nature of the game, the long term progress of the AI Demigods, and the dynamic yet tactical gameplay, the problem required a very different solution.

In this in-depth feature, you'll learn how the AI used for the Demigods was architected and implemented (a.k.a. Hero GOAP). You'll find out why the name "goal-based action optimization" fits better than calling it a traditional STRIPS-like planner implementation, and what was necessary to make such a system work on such a large search space with a wide range of choices available.