Sponsored By

An in depth look at AI in games

A deep dive into the multitude of aspects that make up artificial intelligence within the game space.

arne neumann, Blogger

March 25, 2019

10 Min Read

Artificial intelligence has been getting more and more attention over the last few years. One might say it has become quite the buzzword. Most of the hype regarding AI has been directed towards pattern recognizing machine learning programs, that are capable of “learning” and improving themselves by running through huge amounts of previously recorded data, adjusting their diagnosis of objects or situations accordingly or picking the better move during a match. A prime example for this would be the Alpha AI, which has been trained to beat the world’s elite at their own games, as, to name a few, Chess and Go. There even is a documentary called Alpha Go describing the AI’s ascension to the world’s premiere authority, beating first the European champion, then going on to defeat the world champion who’d previously destroyed all his human opponents for years in a row.

The other commonly known form of AI is, specifically within video games, behavioral of nature. A great example here is the behavior tree based actions of the robot dinosaurs in the massively popular title, Horizon Zero Dawn by the Dutch company Guerilla Games, an interesting article about the topic can be found at Gamasutra

With this type of AI, the functionality of the program/algorithm is oriented towards queueing behaviors of actors within the game environments, based on indicators within said environment. The dinos in Horizon generally run around in herds and act according to triggers they encounter, fulfilling type specific roles. Without going into too much detail, it’s a complex system of actions that are depending on predefined values and interdependent factors that seem dynamic and intuitive when encountered by the player, yet these behaviors follow a strict guideline and there is no deviation from this ruleset whatsoever, i.e you’ll never have any of the animalistic machines approach the player and beg for a bag of plant matter for bio conversion purposes nor will they demand to be pet. The trick here is to arrange the behaviors in such a way, that they never seem out of place, regardless of the systemically intrinsic preconditions and limitations.

Perceived behavioral complexity and naturalness are the key to creating a convincing illusion of being in a different world or participating in a lifelike interaction. In Watchdogs 2, for example, a deep behavioral tree dictates the actions of enemy AI within the game during combat scenarios, as nicely demonstrated in this video: GDC . This specific tree isn’t flawless; depth and layers of possible situations and environmental hurdles leave room for some perceptibly unnatural or plain weird behavior exhibited by AI agents during close quarter situations in relation to how this specific system implements queues and triggers actions i.e searching for cover options without considering height differences, resulting in what could only be described as suicidal fanatism under different circumstances. Nonetheless it’s a credible and sufficiently convincing representation of a real world scenario to have the player accept it as “real” suspending their disbelief to a degree, while still acknowledging the fact that the player is interacting with a piece of digital entertainment, not a realistic simulation for training purposes.

Another noteworthy, yet technically unrelated to AI aspect of creating a convincing and engaging situation or storytelling moment in video games is scripting and branching dialogue. Just like behavioral trees in AI, player decisions will trigger scripted sequences that could be related to immediate choices within the dialogue itself or executed based on previous player decisions i.e the player having given the cousin of the current conversational NPC some food previously and the NPC reacting to it based on the “has given Annie a sandwich” box being checked within the game’s system.

It should be noted that none of these actions are immediate, situational or reactionary in the typical sense, they’re all predefined and scripted, yet mixed with other elements of the framework they help create an idea of a living creature on the other side of the interactivity. A great example of this mix is a side quest in the game Red Dead Redemption 2, where the player finds secret notes on walls, eventually leading her to a place where a “vampire” of sorts is encountered and must be dealt with. The internet has already produced a huge variety of videos pertaining to this particular gameplay snippet, with players trying all kinds of interesting stuff, to see all the things the vampire NPC will and is capable of doing.  Intrinsic to human nature, a fair deal of boisterous hilarity ensues, yet once poked enough, the relative shallowness of this character comes to the fore. Since he *spoiler alert* isn’t really an actual vampire he can walk through the sunlight, for example, and will do so, if, say, the player chooses to lasso him, carry him on horseback until dawn and then sets him free. He’ll walk around town and run away from the player if encountered, sit on park benches and just generally be a pale looking guy with long fingernails, but due to behavioral and asset limitations, he won’t go back to his creepy little lair on a graveyard to suck on dead rats, because that place doesn’t exist within the game.

This very fact is likely not going to cause much uproar within the gaming community though, considering the vampire quest is an optional little bit within a huge game world that already is going to be unnoticed by the majority of players, but for those digging deep enough, there will be the inevitable “this is a robot” moment.

