The Evolution of AI in Games

Original article was published on Artificial Intelligence on Medium

Photo by Kirill Sharkovski on Unsplash

Remember the iconic 1980’s classic, Pac-man? At face value, it would be easy to assume that you’d struggle to find a more basic concept. Though under the surface, AI was playing a massive role in video games, even then.

The AI would abide by algorithms constantly running to ensure that ghosts were always moving on the most efficient route towards their goal. This was through a grid-based algorithm that is commonly seen in 2D platformers to this day. Not to mention considerations such as break periods in chases for the player to catch their breath. Then the frantic and relentless chasing that occurs when there are only a few pellets left. If you want a more thorough look at Pac-man’s groundbreaking AI be sure to look here.

Why is this relevant though? Well, these rudimentary AI considerations were being employed in the 1980’s. So it poses the question. What is AI capable of in 2020?

Throughout this article, we aim to dive deep into the current state of AI and its role in shaping game design, QA, community management, live operations and game engines. So join us as we explore the exciting and innovative world of AI.

Game Design

The last two decades have seen developers strive to include new forms of AI in their products. Through this inclusion, their games are often given more realistic functions to immerse players, options for more emergent gameplay and more streamlined and enjoyable experiences.

They may not have been the most intelligent conversations but they were the first real example of naturally occurring NPC dialogue — Image source

The most prominent examples of AI being used in game development throughout this time would be TES: Oblivion and Radiant AI’s driven dialogue system or No Man’s Sky’s procedural generation approach to world-building. Oblivion’s system would have NPC’s interact with each other naturally. Sparking up conversations with each other if passing on their daily routines. These routines also varied depending on the day and conditions, mixing it up from the normal RPG staple of the time which had NPCs fixed to one area with little presence other than to serve the player in their goal.

Perhaps the most ambitious AI mainstream gaming to date — image source

While the latter would create an almost infinite space filled with unique planets to explore through learned general asymmetric neural networks. Players would encounter a seemingly infinite amount of unique areas and creatures on their travels, none of which were handcrafted by the developers but instead, machine-generated through a series of complex rules.

This approach is also used by A website using GANNS to create a completely procedurally generated face through a database of countless facial profiles. Then the AI system is tasked with creating a completely unique facial structure for anyone who visits the site. Seeing it in action even proposes the question, will big-name developers embrace this idea to help generate in world NPCS with completely unique assets?

Watch Dogs: Legion looks like a promising title with AI taking centre stage — image source

This approach of making NPC’s autonomous within game worlds is one that has been embraced by a number of studios. One being Ubisoft with their upcoming title Watch Dogs: Legion. Within this title it is proposed that all NPCs will be playable characters. They will all have unique abilities and backstories. Meaning that there is no main character. The player is in control of an interconnected string of characters. So for this to work, world-building, AI and interconnectivity of in-game assets need to be at such a high level. We know very little else about Watch Dogs: Legion at the moment. Though it seems like a fascinating and ambitious project with AI at the forefront.

RDR2 has some of the most intricate and immersive AI on offer at present — Image source

Then a title that is already available to the public that showcases excellent NPC AI is Red Dead Redemption 2. This title takes the building blocks built by Bethesda and their Radiant AI, then stacks them sky-high. Rockstar within this game would include nuanced NPC reactions that changed with context, such as reputation, alcohol consumption, location or clothing to name a few factors. Then there is the immensely realistic physics, audio and the attention to detail for each NPC. Due to the sparse and open nature of the environment with few encounters, each NPC must be recognisable and believable. So it’s truly commendable how Rockstar uses AI as a tool to achieve this so successfully.

Through these inclusions in popular titles, it’s clear that AI is being considered by many studios as a tool to aid design. However, new and innovative ideas are continuing to sprout from the mind of talented AI specialists. One of which is Matthew Guizdal.

AI aficionado, Matthew Guizdal — image source

