Hello and welcome to AI and Games, I'm Tommy Thompson, you're listening to Stan Bush and today we're
talking Transformers. This video looks at a series of games to highlight the continued
advancements of AI in commercial games, with a focus on two third-person action games based
on the ever-popular Transformers franchise: War for Cybertron and Fall of Cybertron. Developed
by High Moon Studios and published by Activision in 2010 and 2012.
However, before we start in earnest, we're actually picking up on a video we recorded
a long time ago... The story ahead and the games involved relate heavily to our previous
discussion on the Goal Oriented Action Planning tech used in the FEAR trilogy. If you have
not watched 'Facing Your F.E.A.R.' already on AI and Games, I'd strongly recommend you
check it out before we go any further. But hey, if you're still with us, then let's
roll out!
The Goal Oriented Action Planning method was adopted for the non-player characters in TRANSFORMERS:
WAR FOR CYBERTRON by High Moon Studios, which was released in 2010. The idea behind this
is that given GOAP adopts a planning-lite method of search, it provides quick and simple
solutions for non-player characters (NPCs) to react to the players behaviour. GOAP caused
a bit of a stir on its release - and FEAR to this day is hailed as a great example of
NPC AI for first-person shooters - and as such a number of developers sought to adopt
it. Naturally this brought benefits of autonomous, goal-directed NPCs that would keep players
on edge, but it, in-turn, introduced limitations that resulted in alternative approaches to
planning being considered.
To give some quick background, War for Cybertron is a third-person shooter during which players
must fight through waves of the opposing faction, be they Autobots or Decepticons. Given this
is the Transformers, players have the ability to transform at any time from their humanoid
robot form into a vehicle. These vehicles can be cars, tanks, planes. Y'know, typical
Transforming-fare. The GOAP system was used in order to control each of the NPCs that
are part of the gameplay. We can often see a lot of these NPCs in action at any given
time, since the game likes to focus on large-scale combat. However, this started to cause some
problems which ultimately led to some concessions by the developers.
The reason behind this is that it proved challenging to translate the desired behaviours into the
GOAP system. As acknowledged in our F.E.A.R. video, the emphasis in GOAP is on crafting
goals that the AI can achieve and then coming up with any solution that satisfies them.
However, this means that the suite of possible behaviours is at the mercy of the planning
system, rather than the designer. Now, this might sound ok as an observer, but ultimately
designers still want to assert some control over what the AI does in the game. In this
instance, we're dealing with a large range of Transformers: which should result in styles
of behaviour to help the player interpret not only what they're fighting, but how best
to counteract it.
To add to this issue, AI developer Rory Driscoll explained that in War for Cybertron the system
couldn't specify costs of plan-actions on a per-character basis. This has a real impact
on our previous point, given that you couldn't make, for example, running actions less desirable
than flying for a Decepticon that transforms into a jet. This would be a really desirable
feature, given you can tune how each class of AI interprets the world. So in some cases,
we have AI acting almost out of character, resulting in the designers would sometimes
ignoring the AI system and craft some sequences by hand.
There was also the issue of resource consumption: given that you would have many bots planning
fairly frequently and that's going to take up CPU and memory, when we can't afford to
give it an awful lot in the first place. This was compounded by the GOAP planners precondition
system being rather expensive to compute and resulted in some overheads in what was already
an expensive planning process. As explained by AI developer Troy Humphries, this was resolved
by storing the entire search-space in memory, allowing for a quick lookup of plans to execute,
but at the cost of having to spend a lot of memory just to keep the AI search space around
in case we need it.
LEAVING GOAP BEHIND ===================
Clearly this was going to turn into a dead-end: not because the technique didn't work, but
simply wasn't behaving as intended for the level designers. With War for Cybertron was
completed, the AI team looked into an alternative approach and led them to work adopted in the
Killzone series developed by Guerilla games. In Killzone 2, the AI team used a particular
type of planning system known as HTN planning and High Moon decided to try it out themselves.
Hierarchial Task Network (or HTN) planning is a principle of higher-order partial-order
planning that was pioneered in the 1980s and 1990s by the likes of Austin Tate at the University
of Edinburgh, David Wilkins of SRI International and Dana Nau of the University of Maryland.
HTN planning takes the same principles as before, but the emphasis is on constructing
intelligent high-level behaviour, rather than working from simple actions towards goals.
One of the legitimate issues of using traditional planning is that as a designer you place more
emphasis on the individual actions and how these will all help in some way or another
to reach the goal. This means that while the system is versatile and can combine collections
of actions that are useful, it doesn't focus on the larger behaviour it is exhibiting.
That is where HTN becomes useful.
In HTN planning, you model the world using what is essentially macro-actions, also known
as tasks: combinations of actions that make more complex behaviours. Like regular planning,
these carry their own preconditions and effects. However, unlike regular planning, we only
need to consider the preconditions at the start of the task and the effects that the
complete series of actions within the task will have on the state. We can break down
tasks into two distinct types: primitive tasks which are comprised of maybe one or two regular
planning actions, or compound tasks that use not only primitive actions but also other
compound tasks in order to complete a problem. These help solve larger chunks of planning
given that a task network can solve a subset of a problem and introduce several actions
for the agent to execute in one fell swoop. This allows you to model more complex behaviour
really quickly.
There is an obvious benefit for game developers who are new to HTN planning. If we consider
this image, taken from work by researchers on the SHOP2 planner at the University of
Maryland, it shows a final HTN plan that can satisfy a particular logistical problem. This
results in a tree-like structure where users would navigate and execute actions from the
left to the right.
This tree like structure and the order in which we execute it, is incredibly similar
to that of behaviour trees: the default AI tool in Unreal Engine 4 and popularised in
game development largely through the Halo series. However, unlike behaviour trees, a
HTN plan is constructed in real-time based on the current goals and state of the agent.
If you're not familiar with behaviour trees, be sure to check out our video on the Halo
AI already on AI and Games.
So how does this work with the Transformers games? Well, let's have a look at how it payed
off for High Moon.
After releasing the movie tie-in to Transformers: Dark of the Moon, High Moon's next title was
War for Cybertron's sequel: Fall of Cybertron. Having refined and iterated on much of what
made War for Cybertron great, Fall of Cybertron is - in my opinion - the best game High Moon
Studios has ever made. Fall of Cybertron replace GOAP with HTN planning and results in a number
of task networks being defined for characters. Multiple primitive tasks are established per
character with unique conditions that dictate when they might execute, so as to inject a
little diversity in the gameplay. Meanwhile, compound tasks would carry multiple tasks
within them whose preconditions would dictate how the NPC would behave. This allowed for
example attacking behaviours to vary depending on the distance and visibility of the NPCs
target. Ultimately, designers have a lot more control over the intelligent behaviour these
characters are exhibiting, given that the HTN method is adopting this rather expressive
top-down approach to behavioural design.
This subsequently lead to gain in overall performance, as AI planning researcher Eric
Jacopin discovered when profiling the planning systems in F.E.A.R., Killzone and Transformers
Fall of Cybertron against one another. The HTN implemenation not only yielded longer
plans faster, but also utilised more of the available planning actions available to it
than GOAP did in F.E.A.R. Although Jacopin himself was keen to point out how the differences
in AI implementations would have an impact on performance and thus not declaring a winner
or loser in this discussion: since each clearly achieved their goals in their repsective games.
Thanks to the likes of Killzone and
Fall of Cybertron, HTN planning now sits comfortably as one of a variety of approaches to accomodate
fast and adaptive AI decision making, given it allows for designers to focus on the more
complex and abstract behaviours while the AI glues them all together during gameplay.
HTN has since grown in prominence and has been adopted in other games, such as Max Payne
3 and even Dark Souls. As always, we have barely scratched the surface and the written
piece that accompanies this video is available for those who want to learn about this in
more detail.
If you've not played the Cybertron series they are a cracking pair of shooter titles
and well worth your time. You can find both of them on PC, Xbox 360 and Playstation 3.
As a Transformers fan myself, I have to say they're the best Transformer games ever made,
with Platinum's Transformers Devastation not far behind. A great way to wash the horrors
of the Michael Bay movies from your otherwise delicate palate.
As always, thanks for watching here at AI and Games, and if you enjoyed the video, don't
forget to like and subscribe If you're fan of the Cybertron series, let's hear about
your experiences in the comments. And with that, this is Tommy signing off. Time to cue
the music...