[img]https://clan.cloudflare.steamstatic.com/images//41581512/d0936eac16f298de6b7719859c3f0f46ea0cb0fb.png[/img] Hello to all the inhabitants of the Zone! While you are fighting in the Arena, the designers of the combat system have prepared an article about the new Artificial Intelligence and further plans for its development. Many of you have already noticed that at the end of May the behavior of NPCs and mutants underwent changes. That's when a new AI for NPCs and navigation tools (NAVmesh) for NPCs and mutants were added to the game. We purposely did not write about it in the patch, as the increased attention to the update would have distorted the analytics data and we needed to look at the natural reaction of players to the changes. In this article we will finally tell you about the features and tasks of the new systems, as well as share our plans for their further development. [table] [tr] [td]The article is being published now because Crow's Arena demonstrates the current capabilities of the new tools.[/td] [/tr] [/table] [hr][/hr] [h2]What is the new AI?[/h2] The [b]new AI[/b] includes two architectures - "finite automata" and "behavior trees". The life cycle of an NPC is based on [b]"finite automata"[/b], where it moves from one state to another depending on circumstances. For example, from patrolling to combat (and back again). [img]https://clan.cloudflare.steamstatic.com/images//41581512/55afedea1fc28dfd1fcbd1d5e87fe178e95d9fce.jpg[/img] • [i]An example of an NPC lifecycle based on "finite automata".[/i] The second architecture, [b]"behavior trees"[/b], shapes and defines these states and makes up the bulk of the NPC's intelligence. [table] [tr] [td]Within them, "finite automata" for cyclically repeating tasks can also be found.[/td] [/tr] [/table] [img]https://clan.cloudflare.steamstatic.com/images//41581512/16c915eaedd1e3302e549387ae9f86c55dd7ea0e.jpg[/img] • [i]On the right we see the "behavior tree" of the standard NPC.[/i] [table] [tr] [td]To generalize, AI is the set of instructions that entities follow when deciding on their actions in the game world.[/td] [/tr] [/table] [hr][/hr] [h2]"Behavior Trees"[/h2] [img]https://clan.cloudflare.steamstatic.com/images//41581512/8033035b3d2fdde54154ecd59b76d925ada60c62.jpg[/img] • [i]Combat behavior logic based on behavior trees.[/i] During the development process, we looked at game industry standards and chose an AI architecture called "behavior trees". They allow us to detach the logic of the "agent" from the code and create a separate system that is available for work by a wider range of developers, including the technical game design department. [table] [tr] [td]Agents is the common name for all NPCs and entities in the game.[/td] [/tr] [/table] Whereas before, every change in the logic of mob behavior required the attention of programmers, now technical game designers will suffice. [table] [tr] [td]The Technical Game Design Department is a young department responsible for the technical implementation of quests, events, and the customization of NPCs and entities.[/td] [/tr] [/table] [b]"Behavior Trees" is an effective tool for implementing "agent" behavior patterns for specific game situations.[/b] The example below illustrates how the Crow Arena boss launches and completes his special attack. [previewyoutube=NddiFhr_kbs;full][/previewyoutube] • [i]A video demonstrating how the "behavior tree" works.[/i] [b]Artificial intelligence was made while we were still working on the second part of the story.[/b] The first NPCs with new "brains" were Cyber Giant and Morgue with extras in the storyline quests. [table] [tr] [td]Creating, testing, and balancing these NPCs already required significantly less programmers' time.[/td] [/tr] [/table] After the second story line was released, the AI development department was given a new task - to convert the brains of ALL NPCs to "behavior trees", recreating the previous AI as accurately as possible using the new tool. It just so happened that as we worked on this task, it became closely related to the NAVmesh tool. [table] [tr] [td]So far, only NPCs are using Behavior Trees - there's more to come for mutants.[/td] [/tr] [/table] [hr][/hr] [h2]NavMesh[/h2] NavMesh or "navigation mesh" is a separate structure for orienting entities in the world, invisible to players. Thanks to it, both NPCs and mutants have learned to better find their way around obstacles. [img]https://clan.cloudflare.steamstatic.com/images//41581512/99696b5b1424f1c3ae433814411035fa69b13a21.jpg[/img] • [i]Navmesh visualization is exactly how NPCs and mutants see the world.[/i] [table] [tr] [td]Navmesh is generated automatically based on the geometry of the world, which seriously saves time for level designers.[/td] [/tr] [/table] [b]Why did we need this tool?[/b] [i]Mutants unable to walk through doorways, NPCs getting stuck in barrels, and... blind dogs spinning on the first space between parking garages.[/i] We use various cubes, hillsides, various decorations and it all forms a complex geometry of the world. It's quite difficult for an entity to adhere to established behavior when it starts to occasionally "go dumb" when passing obstacles. If we were to just improve the wayfinding system without additional layers of navigation, we'd have to pay the price in server load. At the same time, the situation in the world can change rapidly and require a high speed of reaction down to fractions of a second. Based on these considerations, we decided to implement a navigation grid: [olist] [*] it exists separately from the geometry of the world, but is created on its basis. Thus, only "agents" can interact with it; [*] The system's work on pathfinding on the navmesh can be optimized relative to the previous implementation. [/olist] [previewyoutube=MJlnlb4jGzY;full][/previewyoutube] [table] [tr] [td]NAVmesh is already being used by both NPCs and mutants![/td] [/tr] [/table] [hr][/hr] [h2]Further plans[/h2] The new AI and navmesh showed themselves well on the game servers - at least there were no surprises! Although the changes are not too obvious for players, we have done the most important thing - we have built a strong foundation for future features related to the behavior of entities. Plus game designers are no longer limited by programmers' time and are free to create without any restrictions. [table] [tr] [td]For the foreseeable future, players can expect a variety of open world PvE and PvPvE activities, dungeons, new game modes, and enhancements to old ones using AI and navmesh.[/td] [/tr] [/table] What we're currently working on: [list] [*] Fixes, improvements and optimization of the new AI. Returning the mutants' ability to jump on objects, NPC's ability to jump down and other numerous edits. [*] Transition of mutant "brains" to "behavior trees" - now they use the old AI. [*] Development of combat in the game to improve the PvE experience - teach NPCs to hide behind cover, throw grenades, introduce various behavioral scenarios. [/list] This concludes the article about artificial intelligence and navigation grid, those who have read to the end get the achievement "Artificial Intelligence Connoisseur"! Stay tuned for more updates. [hr][/hr] С give @player [respect], Artificial Intelligence development department at EXBO.