Mathew is a strong believer that AI is the future of gaming, therefore he champions AI and is even creating games solely through AI programming.. To do this he has created an AI system called Angelica. This system is being taught how to build games through positive and negative reinforcement garnered from let’s play Youtubers. Then using this information to create very simple but completely AI formed games with no developer input.

These games range from simple platformers to conceptual gravity games, to games that use a method called combinational creativity. Taking two known entities and creating a new unique game. This can be best showcased through his completely AI formed game, Snakebird. Which takes the mobile game classic snake and combines it with a new unique twist. If you want to give it a try, you can do so for free here.

You can also get Snakebird via the app store — image source

Game design has seen a number of improvements and interesting projects take place with AI front and centre. Though there are many other areas that studios have used AI to not just to innovate and add to their titles, but also to tackle potential pitfalls and negatives within their titles. One such area of focus is community management.

Community Management

This can be seen through Rocket League to protect players from cursing. The text filter AI will block set words from being shown on screen. This is perhaps the most basic recent form of this move towards automated controlled community output.

Microsoft has also created a custom text filter system that has been rolled out to their Xbox One’s chat services. Meaning that players can control exactly what kind of message that they receive. In the age of the ‘toxic gamer’, this can be a blessing to any gamer looking to avoid any negative engagement.

Additionally, UK company Spirit AI is also developing an AI that can be installed into gaming hardware called Ally. It’s main goal being to analyse all messages received when playing online and be able to intervene. Doing so through informing the player that they may be subject to online harassment and suggesting actions to combat this. You can find more information on their product here.

A massive innovation for community management through AI — image source

Through these management tools, many games that have gone gold can utilize these to ensure their communities are as wholesome and inviting to new players. Though this can often prove more of a challenge for live service titles due to their ever-changing nature. The aforementioned tools do aid tremendously in managing communities, however, there are many other areas that live service game developers must consider.

Live Operations

One aspect that must be considered when implementing AI into live operation games is how this will affect players wellbeing. This is most closely linked to monetizing the content, usually through microtransactions. Mobile game developers have been investing in AI to help improve Microtransaction revenue. The AI’s goal is to be able to identify, retain and incentivise white whales to purchase more from their in-game marketplaces.

This is the title in question — image source

This was an AI tactic implemented in Yodo1 and Space Ape Games’ product, Transformers: Earth Wars. Kotaku initially reported that a player had managed to spend $150,000 within the mobile title. This revelation would lead to CEO of Yodo1, one Henry Fong, to publicly speak about automation. Henry suggested that his whale targeting AI had a 87% accuracy after only fourteen days of learning. Also, he believes that they will raise this to at least 95%.

Yodo1 CEO, Henry Fong — image source

Through this, it clearly showcases the ability for companies to successfully use AI to aid in increasing revenue within live service titles. Considerations must be made by companies as to how they can protect these player’s wellbeing, how the media may perceive this approach and how they can implement this AI system while still abiding by all laws and guidelines in place to protect the players information and general wellbeing.

Moving on to the idea of developers aiming to improve retention in live service games. Often, matchmaking is an area that players have no control over when playing games. Which can sometimes lead to frustration and therefore, a drop off in the player base. So for this reason, developers have been implementing AI into online matches in the form of bots. This is a tactic that has been rolled out in Gears of War and Call Of Duty titles in the past. However, this is becoming more of common consideration. Especially in live service titles.

Fortnite is a prime example to show how this is beneficial. As it enters its eleventh season of live service, players beginning their time with the game are in for a tough time. With a very well populated competitive scene and steep learning curve to even be adept at the title. Players will find themselves dying over and over, before eventually giving up due to frustration.

Bots are coming to Fortnite in the hope of increasing retention of new players. — image source

This is where bots come in. With usernames that will be generated by an in-game system and a reasonably realistic but relatively lower difficulty. Players will find that they get kills in online matches here and there. Allowing them to feel a sense of fun and accomplishment and ultimately, want to keep playing the game.

