Simulation of a living world, living NPCs

I have been nurturing this idea for a long time, periodically thinking through different concepts. Even when I was working on maps for WC3, I wanted to make a simulation where each NPC in the game is a hero, with their own goals and needs. NPCs would be the same heroes as the player: they would farm experience and items, fight with each other, etc. But if we move away from wc3, the essence of the concept is the same – each NPC really “lives” in the game. In theory, this will help create a “real” living world with which the player can interact.

Narrative and scenery

Usually, the illusion of a lively world is created by scripts and scenarios, or simply narrative inserts. In Gothic, for example, NPCs had a daily routine, which migrated to the later Elder Scrolls. Usually it's just a script: if it's morning – get out of bed and go to point A. At point A, hit the wall with a hammer until evening. In games like rdr2, the scripts are more complex, there are more animations – but the essence is the same. In general, this is an approach of simply decorating the world. There are also simpler decorative elements that are not at all related to the game world, such as simple text, lore, notes and scenes. The daily routine in Gothic directly affects the gameplay.

This approach often creates ludonarrative dissonance. Knocks you out of the immersion, breaks the illusion of the world. When a miner and a half with a rose from a bottle of “Three Bogatyrs” beer jumps on a dragon slayer, the head of the guild of magicians in mithril armor from every gateway – you see in them only bottles with loot for a couple of coins. Or, when I played Rogue Trader (or any other similar) – you are given 4 dialogue options to choose from. And they all lead to the same next scene, no matter what you choose. You feel the whole meaninglessness of your conscious choice, all these “branching branches” of dialogue – just an illusion of choice, at best – a switch of the plot rails, or you will simply be shown a slightly different text. For an inexperienced player or someone who is completely immersed and builds a story in his head, consciously closing his eyes to inconsistencies – this works and gives an amazing experience.

Colony Simulations

The most complete simulations in games like “colony simulator” aka Dwarf Fortress (and others). “Pawns” – NPCs not directly controlled by the player have not only their own daily routine, but also needs (hello Sims) and personal characteristics. But the pawns still have common intelligence, a kind of “big brother” who distributes tasks and issues commands. Usually, the simulation of the world is limited to the player's colony, and external events are a separate “decoration” of the world. But nevertheless, the pawns do their own thing, eat/sleep/work and these are really justified events that affect the world. A pawn planted mushrooms, these mushrooms are cooked, eaten, sewn clothes.

NPC actions can be divided into two categories: cyclic and single. Single ones are set by the player (movement, attack), sometimes the performers are assigned automatically by the general planner (construction). Cyclic ones can be a priori (eat, sleep) and mediated by the player (chopping, sawmill). These tasks have meaning and consequences in the game world, and even affect the relationships between NPCs.

Sandiness

More detailed and closer to reality are “life simulators” – usually various mathematical models, including reproduction. They are not games in essence, but they are extremely addictive. You can watch how species are formed, evolution, etc. Or, for example, how AI learns to independently perform tasks. For example, evolution simulation; How AI plays hide and seek; or my article about catch-up on a neural network; or such
The same is essentially true for various sandboxes, like god simulator or physics. But the game should still have some criterion of “success”. Even in aimless games like the Sims it can be assessed (more house, more money, more exploration of the world, children grown up and went to school).

The point now is not to replace written stories and a clearly planned game scenario with a living world. Stories and situations in story RPGs, corridor shooters, QTE and animated cutscenes are also great, but this is a different experience. There is no point in arguing what is tastier – ice cream or shashlik. For example, a living dynamic world can also be in games like Crusader Kings and The Guild, where characters create families, are born, die, their relationships affect the game world – also a very interesting version of a “living” game world.

I think many people, like me, are hooked by the idea of ​​a living world, where NPCs are not script dummies, but full-fledged participants along with the player, influencing the development of the game world. Without decorations and conventions, or at least with a minimum of them. I am especially hooked by the concept of an RPG, in which NPCs really live their own lives and create unique game situations. Developers of AAA projects like to feed such tales, like the destroyed sawmills in Skyrim and the tales of Molyneux. But the concept is really feasible, the only question is how to organically build a game design from it and what rules of behavior need to be set. So far I see two main ways: bottom-up and top-down.

