Fighting with a Slots Shine Casino computer enemy, you often imagine him much smarter than he actually is. However, it is worth noting the oversight, and the illusion is scattered, because even masterpiece artificial intelligence is not a mind, but a cunning camouflage of its absence. In general, you are not here Westworld.
We will talk about the best AIs met in computer games.
False Jidiles
The phrase "artificial intelligence" sounds weighty and even sublime. Something mysterious and incomprehensible, which the real programming guru is working, owning secret, almost mystical knowledge. They give the car the ability to think like a person!
However, game AI is just a set of rules and algorithms. Sometimes complex, sometimes not very. Take the game as an example "Him" , in which two alternately take objects from piles. Or crossbars. In both cases, the program comes down to a simple algorithm: the computer alternately calculates all possible moves, and then chooses the most profitable.
The game of a computer mastered with much greater difficulty than chess. This became possible only thanks to the latest successes in the field of neural networks.
The usual games for us, for the most part, have gone nearby. Say, for real -time strategy, the most difficult part is an algorithm for finding a path. So that every unit can move and bypass obstacles, the computer continuously calculates hundreds of route options and selects the shortest.
But what about opponents? They seem overmo -end mainly due to artificial advantages in resources and the ability to manage the entire economy at the same time, the rest is a set of rules like attacks by waves and sequence of building buildings. Experienced players know well about this and invariably find weaknesses.
Nimrod is one of the first computers with a graphic interface. Resolution of its "display" – 4 at 7 points, that is, 28 bulbs.
We remembered about "him" for a reason – the program that could participate in it was the first game in history. It was made in 1951 and launched on the Nimrod computer developed for this business: “The electronic brain that works faster than the human!" – the advertisement read.
Despite the modest initial opportunities, artificial intelligence entered the games almost from the very appearance of computers – it is much easier to teach the machine to interact with people as part of a rigidly given rules than in the real world.
Mind in objects
As an example of the game with interesting AIs often lead The Sims, After all, in order to portray people's everyday life, the computer must probably think as a person.
We see a character who gets out of bed, goes to the toilet, brushes his teeth and has breakfast. But in fact, Sim does not make any decisions, the surrounding objects "think" for him. Dental brush, toilet and refrigerator “advertise” themselves: they are equipped with records of improving different characteristics. Food will make up four units of hunger, the sink – two units of hygiene, visiting the toilet – three units of the bladder.
It seems that Sims are thinking about something all the time.
The game multiplies each of the indicators by the appropriate needs of the character and counts everything to the glasses of happiness: the longer this did not go to the toilet, the more happiness will bring him a room for thought. The registered personal preferences and the distance to objects are taken into account. Social life is built on the same principle: when one of the Sims “becomes bored”, he will come to chat-make up for the need.
To better imagine this algorithm, the creator of Sims Will Wright offers to imagine the “landscape landscape”: the surface on which the height means the amount of happiness obtained on it. The character chooses any of the nearest hills and uses the subject beckoning him. When the need is satisfied, the hill is smoothed out, and Sim moves to the conquest.
Girl or refrigerator? Perhaps the refrigerator!
Hunger is thickened, it's time to communicate – Maslow's pyramid in action.
Sometimes wards begin to create outright nonsense – all because the developers deliberately laid the flaw. The algorithm takes the upper part of the list of the necessary actions and chooses from it randomly: Sim can sit on the TV, ignoring the calls of the bladder. If the characters themselves coped very well, it would not leave work for the player – sometimes II have to deliberately spoil.
There are a lot of “background people” in Simcity (2013), but here, unlike Sims, they are completely devoid of intelligence: they simply go to work and vice versa, just as water and electricity enters the houses.
Neurons and Norns
Sometimes developers are trying to create AI that would really simulate the work of the human brain, but there are units of such examples. The most famous of them is a game of pets, called Creatures.
In 1992, British scientist Steve Grand decided to try himself in the development of commercial software. He offered potential investors the idea of a virtual pet – a mouse that would live on the Windows desktop. She had to gradually study new tricks thanks to the inherent neural network.
Norns in Creatures have to master a big and beautiful world.
Later, the idea turned into a full -fledged game about virtual characters – Norns. Fluffy creature hatches out of the egg, and a person should help him know the world: to teach every word, repeating it many times and showing what it means, and also force to perform the simplest actions, encouraging good behavior. Nevertheless, the Norn often forget the lessons and make mistakes – this is a huge achievement of developers.
The artificial intelligence of each pet is based on a neural network of a thousand neurons, divided into clusters. Each cluster performs one of the tasks: feelings, focusing attention, memory and decision making. Norn associate actions with encouragement and punishments and make generalizations based on previous experience, which helps them act in the new conditions.
General diagram of the nor.
Norns behavior is regulated by the same hormones as living creatures, so they can crave communication and entertainment, as well as to feel pain, hunger, fatigue, and so on, all this affects the balance of the chemical elements of their blood in a special console.
Each action has to be interpreted many times.
This was the fourth part of Creatures, but it didn’t reach the development.
There are other examples of how artificial intelligence depicts a pet with complex behavior: remember giant animals from Black & White, puppies from Nintendogs or a norious cico from The Last Guardian. However, imitation of development and training is still a rarity.
Everyone complained about the whims of Triko, but do real pets behave like that?
Outside the computer games industry, there are scientific projects of real simulation of living creatures. Within the framework of the project OpenWorm (in the pictures), scientists recreated the physical model of the body of a round worm with three hundred working nerve cells: in a virtual environment, the worm behaves the same way as he would behave in life. And resonant Human Brain Project , in which the European government has invested a billion euros, trying to recreate the human brain in the car. True, so far it is very far away.
The smell of fresh corpses
Until now, we have discussed quiet and calm games. How about the jokes? In them, AI should make decisions not just on the go, but on the run. And let computer opponents grow and do not grow here (the life expectancy of their life is most often measured by seconds), but they should be worthy of competition to a person. Or at least not seem too stupid.
Wolfenstein 3D
In early shooters like Wolfenstein 3D And Doom With artificial intelligence, everything was simple: the monsters turned towards the player, fled to him and shot as soon as he enters the room – that’s the whole algorithm. IN Quake Their behavior has already become complicated enough to begin to criticize the game for bad AI.
Om-non!
The first joker, deserving in this regard, was Half-Life. There were friendly characters, and battles that did not depend on the player’s participation, and other non -trivial things. To make the world living and mobile, developers from Valve I had to write a huge number of scripts. For example, it was recently discovered that the characters and monsters in Half-Life have an sense of smell: a fresh corpse emits the smell for thirty seconds, and if, for example, Bullskwid wanders nearby, he will certainly come running. People, passing by, will notice that it doesn’t smell very.
Enemies Master Chif
The truly interesting behavior of computer opponents appeared in the game Halo: for example, when the leader of the detachment dies, his assistants can realize that the matter is bad and scatter. In addition, they try to act together, even call each other to help.
IN Halo 2 The social life of the Covenant soldiers has become even more difficult thanks to the system, which allows opponents to enforce each other. It works approximately as in Sims: AI of one character interviews the rest, are they ready to help, and they agree if they are not busy. For example, a little man sees a passing car and asks the driver to pick him up. The same applies to dialogs: if two soldiers look at one thing, they will begin to discuss it.
It turned out that predictability is very important. “If I get up to the infantryman and suddenly attack him, I can expect him to get scared and run away. It will be wrong if he runs away only in half of cases – this will prevent the player from making plans. We decided that the actions should be predictable, and their consequences did not. The infantryman will always run away, but where exactly he will run away, the player does not know, ”says Chris Butcher, a programmer responsible for AI in Halo.
Even more interesting behavior is demonstrated by the army of devilishly cunning cloned soldiers from F.E.A.R.. Contextual information in the AI of enemies allows them not only to act together, but to cover each other, hide behind shelters like tables and bookcases, open doors, knock out windows, and so on.
But even the most intricate AI in shooters is smart only at well -thought -out levels. A considerable part of the "brain" of opponents is again laid down: level designers prescribe the places and points of shelters that are advantageous for shooting and points. And of course, when testing, cases are revealed when the enemy chooses an unattainable target and grows sadly against the wall. Here is such an intelligence!
F.E.A.R.
Developers come up with more and more beautiful methods to make us think that we are dealing with an equal enemy. In a computer schedule, such a deception is called “smoke and mirrors”, and just as real optics and physics cannot be within the power, it cannot recreate the intelligence of a person. You have to go to the tricks.
Nevertheless, all the same unlipped field. Yes, you can do with simple scripts – it will still be fun to play, but cool AI completely changes the gameplay. Given the latest achievements in the field of neural networks, one can expect not only to improve the mind of opponents in games, but also the emergence of completely new mechanics.
Recall the project DeepMind , Within the framework of which researchers from Google put different experiments with neural networks, including teach them to play computer games. In just a few hours, the computer becomes a professional in one of the old games for Atari.
If you wait long enough, you can get through your imperfection.
It is possible that, following this path, you can create ferocious rivals for modern games. Or vice versa – reasonable companions. Who knows?