Again, the trick here is to keep as many players as possible from ever encountering their robot moments unless a reality check is intended to remind the player they are still sitting on their couch and not actually running through that beautifully rendered forest with the nicely recorded bird chirps and the leaves bristling in the wind.

Pattern recognition or machine learning AI is currently sparsely implemented in video games but it’s getting traction due to the success of the principle mechanism applied to other fields, a possibility space here could be the addition of unexpected/not strictly programmed behavior within a game where the AI would learn to add new actions or vary existing behaviors based on data collected during previous gameplay sessions.

This specific toolset lends itself better to games that naturally allow for or even require repetition of actions, the rogue-like genre, for example. The player here will willingly encounter often procedurally generated yet samey environments, repeating actions countless times, killing the same fire goblins hundreds of times, having memorized their every move to a point of almost perfection and only doing it for the often systemically recorded progress that is kept even after player death, that may occur often, as rogue likes aren’t easy, generally speaking.

Now the player could be presented with the fire goblin doing something after 50 encounters he’s never done before, because the system has gathered enough data to create a varying output, hence adding to the already huge replay value of those types of games.

For other games of generally strict and linear nature, such options seem far-fetched at this point, as hardly anyone wants to play through Assassin’s Creed Odyssey 20 times, just to get one of the Spartans to try a new move. But maybe some interesting algorithm could be implemented, like a collective Spartan knowledge pool that lets soldiers learn from previous encounters.

There’s also AI assisting with procedural generation of content for games, like ANGELINA which creates games by itself based on pop cultural references or a predefined visual style. There is still much left to be desired when it comes to the comparative quality of a handcrafted tailored experience vs. a random patchwork of news bits clamped together on top of some neat 8bit platformer art, but it says a lot about how far the topic has evolved over the last few years alone.

Going back to oldschool arcade classics such as Pac-Man (not considering PONG here, unless there is a newer version with single player mode), even back in the day AI was present in the shape of programmed ghosties, behaving according to their rules, trying to catch the Pac-Man in the back before he eats them. As simple as those algorithms seem they provide a clear indication to the considerable value addition AI provides to any type of virtual interactive gaming experience, not necessarily as a mandatory ingredient to creating a great experience, yet considerably valuable when depending on the creation of structured behaviors of NPC’s and other in-game objects.

AI also is represented as a key component in the wildly popular TV show Westworld,

where the rich in a not so distant version of the future enter a giant theme park filled with life like humanoid androids to engage in adult activities and murderous adventures with them. The philosophically interesting topic here is the fact that those robots have a daily routine memory wipe along with physical repairs, which lets them forget all the previous activities, keeping them in a state of relative innocence, yet some of the androids experience glitches and begin to remember things despite the deleted memories.

Obviously this scenario is as close to a perfect simulation and wish fulfillment as anything can technically get, apart from the glitches, and far beyond what any video game is able to generate at this time, but it gives an idea of possible considerations to be made, the uncanny valley comes to mind and the general idea of video games being nothing more than digital entertainment, nothing close to simulations.

Looking at the future of classical game AI, it would be conceivable for trees or other structural models to gain a lot of complexity enabling a larger variety of more nuanced behaviors as hardware becomes more powerful and backend services like the cloud enable additional data to be stored and processed without the user having to run it client side. So, Horizon Zero Dawn ll might add a considerable amount of new robotosaurs, that may exhibit deeper strategies, like tracking the player in real time for a prolonged period or scouting the player, then organizing an ambush and so on.

Another option would be the inclusion of text speech recognition within a games dialogue system to enable more meaningful, individualized player specific story content based on machine learned dialogue output that could theoretically also enable a more diverse output from the player based on referential material. Taking into account the current state of AI created content, and how it drastically fails to bridge the gap from the abstract to the relatable, as nicely demonstrated in the interesting yet bewildering AI generated Magic the Gathering cards by Roborosewater, that still seems at least a few years out, but it’s an enticing prospect for future story heavy space exploration games and other such titles.

 

Conclusively I’d like to point out the increased importance of AI when considering video game creation and the perceived value of a game that features a “strong” AI at the time, as it’s something that is connected to the idea of something cutting edge and groundbreaking, just like VR was a few years ago. AI certainly isn’t going to stop improving nor is it going away, but it’s likely going back to be a more integrated component of game development instead of a feature word on video game box art. Then again, maybe Skynet.

 

Read more about:

Blogs

About the Author(s)

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like