News & Events

How Artificial Intelligence is Being Implemented in Video Games

Source: pixabay.com

Since the creation of computer games in the early 1980s simple artificial intelligence (AI) algorithms have been used to generate maps, terrain and to control the behavior of NPCs and enemies. As AI advances developers are discovering new improved ways to implement this technology into their games. This allows for more challenging game play and credibility for the player’s experience.

No Man’s Sky uses an artificial intelligence program capable of building whole planets and lifeforms to inhabit them.
No Man’s Sky uses an AI program capable of building whole planets and lifeforms to inhabit them. Source: segmentnext.com

Finite State Machines

One of the most common examples of artificial intelligence implanted into video game design was introduced in the 1990s and is known as the Finite State Machine (FSM) algorithm. According to author Harbling Lou, when creating an FSM algorithm, the designer generalise all the possible situations that an AI could encounter, and then programs a specific reaction for each situation. Basically, the FSM AI promptly reacts to the human player’s action with certain pre-programmed behaviour. In a shooting game for example, enemies wander the map patrolling until the human player shows up. Once the human player is spotted the enemies will attack and warn other enemies nearby. Once their own health bar becomes low, they will evade the player and retreat.

FSM oriented game allows the enemy to perform four basic actions in response to possible situations wonder, attack, find aid, and evade. Artificial Intelligence from FSM has been successfully incorporated into popular games such as Call of Duty, Battle Field and Tomb Raider. The only problem with games that use the FSM design is their predictability. All enemy behavior is pre-programmed so after playing an FSM- based game a few times, players may start to lose interest.

Dynamic Game Difficulty Balancing

Traditionally in game design the difficulty steadily increases as progress is made. This is usually through a smooth linear story with steps represented by the levels. Difficulty can only be increased or decreased by selecting a difficulty level. This can be frustrating for the inexperienced or boring for experienced gamers as they must follow the learning curve. Dynamic difficulty seeks to address this issue by creating a tailor-made experience for each individual player.

According to everipedia dynamic game difficulty balancing (DGDB) is the process of automatically changing the parameters, behaviours, and scenarios in a video game based on the player’s ability in real time. For DGDB to work in a satisfying manner it must meet at least three basic requirements. First the game must quickly identify and adapt itself to the human player’s initial ability which can vary greatly from beginners to experts. Secondly the game must closely track the evolution and regressions in the player’s performance. Thirdly it must adapt itself but ensure that the behaviour within the game remains believable. Ideally the player is too engaged in their game play to notice that the difficulty is varying depending on their own performance. The biggest problem with DGDB is in concept of the artificial intelligence (AI) “cheating.” This is sometimes referred to as rubber band AI.

Rubber Band AI

Rubber band AI is a concept found in many sport and racing games. It is to prevent players from getting too far ahead by allowing computer-controlled opponents to drive at faster speeds than the human player can go or by slowing the human player down. In some games such as Mario Kart the computer opponent is even teleport forward if they lag too far behind the human player.

The term is derived from the metaphor of a rubber band being pulled back. The player’s car performance is connected to the AI controlled car. No matter how well the human player performs, it is not possible to leave the computer players behind because the rubber band will tighten after being stretched before forcefully pulling the computer vehicle back up to the player.

When done well the artificial intelligence can maintain a consistent level of challenge from the beginning of an event to the end. However, when done poorly, it becomes evident that the game is bending its own rules. The player is not meant to notice or perceive that the computer is either “letting them win” or “cheating.”

In Mario Kart the computer opponent is even teleport forward if they fall too far behind.
In Mario Kart the computer opponent is even teleport forward if they fall too far behind. Source: bing.com

Artificial Intelligence Creating Worlds

According to MIT Review writer Simon Parkin the text-based adventure game Rogue released in 1980 was the first game to use pseudo random layout generation. This created infinite variations within the game dungeons. Since then advancements in technology have allowed artificial intelligence (AI) programs to provide more than simple map and terrain design, assisting designers in lessening their workload.

Skyrim which was released in 2011, used algorithms which generated simple but unique quests by randomly assigning places, enemies, and a goal. This allowed developers to add hours of extra content within their game, freeing up their time to focus on the main story line.  No Man’s Sky was released in 2016 went even further. It used an artificial intelligence (AI) program which built whole planets, filling them with lifelike creatures which nobody including the designers had witnessed before.

Artificial Intelligence has been successfully implemented in video games to create better NPCs and opponents for players to engage with. It has also been used to assist developers in building and creating games. Increasingly sophisticated machine learning techniques are allowing design teams to build better worlds with richer more believable characters for gamers to enjoy.

Related Posts