Automated testing has become a more common tool in the gaming industry as well, especially within games that are live service titles. With a well taught and refined automated system. It can cut the time and financial strain that conventional playtesting brings down to size. Plus it acts as a by-product of QA. Allowing for more frequent and clear feedback. Meaning that more time can be spent on content and creative design.

This has been implemented most commonly in match-three mobile games such as King’s Candy Crush Saga. Through a system invented by Stephan Gudmundson and company. King has been able to up the production of new levels in their title. A game that now boasts over 3700 unique level variants for players. With fifteen new levels being produced a week with minimal developer input. Meaning that the game is somewhat self-sustainable.

Though these innovations from King do aid the speed in which new content can be developed and made available. It does not completely negate the need for quality assurance. The needs of the consumer are ever-changing and therefore the success of their system is tied to their ability to test proactively and engage with their players. With that in mind, let us explore the most innovative AI centred QA innovations to date.

Through innovative AI, Candy Crush Saga’s level development is self-sustainable. — image source

Quality Assurance

When it comes to quality assurance or QA of games, automation is becoming more of a consideration. Developers are beginning to see the benefits of AI as a means of freeing development staff to improve games, rather than firefight and fix bugs. This approach is being championed most prominently within live service titles.

Due to these titles never truly ‘going gold’ as development is an ongoing process. To ensure that changes don’t affect or break existing assets is essential. Often this will require long periods of maintenance periods where players will not be permitted online access. Plus the effects of the bugs or issues being present and recognised in the game. Often reflecting negatively on the title as a whole until the community managers report the issues to the development team.

Rare Studio’s would employ TDD to aid their QA process. — image source

However, a technique once thought as a laughable method, test-driven development or TDD, has become a popular QA tool. A more notable example of a title that has benefited from its use is Rare’s Sea Of Thieves. Rare opted to use this method to test all the polished functions that are in the game every twenty minutes. So through this method, a developer would be aware almost immediately of an issue, what was broken and what had caused the bug.

Jenkins is perhaps the best hardware out there to ensure your studio is working at optimum efficiency and productivity — image source

This approach to constant testing of builds is something that is valued by a company called Us Two. This studio developed a build pipeline that essentially streamlines QA testing. The most interesting offering from the hardware is its ability to test all assets of a build at sixteen times speed. Automating the process of functional playtesting and ensuring that all assets work properly and won’t be affected by new additions.

Here’s a live example of the hardware playtesting a whole levels assets in quicktime — image source

The hardware they have produced also allows for more builds to be run concurrently and reduces the time taken for each commit to be addressed. They compared their hardware to high-grade competition such as Unity Cloud and found that their hardware was able to cut work times down by 10–20 minutes per commit. Therefore freeing up time for developers to work more frequently on creating assets rather than fixing existing assets. This hardware is called Jenkins. Here’s a brilliant article explaining how it works in greater detail if you want to check it out.

Furyion’s Death Carnival used Unity’s new game simulation cloud service. Image Credit: Furyion

Balance within a title can also be an ongoing concern within development, meaning that QA and testing is required to ensure that players get the intended experience. This can often lead to expensive human testing. However, Unity has produced Unity game balance. This system allows the developers to create parameters, instrument metrics and variables to be considered. Then the software will simulate the gameplay process thousands of times with differing approaches and deliver results that can supplement human testing.

Human testing is ultimately still required, however, it gives studios a better platform to approach human testing and gain more value with less expense due to reduced need for multiple tests. This software is still in beta, however has the potential to revolutionize QA for studios, all through the power of intelligent machine learning. If you want a more in depth look at how this software works, have a look here.

This idea of simulated testing has even been seen in Sony’s Horizon Zero Dawn. This title would use AI bots to roam the open world landscape and record the areas and issues that needed mending. The QA team will still need to attend to the issue but the process as a whole has been streamlined through the simulation. Ultimately, this method frees up the human development team to do work that relates towards creating new improvements without having to worry about completed assets unless needed.

The beautiful open world of Horizon Zero Dawn image source

