Hi I'm Tommy Thompson and this is AI and Games.
Some of the biggest challenges facing modern game development can be found in open-world
game design: how to build large, vibrant and interesting locales for players to explore.
Today we're going to look at how AI can address the challenge of creating interesting and
dynamic environments that enhance the overall experience for the player.
Having previously discussed similar challenges found in the director AI system of Valve's
Left 4 Dead and more recently the two-tier system governing Creative Assembly's Alien:
Isolation, we look at the ever increasing game worlds found in Ubisoft's US-foreign-policy
simulator: Far Cry.
Far Cry is renowned for it's open approach to exploration and problem solving.
What originally started out as a open-albeit linear gameplay experience, the series has
became increasingly more adventurous in its design as the maps have not only increased
in size but also with the introduction of more interactive environments and wildlife.
The latter proves really exciting, given that it can completely change the dynamic of gameplay
- which could prove inspirational or even fatal when you're in the thick of the action.
Achieving this is all rather demanding.
Given there's a need to balance the players sense of importance and being the focus of
the action, while ensuring they're not bludgeoned repeatedly and are offered some respite.
Conversely, there's also the issue that these massive open expanses need to be properly
managed: given it's not computationally feasible nor responsible to leave thousands of non-player
characters roaming the Rook Islands or the vast mountain ranges of Kyrat.
So how does it all work?
The answer of course, is with a little bit of AI ingenuity through smart directors!
This is an increasingly popular way to manage large open-world environments, with much of
it stemming from the pioneering works found in Left 4 Dead.
Turtle Rock and Valve's survival shooter focussed on the distribution of enemy characters within
close proximity of the player in an effort to maintain the illusion of a zombie apocalypse.
You want to learn more more?
Be sure to head to the videos linked to now.
But for now let's look at Far Cry and how this series has evolved into the franchise
it is now and take a peek at some of the secrets behind their AI implementation.
The original Far Cry game launched back in 2004 as an action heavy first-person series
that gave the illusion of open-world gameplay through its large albeit limited gameplay
areas.
Meanwhile Far Cry 2, launching in 2008 was the first in the series to truly embrace the
notions of open world gameplay and more importantly, systemic design: the ability to have a range
of independant systems and mechanics that can be combined in fun and interesting ways.
All with the intent of creating an emergent gameplay experience where players exploit
the systemic design to full effect.
But it didn't quite pan out: Far Cry 2 is a bit of a frustrating experience, largely
because these systems were not properly balanced or constrained.
But starting with Far Cry 3 in 2012, the systems within the game reached a level of maturity
that improved the experience overall.
The systemic framework in Far Cry 3 achieved what Ubisoft themselves refer to as "The Anecdote
Factory": a system that would create weird, wonderful and individual gameplay experiences
you would talk about with you friends.
Meanwhile 2014's Far Cry 4 attempted to master that which Far Cry 3 achieved, while also
addressing some of its criticisms: notably the balance of having this systemic framework
operating in and around a linear narrative.
The vast majority of this systemic framework is reliant upon non-player character AI: ranging
from the enemies, to the civilians, to allied fighters to the animals that prowl the open-world
maps.
It just needs to know where and when to put them in the world.
See, it's not as simple as just leaving them there until the player bumps into them.
The scale of the world of Far Cry is very impressive: with the Rook Islands of the third
game estimated to be around 300 square miles in size.
That's a lot of ground to cover, and given you would need thousands of non-player characters
within that space to make it interesting, you suddenly have a difficult design problem
to solve.
This leads us to Far Cry's dirty little secret: that at any point in time, the game is only
maintaining active non-player characters within less than 500 metres of the player, with enemy
characters and animals being added and removed to the world as the player moves around.
This is highly pragmatic, given that leaving large numbers of characters in the game at
once is highly expensive: we'd be wasting not just memory to store these NPCs, but potentially
CPU cycles if we continued to update the state of the AI in these characters during play.
We're not interested in whether a tiger decides to attack a gazelle miles away from the player:
because put simply, if the player doesn't see it, it didn't happen.
The non-player characters or NPCs within the game are designed to react and behave in a
context-driven fashion: to attack, evade or explore areas of the map based on what's happening
around them.
This is driven by finite state machines, a topic we've covered at length in our videos
on First Encounter Assault Recon and Batman: Arkham Asylum.
Many of these NPCs, be they enemies, civilians or animals, are designed to react to neaby
stimuli in an appropriate fashion.
Their responses are reliant upon a rich navigation mesh that is embedded into the game world,
with some smart object nodes placed in areas of interest that can trigger specific animations.
While they know how to react intelligently, it does not factor whether any other characters
are in proximity.
In fact, enemy NPCs are rather limited tactically, which becomes more apparent when you play
the likes of Far Cry 4 in the online co-operative mode.
Despite this, they're still a cracking shot and a separate damage director system managed
their shooting capabilities based on the number of NPCs in the scene so that you don't get
insta-killed by six headshots from 100 metres away.
In order to maintain decent performance, given that these games not only has to run efficiently
on PC but also between console generations, the director AI is enforces constraints on
the number of systemic elements that are active at any point in time.
This includes the number of enemy NPCs, but also animals and items such as vehicles given
the additional computational load they bring with them.
In fact, in Far Cry 3 the numbers are really limited: with only 12 NPCs max in the world
at once and up to 20 animals, with vehicles also limited to around 2 or 3 types at any
point in time.
The relevance of these characters are measured frequently: with the director moving or deleting
characters if it's apparent they're too far away and won't ever catch you.
If you're running in a particular direction, the system will spawn enemies in front of
you: factoring not only your heading but your current speed: thus ensuring they don't just
pop-up in front of you.
This system was enhanced for Far Cry 4 to become to create more interesting and varied
events.
Placing the NPCs in the world is one thing, but placing them in specific configurations
related to one another can result in the player becoming involved in more engaging experiences.
As such, Far Cry 4 introduced a dynamic encounter method that procedurally create events within
proximity of the player: such as enemy NPCs in combat against Kyrat's wildlife.
This pays attention to your current objectives, sometimes putting them in the way, or focusses
on completed tasks, like having a recently captured output come under attack again by
the local militia.
The use of dynamic director systems has become increasingly popular for open-world game environments:
with titles such as Saint's Row IV, Titanfall and The Witcher III all adopting these in
some fashion or another, with their own unique design problems to solve.
But this isn't the only innovations that the Far Cry series continues to make, with the
more recent entry Far Cry: Primal, introducing companion AI in the form of tamed animals.
This is in fact an extension of the AI system used for the tiger companion in the Shangrila
sequence of Far Cry 4.
We'll be back at a later date to talk all about how that works in lots of juicy detail.
With that we're rounding up on this video, I'm Tommy Thompson and this has been AI and
Games.
Thanks for watching and don't forget to like and subscribe for more AI goodness and Scottish
disquisition!
See ya next time.