Down up

Bottom-up solution. That is, start from the basic elements of NPC behavior. For example, take the basic needs as a basis: 1. health; 2. food; 3. reproduction. Then the AI ​​solves the priority task and the following actions. There is a complex option, based on the principle of training neural networks and a life simulator. I did this, it turns out very difficult. If simple tasks are still solvable (get to a point in a straight line), then more complex ones already require an integrated approach and complex networks, possibly composite ones. Here the task is already on the verge of creating a “strong AI”, i.e. an AI that solves an unlimited range of problems.
A simpler option – pre-prepared templates of actions, triggers and conditions. For example: if health < n% (n is a personal parameter), then run away and hide (if possible), otherwise - fight to the death. In theory, if you break these tasks down to minimal rules - it is even possible to get unexpected solutions from the AI ​​if it randomly combines these rules. It is quite possible to use real animal behavior patterns and biology. (High adrenaline) * (attractiveness of the object) < n% - the NPC attacks. But even if you use typical NPC behavior patterns - in theory you can get complex and interesting behavior patterns due to combinations of various factors.

If we assume a turn-based game, the NPC may well base its behavior on predictions. For example, using the Minmax algorithm, like in chess. (It doesn't have to be turn-based, you can even have “turn-based” AI thinking within real time.) That is, the AI ​​”in its mind” assumes various options for action, the result is modeled, “success” is calculated (for example, how much health will be left, whether the enemy will be alive, etc.). Whichever action will be more profitable – that's what will be done. The “correct” thing would be for each NPC to have its own model of the world in its head – it will know only what it should. For example, if you played an RTS – then the unit will correctly run around obstacles even in the fog of war, because the pathfinding algorithm works on the “real” map, and not the one that the player sees. The same principle is in various games, like the path of the NPC in an RPG, like Skyrim (each NPC always knows the shortest path). But it would be more correct for each NPC to have in his head only what he can really know: what he saw himself or learned through mechanics such as communication (moreover, the interlocutor can give the NPC outdated information or incorrect information, such as the path of a cave that has already collapsed).

This approach is interesting for its “research” approach, like creating rules and a model and then watching with interest how the NPCs will behave. But still, the game designer must know almost all possible game situations in detail. You can't just say “I wonder how it will be.” More precisely, you can at the stage of game design development, but not after that. Although, in general, it is possible during development, in theory, but this will complicate the development and creation of a holistic game. Although, I have developed small games without any holistic vision, just adding gimmicks along the way. But if we talk about the holistic mechanics of a living world and living NPCs, the key concepts must be defined in advance, because “adding along the way” may generally be impossible in principle.
Therefore, there is a “top-down” principle. It is not at all necessary to adhere exclusively to it, you can combine it. But from top to bottom you need to determine what the player will see, what game situations and their variations are possible; what the player's gaming experience will be and what the game is capable of giving out in general.

Top down

In this case, we need to ask ourselves: what kind of situations can a living game world provoke? I'll take the setting and world model in such a setting as a basis. By default, it's medieval fantasy, where the player is one of many (conditional) people. Let's say the player appears at the road along which a convoy is leading a prisoner (Ulfric Stormcloak is our king!). But the road has no reason – it appeared thanks to the hand of the designer, just like the convoy itself – there are no reasons conditioned by the game reality. The whole story is just narrative. It is possible to implement a simplified conditional generation of the world (torn away from the real gameplay) – the road was created during world generation. But the convoy must be conditioned by real game mechanics. That is, the game mechanics of the legal system must be implemented, in which a character (NPC or player) can be taken into custody and escorted. And then in more detail, down the chain: how a character becomes a guard; how he becomes a criminal; how the guards caught the criminal; where they are taking, why, etc. And all this should be described in detail, any new concept – in detail. “They are taking to the city for execution” – ok, what kind of city, what does it consist of, who lives in it, what do they do, etc. If you introduce this element (the convoy) into the game narratively, without integrating it mechanically, then this will be the creation of a “decoration”, much easier than linking this element down to the level of interaction between the AI ​​and the NPC and his decision-making. And you can always “cut off” any situation to the level of decoration – without cause and / or without effect. Destroy the convoy and free the prisoner – he will run away, waving his hand. If you can loot the guard – this is already a consequence, an action that affects the game world (item mechanics). In contrast, in the game, the bodies of the guards can simply disappear, without consequences, as in most shooters.

With a top-down approach, mechanics such as hunger may not exist at all. Some conventions may be skipped; some game situations may be abandoned or replaced with conventionally decorative ones. In the case of a living game-mechanically connected world, there should be no decorations, or they should be taken outside the game world. For example, in Dwarf Fortress, this is a goblin attack. Goblins have no life beyond their appearance by a trigger (even though it is connected with the luxury of the gnomes), i.e. game-mechanically, they have no reason for the appearance of goblins, unlike a tree that grew from a seed. In a living game world, all objects must have a life cycle; except for the causeless initial appearance during generation. Ideally, all the experience that the player perceives should be part of a cycle and their combinations; which the player himself can influence.
Let's say the attack on the convoy was part of the life cycle of the prisoner character and the guard characters. Then, in any case, the character must have a cycle – appearance, repeated conditional actions, disappearance. The simplest appearance is immigration (like in Dwarf Fortress), i.e. appearance out of nowhere. A more complex option is birth. This requires complex mechanics of conditional conception, growing up, and so on down the list. Although this moment can be simplified as in one hour one life. Although reproduction can also become a great mechanic, as for example in Crusader Kings, Medieval Dynasty, The Sims. But if birth cycles are not controlled exclusively by the player and occur independently, without an artificial limiter – the world risks “breaking” from overpopulation. The simplest way is to “divinely” reduce the birth rate during overpopulation or compensate for it with predetermined rules. Ideally, when the player is inactive, the world should be able to exist independently and even withstand the player's outrages (cut Whiterun – people moved into the city from the nearest village).
Or, on the contrary, if the player does nothing, the world will disappear. This option is also possible.

NPCs communicating with each other

The ability of NPCs to communicate with each other is also interesting. And I'm talking about real communication – transfer of information, the ability to negotiate, etc. As a rule, only the player can communicate in games – learn new things and give commands. But if the NPC has his own model of the world in his head, which affects his behavior, communication is necessary. The basis for the mechanics can be taken from the real world model. For example, grooming (doing good out of gratitude); credit system (trust, promises, debt); Prisoner's Dilemma (deception and abuse of trust). Or simplify it to the level of barter “I give you, you give me”, with a “credit” counter. Asked for directions – minus 100. No credit – f**k up. Gave gold – plus 100. Phrases from both the player and the NPC from basic commands, collected into a sentence. For example: give / take (item). For the guard escort – release the prisoner. In this case, the commands for communication and their variability strongly depend on the capabilities of the characters' actions, implemented by the mechanics.

For example, mathematicians played prisoner's dilemma. Computer programs played with each other, trying to cheat – interesting conclusions can be drawn from this, and analogies can be found in the real world.

Multiplayer

It can be said that such game worlds already exist. One hour one life; Eve Online; – examples of such worlds, where players “live” in the world by the same rules for all and influence the world directly, the mechanics are connected. But in network games – one player is far from the center of the universe and sees only a part, and his influence on the world is very limited. While in a single game – the player is the center of the universe and sees with his own eyes how his actions change the world dramatically. In the case of a living world, connected by game mechanics – the world will be able to provide a bunch of unique situations; it is interesting to observe such a world, studying the details of this world and its development; each action of the player “honestly” reflects on the game world itself. Thinking over and connecting game mechanics into a laconic system can be very difficult, but – possible.

I didn't add a link to the telegram channel, sorry. There isn't one.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *