L'intelligenza artificiale nei videogiochi: come funziona e perché è importante thumbnail

Artificial intelligence in video games: how it works and why it matters

Lately, We talk a lot about artificial intelligence applied to many aspects of our lives. Of course, we all know, one of the areas where artificial intelligence it is very present it’s video games. We are faced with bosses and NPCs and these are due behave credibly. For us to be passionate about the game, it must give the impression that we are dealing with a sentient being; whether friend or foe.

Seems like a lot already, but that’s not all. Because AI in video games is used to do so many things, not just characters interacting with us.

Attention, we warn you immediately! In There are no spoilers in this articlebut reading it carefully could make you think that will make some games a little more predictable, and therefore less fun.

Artificial intelligence in video games

Let’s start straight away and clarify the most important point.

The AI ​​that is used in video games has little in common with the AI ​​that we read so much about in the press.

A so-called “classic” artificial intelligence (not designed for video games) is a system designed for think as efficiently as possible. He must fill those gaps of ability, memory and speed of reasoning which are the limit of us human beings. This is perfectly fine if we want to design the autopilot for an aircrafto one system to intercept bank fraud. However, it would be a total disaster within a video game.

the end

Imagine playing a video game where you are a soldier and you have to deal with a sniper. Building an artificial intelligence that from two kilometers away, in the dark and with strong winds always hits you on the head is more than feasible; even banal. And this is how a classical AI would be designed. Now, let’s be honest, who would ever play a game like this? As soon as you move an inch you are dead. The game becomes frustrating and you leave it.

Much more epic and compelling to feel the shots whizzing by your temple, take cover at the last second and only get hit if we’re reckless enough to come out in the open for too long. None of you are by any chance thinking about “The End“? One of the bosses in Metal Gear Solid 3?

Choose Amazon Prime for your purchases, it’s free for 30 days

Designed to lose

The artificial intelligence we meet in video games is much more difficult to design of its classic version. Because it has to be educated to make mistakes and lose. Why the hero of the game is us, not her. But not only; must also lose in stylebecause if he gets too wrong we won’t have fun.

Therefore, a designer doing artificial intelligence for video games must design agents that they behave crediblyThat are not (too) stronger than the player and that, at the same time, give the impression of making a great effort to fight us … e in the end I forgive.

Trust me, it’s much more difficult that way!

The right size

As if the job wasn’t hard enough already, good AI in a video game must be quite stupid … but not too much; whether he plays with or against us.

army of two

If it’s too stupid we won’t have fun because it won’t be a hindrance either it won’t help us well enough. An example? How about Army of Two (Electronic Arts, 2008) where playing in pairs with artificial intelligence was not exactly an unforgettable experience.

Equally, though, if artificial intelligence she is too good we will not have fun because either it will be unbeatable or he will do things for us. Who among us remembers Gears of War 3 (Microsoft, 2011)? What did we do when a battle was too difficult? We stood in a corner and waited for our teammates to clear the whole field for us. Simple, but certainly not fun.

Designed to take up little space

Finally, we would like to mention that in video games there are also gods technological constraints. Classical artificial intelligences they have all the memory and computing power you need. When making one for a video game, the designer is given a budget. That is, they are told that it cannot occupy more than certain megs (not giga) of memory e use at most a fraction of the CPU. This is because, however, CPU and memory are also used to do everything else.

Having said that, we feel like saying that, starting today, when we see artificial intelligence that is not exactly perfect, we will have to ask ourselves if it was too difficult to fit it in a small space before saying the designer is not good.

Where is artificial intelligence used in video games?

If we ask this question of someone who develops video games, the answer is “everywhere!”. This is because it is equipped with artificial intelligence anything that interacts with the player in a natural or unpredictable way. It would be very long to list all the possible techniques that can be used, but we can do it some well-known examples.

Calculate routes

starcraft

There are artificial intelligence algorithms that allow you to find the best route between two points on a map. Better could mean “shorter” or even “less exposed” or “passing through the right refueling points”; it depends on the mechanics. In this way, in an RTS type game, such as for example Starcraftwe can do click on the map it’s ours unit arrives there autonomouslywhile avoiding obstacles.

These artificial intelligence techniques, obstacles and maps being equal, have the tendency to always come up with the same path. So, on small maps or without moving obstacles, they quickly become predictable.

To make decisions

eye of the beholder

There are many decision techniques. But they all do the same thing: they evaluate their surroundings and decide what action a character should take. This is the case, for example, of games with turn-based combat, such as the old Final Fantasy or Eye of the Beholder. In these games the enemy evaluates the group of adventurers and, based on stats and equipment, selected the most appropriate attack to use.

Also in this case, other things being equal, the decision will always be the same. Furthermore, in implementations, some elements have a higher importance than others; discovered what they are, become easy to influence a character’s behavior making little effort.

Manage emotional states

A character, if well designed, have different emotional states; quiet, angry, scared, running away and so on. Every emotional state is characterized by a different behavior the one a different path of movement. Even if the emotional states are not many and the behaviors taken individually are quite simple, the end result can be impressive. Let’s think, for example. to the guards in a stealth game, such as the famous Splinter Cell series. The guards could be quiet, standing, on guard or in combat. In every emotional state there were two or maximum three possible actions. If we do the multiplication the combinations are quite limited; but we dare you to say that playing it was boring.

artificial intelligence video games emotional states splinter cell

The trick here is to understand by what rules a character moves from one emotional state to another. Most often this is a player action. In this way we will be able to bring it to the state that is most convenient for us; where, for example, he will make more predictable decisions.

Very often, if we don’t enjoy interacting with a character it’s because my emotional states are few and there is not enough variety in behavior. Obviously, this depends on how long we have to interact with him.

Content generation

Not all AI is used to move or make a character talk. There is a family of algorithms whose purpose is to generate content within the game. These techniques they are by no means a novelty. In fact, one of the first times they’ve been used in a commercial product was for the film.”Tron” … That of the 1982!

In fact, we often prefer to talk about PCG: Procedural Content Generation, or Procedural Content Generation. These techniques are born as algorithms but soon become artificial intelligence as soon as one realizes that the generation of an environment can never be completely random but it must follow a kind of harmony.

generative artificial intelligence video games minecraft panorama

Minecraft maps they are generated by an artificial intelligence; because we rarely find ourselves with a volcano next to a glacier, the mountains (almost) always have a realistic profile and the rivers are all meandering. The same is also true for i cousin Diablo’s dungeon; each time different, but structured in such a way as to be viable. And then, very often, the treasures that we find in games based on the loot mechanics they seem random, but they are always such that they don’t make the game too easy or too difficult. How many times have we said “oh, how lucky! I found a potion and my health is low!”

So, ChatGPT and Bard aren’t for gaming?

On the contrary, they are and will be very useful in the future; because they represent, in our opinion, the new generation of artificial intelligence for video games.

The artificial intelligence techniques that we use today are a lot useful for generating numbers, maps, colors and combinations. However, this is not always enough when you have to interact with a human being. Why it is very difficult to generate sentences. Today, in general, …

Marco Dellapina is a passionate writer who dives into the exciting world of video games. With a deep love for gaming, Marco brings you the latest updates, reviews, and insights on the ever-evolving landscape of interactive entertainment. Join Marco on an immersive journey through the realm of video games and stay up-to-date with the latest trends and releases. Get ready to level up your gaming knowledge with Marco Dellapina's articles.