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 3. Production System

In this chapter, we'll be talking about different ways to perfect our AI character and how to adapt the same techniques to work on different types of game that we want to create. We'll also be discussing the following topics:

  • Automated finite-state machines (AFSMs)
  • Calculating chance
  • Utility-based functions
  • Dynamic gaming AI balance

After exploring possibility and probability maps, we need to understand how to use them in conjunction with other techniques and strategies to create a well-balanced and human-like AI character. Possibility maps or even probability maps can be used alone to create enjoyable and challenging games; in fact, many video games only relied on maps, and kept with the same approach in order to create their AI enemies, and they became very successful doing it that way. A perfect example would be a generic platform game, such as Super Mario Bros from Nintendo. They don't need to create a complex AI system in order to make enemies challenging and...

Automated finite-state machines (AFSMs)


As we observed in the Super Mario Bros example, enemies know how to react no matter what position they are placed in. Obviously, it is not required for them to perform complex tasks or plan ahead what they will do, but it served perfectly as an example, especially when compared with other video games with different genres. For example, we can see the same principles being used on Halo with the Grunts (the small enemies). They simply move from one side to another and if they find the player they start shooting at him. It's the same principle, where they simply added a personality to their character that would run away every time they lost the combat against the player. For that, they used a statement where, every time the character is below a certain number of HP, they start running away. FSMs are what we used to create our possibility and probability maps; this is also what the character should do in different situations he is facing at the moment...

Utility-based functions


Now that we know how to calculate chance and use AFSMs, it's time to explore them a little more and make our characters look smart. This time, we'll use an AI character that is set to behave autonomously in a simulation game such as The Sims. This is a perfect environment to test artificial intelligence because it mimics real-life needs and choices.

In the video game The Sims, the player has the opportunity to control a human-like character and the main goal of the game is to make sure that the character is always in good situations and that their personal and professional life is always on a positive note. Meanwhile, time goes by, just like in real life, and the character gets older until he finally dies at the end. The player is responsible for the life of that being but if the player doesn't give any orders to the character, he will react autonomously to fulfill his needs. It was revolutionary the way that an AI character could behave in a video game; people could...

Dynamic game AI balancing


Another interesting and very useful topic to learn about AI development is game difficulty. If we play against a human player, the difficulty of the game will solely depend on the experience of the player that is playing against us. If they are very skillful with that specific video game, obviously they will have a greater advantage against a player who is just starting the game. Usually, video-games tend to increase the difficulty step by step, so the player can adapt to it and doesn't get frustrated too soon or simply bored because the game doesn't offer a challenge. Dynamic game difficulty balancing is used to solve this problem, by creating an interesting experience for each gamer. To balance the AI character using this method, we take into consideration some dynamic game elements that can be adjusted according to player experience; those attributes can be the following:

  • Speed
  • Health
  • Magic
  • Power

Usually, we use these attributes to define the difficulty of the AI...

Summary


In this chapter, we discovered how to create AI characters that make their own decisions no matter where we place them by using AFSMs. Then we learned how to calculate chance and how to use it in conjunction with the previous techniques to create a character that could calculate a better option for his next step. Using all of the the set techniques, we moved on to how to use utility-based functions to create a human-like character that can behave autonomously. Finally, we talked about different ways of adjusting the values that we input in our characters to make them balanced compared to player performance. In the next chapter, we'll be talking in depth about environment and AI, taking into consideration different genres of video game and different types of AI, how the AI should use the available space on the map to create a challenge for the player, how to interact with the environment, how to use the environment in its favor, and a lot more.

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