There have also been advances in AI that aids in QA through Elon Musk’s non-profit organisation Open AI. Through a project that tasked AI agents to play hide and seek on a virtual map, AI has shown it’s scope for highlighting in-game exploits. Throughout the test, in a situation that initially favoured the seekers, the hiding party began to find exploits to win. Such as taking away the step from the seeker to make capture impossible.

Here’s the hiding AI in their impenetrable fortress. Or so they thought. — image source

However, the seekers would have their revenge as the AI would exploit an unplanned mechanic. Seekers would manage to climb and surf on map assets to enter the hider’s fortress. These exploits are something we often see abused in the speedrunning community. See the GDQ expo if you want to see some talented and perceptive gamers. However, through AI, developers may be able to identify these exploits and iron them out before having their games released to the public. Reducing time spent on patches and indeed development as a whole.

With all previous topics showing the tools we can use to help test, design and manage games. It would be amiss to not consider what engines support developers in implementing AI into their builds. So we move onto what game engines on the market currently offer and what unique features they include that promote AI inclusive game builds.

Game Engines

Let’s begin with the Unreal engine. This is arguably the most comprehensive AI supportive engine. The engine offers commonplace AI tools such as navigation meshes and behaviour trees, though does so with startling complexity and detail. An example being the environmental query system or EQS that works in tandem with the behaviour trees. This allows for developers to alter the set behaviours based on situational variables. This might be allies of the player prioritizing enemies with larger health bars or more dangerous attack patterns, for example.

Here’s a snapshot of the Unreal4 engine — image source

Then we move onto Unity and it’s most interesting AI asset, the AI planner. This is akin to the AI seen in Fear. The AI can be shown an abstract scenario. Then the AI will learn how to react in new and optimal ways to deal with said situations. If used for enemy AI, they will perform competent and realistic actions. Much like the enemy AI found in Fear and unlike the AI in Killzone 2 for example.

This is what the AI planner looks like in the Unity engine — image source

The Cry engine also offers a unique AI tool, this being the ability to assign territories or waves to agents. It essentially allows developers to create a bubble or area for combat to occur. Then developers can assign waves of agents to appear. This makes the Cry engine an ideal tool for developers that want to have optimum control of how combat sequences are presented to the player.

Here’s the option for wave and territory assignment — image source

This merely scratches the surface of what is on offer within game engines on the market today to implement AI into game builds.Youtube channel AI In Games gives a in depth run down of all the unique AI tools these engines have to offer Including engines such as Source or Gamemaker’s Toolkit and their unique AI features. So do check out Tommy Thompson’s guide to game engine AI here.

The Future of Gaming?

What can be said about AI in gaming with a good deal of clarity is that developers are beginning to see AI as a tool to enhance their games and improve upon realism, testing, productivity within development and player immersion. There is still a scepticism surrounding the topic, with many developers trusting in their human assets at present.This is perhaps due to the fast pace in which the field of AI is moving, with developers struggling to keep up with that pace. Though, despite the infancy of AI in the industry, it’s clear that it is seeing success in various areas of gaming and with further innovations will come more opportunities for developers to trust AI and implement it into their products.

Testing and QA seem to be the areas where we are most likely to see improvements in the short term. With Google and Amazon investing heavily in analytics, opening up the doors for other companies to follow suit.

We are still some way from an I-robot reality. But we are making big strides. — image source

Though with development in particular, it is rather unlikely we will see AI driven games for quite some time. It will perhaps take a wave of indie developers focusing on AI to great success to change this. As big developers still seem unwilling to loosen their grip, needing full control of what is their final product.

Thankfully though, AI is growing in all industries at an exponential rate. So we can only hope that AI can push the gaming industry from strength to strength.

So that’s our views on AI in gaming. What are your views surrounding the topic? Do you believe that it is the best way forward? Is human intelligence always going to have a place in development? What do you feel is the most amazing AI advancement to date? Let us know in the comments and thank you for reading!