Reader small image

You're reading from  Practical Game AI Programming

Product typeBook
Published inJun 2017
Reading LevelBeginner
PublisherPackt
ISBN-139781787122819
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Micael DaGraça
Micael DaGraça
author image
Micael DaGraça

Micael DaGraça is a professional game designer and interactive creator who works with independent video game studios and creates interactive apps focused on the health and pharmaceutical industries. He studied digital arts at the University of IESA Multimedia, Paris, and ESAD Matosinhos. He started his career as a project manager in a small studio and then gradually started working as a game developer by helping other studios to develop their games. More recently, he has been creating interactive content for the pharmaceutical industry.
Read more about Micael DaGraça

Right arrow

Chapter 10. Awareness

In our last chapter, we will be looking at how we can develop AI characters that use tactics and awareness to accomplish their goals. Here we will be using everything that we have explored before, understanding how we can combine everything together to create artificial intelligent characters that can be used in stealth games or games that also rely on tactics or awareness.

Stealth sub-genre


Stealth games are a very popular sub-genre where the main objective of the player is to use stealth elements, being undetected by the opponents in order to complete the main goals. Even being a genre that is widely popular in military games it is possible to see this sub-genre being applied in almost any game. If we take a deep look, any game where the enemy character is triggered by noise or vision of the player, is using stealth elements. This means that at some point or another, having awareness or even tactics implemented on our AI characters can be very useful regardless of the game genre that we are working on.

About tactics


The tactics is the process that the character or a group of characters take in order to achieve certain objectives. It usually means that the characters can use all of their abilities, choosing the best ones depending on the situations, to defeat the opponent. The concept of tactics in video games is to give to the AI the power of decision, making him behave smartly while trying to reach the main goal. We can compare this to the tactics that are used by the soldiers or police officers in order to catch the bad guys of the real world.

They have a wide array of technology and human resources to catch a bandit, but in order to accomplish that task with success they need to choose wisely what they are going to do, step by step. The same principles can be applied to our AI characters; we can make them choose the best options available in order to accomplish their objective.

To create this, we can use every topic that was covered before in this book and with that, we are able to develop...

About awareness


One very important aspect that correlates with the tactics is the awareness of the character. Some common factors can make part of the awareness of an AI character such as audio, vision, and perception, for example. These factors are inspired on the human features that we all have, vision, audio, touch, and perception of what is happening around us.

Therefore, what we are looking for is to create artificial intelligent characters that can process all of that information at the same time that they are doing other things making them aware of the surroundings, making better judgment of what decisions should be taken on that given moment.

Implementing vision awareness


Before starting out with the tactics, we will take a look at how we can implement an awareness system into our characters.

Let's start by implementing a vision awareness into our game character. The idea is to simulate the human vision, where we can see very good at close range and not so good when something is really far away. Many games have adopted this system and they all have differences, some have a more complex system while others have a basic one. The basic example can be found especially on a more juvenile adventure game such as Zelda - Ocarina of Time for example, where the enemies will only appear or react when you reach a certain trigger zone as shown in the following screenshot:

For example, in this situation if the player goes back and exits the enemy trigger zone, the enemy will stay in an idle position, even if he is clearly able to see the player. This is a basic system of awareness and we can include it in the vision section.

Meanwhile, other...

Summary


In this chapter, we unveiled how stealth games work and how we can recreate that same system so we can use it in our games. We went from a simple approach to a complex one, allowing us to decide what fits better in the game that we are creating, if it relies heavily on stealth or if we simply need a basic system to make our character detect the player by vision or audio awareness. The features that we have learned in this chapter can also be expanded and used in practically any example that we have created before, amplifying the collision detection, the pathfinding, the decisions, animations, and many more features, turning them from functional to realistic.

The way we create games is constantly updating, every game published brings a new or different method to create something, which is only possible if we are willing to experiment and blend everything we know, adjusting our knowledge to achieve the results we want to even if they look extremely complicated. Sometimes it is just...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Practical Game AI Programming
Published in: Jun 2017Publisher: PacktISBN-13: 9781787122819
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Micael DaGraça

Micael DaGraça is a professional game designer and interactive creator who works with independent video game studios and creates interactive apps focused on the health and pharmaceutical industries. He studied digital arts at the University of IESA Multimedia, Paris, and ESAD Matosinhos. He started his career as a project manager in a small studio and then gradually started working as a game developer by helping other studios to develop their games. More recently, he has been creating interactive content for the pharmaceutical industry.
Read more about Micael DaGraça