The Evolution of War: The Total War Series AI (Part 2)

Original author: Tommy Thompson
  • Transfer

This is the second part of the article about artificial intelligence Total War. In the first part of the article, I talked about the Creative Assembly 2000 game Shogun: Total War , a game that changed the face of real-time strategies. The Shogun , there are three distinct layers AI systems: AI units controlling individual units and save them to the construction and arrangement, the combat AI , grouping and defining the construction of the units, as well as the AI campaign / diplomacy , a leading turn-based strategy and seeks to seize control of feudal Japan. I finished the first part on Medieval: Total War 2002: a game that redefined and improved the fundamental systems created by Shogun. But it was only the very beginning of a long journey of improvements and restructuring of AI franchise systems, both from the side of Creative Assembly, and by the hands of Total War fans . Therefore, let's look at the next releases of the series and observe how the evolution of the war took place.

Rome and the heyday of the modders community


Rome: Total War2004 made changes to the gameplay and significantly improved the graphic part of the game. In the third part of the series, a three-dimensional diplomatic map appeared, as well as fully rendered 3D units. The plot of the game was transferred to Italy 270 BC, to the time of the birth of the Roman Empire. It was this part that turned a niche strategic simulator into a full-scale bestseller. However, it also began to manifest gameplay flaws. They are most noticeable in a campaign where AI is trying to be as efficient as possible in a rich and interesting set of diplomatic mechanics. This is partly due to the longer and more thoughtful development of the actions necessary to build and grow our own corner of the Roman Empire. As I said in the first part, the campaign AI is based on state machines and is reactive in nature,


Despite these problems, the game remained a valuable and interesting contribution to the series, which created a large and strong community of fans around it. Rome was the beginning of a long history of mods created for Total War. It was easy enough to work with him, because most of the data that controlled the gameplay of the early parts of the series was available to the player in the installation files. Therefore, modders managed to create tools for manipulating data for their own purposes. Many of these mods were aimed at improving graphics and management, expanding narrative and creating a richer world, for example, Roma Surrectum and Rome: Total Realism . Some of the mods even took basic mechanics and AI, and transferred them to other worlds, for example, a mod in the world of Tolkien The Fourth Ageand, ironically, the Warhammer: Total War mod . One of the most impressive was DarthMod : the first of a series of mods by Nick Tomadis, developed from Rome: Total War until the 2011 release of Total War: Shogun 2 . DarthMod not only changes the appearance and gameplay of the game, but also often makes significant changes to the parameters that affect the behavior of AI in battle and campaigns, giving more experienced players the opportunity to turn around: new combat builds have appeared, performance characteristics have been improved, and more flexible and aggressive behavior has been created AI.


The deep problems that arose during the remaking of the engine in Rome, reached its peak with the release in 2006 of Medieval II: Total War . Medieval II is essentially a remake of Medieval: Total War on the Rome engine , but many of the underlying structural problems of AI have been preserved. However, the developed community of modders has fixed most of them. Therefore, it was time to change, AI systems had to be rebuilt from the very foundation, which happened with the release of Empire: Total War .

Empire AI


While Rome was a rework aimed at updating base systems and gameplay, Empire: Total War2009 was striving for higher goals. The game was not just to update the basic formula of Total War, but also to make the game more accessible to a mass audience. This led to an update to the UI systems, tips and tutorials, as well as the basic components of the gameplay. In battle, there was a great variability of units dependent on firearms: cavalry, musketeers, shooters, and heavy artillery; along with this, a free navigation system for the units using shelters was added, allowing them to use the details of the relief, hiding from intense fire. Empire’s most serious novelty was the transition to real-time naval battles, when players give orders to fleets of ships and attack enemy forces. In addition, the main campaign now occupied a much larger territory - both America, Europe and India, not to mention the sea routes connecting them. To further enrich the game, at this stage the campaign’s AI also had to manage armies and fleets, perform a spatial analysis of the game map, recognize an enemy threat on different types of terrain, engage in diplomacy, control its resources, and also make decisions about taxes, construction and much friend.


There is no doubt that this has led to an increase in the franchise and increased the need for improved technology. Rome: Total War was completely rewritten for Empire, which led not only to a new implementation of AI at the unit, battle and campaign levels, but also made changes to the game’s presentation to the user, which greatly influenced the further development of modding tools.

In Empire: Total Warthe developers completely rebuilt the campaign and combat AI to escape reactive and state-controlled behavior: thus, the systems not only learned how to actively respond to decisions made by opponents, but also had their own personality, controlled by sets of configurations and behaviors. When developing Empire, the authors sought to create an AI that takes into account longer-term results, as well as balancing several goals at the same time. This has led to use in developing a method of action planning based on goals (Goal Oriented the Planning the Action, the GOAP) . This technique gained popularity in 2005 thanks to the First Encounter Assault Recon (FEAR) and was used in games such as Fallout 3 ,STALKER: Shadow of Chernobyl and Deus Ex: Human Revolution . GOAP is a classic planning method: agents (AIs) use an abstract world model to make a series of decisions transforming the world in order to create the desired result. This approach is ideal for situations in which there are many consecutive separate actions; he can evaluate several goals at the same time and take actions to achieve them, if they do not contradict each other. Many of the original Shogun tactics were able to be transferred here quite simply, taking into account the fact that the logic of Art of War can be encoded for search and execution in the planning language. If you want to know more about AI planning and how it works, then check out my discussionFEAR and Goal Oriented Action Planning , and the use of GOAP and hierarchical planning in Transformers High Moon Studio games .


One of the most important aspects in this version was that AI was now modeled inside the game itself. In Rome: Total War, gaming AIs are combined with the logic of the game itself. This meant that he became part of the game and could potentially perform actions inaccessible to players or have access to information that he should not know. In this and subsequent versions of the AI ​​campaign, it is separated in such a way that now it actively plays the game as a person; its interface is connected to the code base, which allows it to exchange data with the game, and vice versa.

The actions of the AI ​​campaign are determined based on three main issues:

  • How good is my current condition?
  • What can I do next?
  • What resources can I allocate for this?

These three questions allow you to use the model of beliefs, desires and intentions.(BDI system). This means that the campaign AI models a set of beliefs, desires and intentions that control its decision-making processes. Beliefs give the AI ​​an understanding of the world, but taking into account the fact that they may turn out to be wrong, for example, regarding the location of the player’s resources or his relations with other factions. Desires are a player’s motivational incentive and set goals that the system wants to achieve, both immediate and long-term. Examples of desires include capturing or defending a territory, obstructing enemy agents, recruiting armies, prioritizing construction and conducting diplomacy with neighboring factions. The last aspect is extremely complex, I will return to it and consider it in more detail in the next part of this series of articles. Finally, intentions are a contemplative state of an agent: as soon as he chose to do something, these intentions stimulate him to continue striving for the goal, even he is distracted by another goal until it is achieved. This works in the system on the basis of planning as follows: it can continue to track unfinished goals and strive to achieve them, while simultaneously solving immediate tasks. However, as we will see from the third part of the series of articles, the system cannot recognize many of the overlaps arising from its actions, and the conflicts they create in their own decision-making process of the system led to another improvement in the AI ​​campaign several years later. she can continue to track unfinished goals and strive to achieve them, while simultaneously solving immediate tasks. However, as we will see from the third part of the series of articles, the system cannot recognize many of the overlaps arising from its actions, and the conflicts they create in their own decision-making process of the system led to another improvement in the AI ​​campaign several years later. she can continue to track unfinished goals and strive to achieve them, while simultaneously solving immediate tasks. However, as we will see from the third part of the series of articles, the system cannot recognize many of the overlaps arising from its actions, and the conflicts they create in their own decision-making process of the system led to another improvement in the AI ​​campaign several years later.


In battle, AI systems fulfill many goals that allow them to be more effective not only in fulfilling their mission, but also in controlling their own resources. For example, an active combat target of a unit may be an attack on a selected enemy unit, but at the same time it may have the goal of ensuring the security of the flanks, taking into account the location of enemy forces. The balance and priority of these two goals can vary depending on the events taking place at the moment: taking into account the size and location of one's own army, the actions performed by it, the enemy occupied by the terrain and the assessment of its forces. While targets for attacking an enemy can change or be eliminated after completion, defensive goals are constantly shifted based on the current situation, and all these tasks are given priorities based on the current state of the battlefield. The result is a system that, even when the current execution plan is interrupted due to a change in priorities (for example, for a short-term task to protect oneself by maneuvering, or to save the general from an attack from the flank), can eventually return to the original goals and continue its implementation. And vice versa - when the AI ​​attacks the player, he does not make rash decisions, for example, transferring artillery from a wide flank to attack another target, if this can pose a serious threat to the survival of the remaining forces.

Empire: Total War was released in February 2009, but unfortunately it turned out to be mixed. At the time of launch, the campaign and battle AI suffered under the weight of the problems they faced. And this was not particularly surprising: planning solutions to large-scale tasks of this type was incredibly costly, and developers could foresee only some of the many possible outcomes and situations. Here's what Creative Assembly Creative Director Mike Simpson said:

“This AI was not like any other we wrote before ... This is the most complex code construction I've seen in games. I wrote most of the campaign AI code for Shogun and Medieval I, and I know that even a fairly simple “static” AI evaluation of actions without any planning or memory can be complicated enough to exhibit chaotic behavior (here we mean chaos in the style mathematical “butterfly effect”). It works as it works, but not quite as it should. Maybe this is good - we cut off bad behaviors and leave only good ones, as well as a simple system that is not too predictable.

Empire AI is much more complicated than in any of the previous versions ... As a result, we have an AI that plans actively and smartly, but diverges with itself in time decisions and often turns out to be paralyzed by indecision. ”

[Blog the Second, Mike Simpson, Total War Blog, October 9, 2009]

For six months after release, Creative Assembly tried to solve this problem by creating AI patches up to version 1.5 of the game. These improvements were carried over to the 2010 project Napoleon: Total War , which in many respects remained functionally the same game, only in a different theater of operations. This was partly due to the fact that during the development of Napoleon, the teams of the campaign and battle AI developers were forced to constantly return to solving problems in Empire . Therefore, in the next part of the game, only minor changes and improvements were made.

Modding


At the same time, the modders community came across Empireto an obstacle caused by a change in the engine. In previous versions of Total War, there were many variables and performance settings in the form of external data that were loaded into the game at startup, which simplified the creation of modding tools. Probably, the ideal state for the modders was the state of the game in Shogun, but it was impossible to maintain it, as the size and scale of each new game increased: the campaign maps and the possibilities of conducting tactical combat expanded. In tests before the release of the game, it turned out that the increased amount of data and the expected limitations on the amount of memory of gaming computers led to serious bottlenecks in performance. Therefore, most of the data was pre-processed and compiled into a ready-made executable file, which closed the modders access to most of the game’s architecture.

However, mods continued to appear, including the ever-popular DarthMod , which again returned to Empire , changing the game’s internal parameters to make AI more stable. Bran's Empire AI mod took DarthMod as a basis and improved it, reducing the number of ridiculous decisions made by the AI ​​in the game. Such difficulties in the development of mods forced Creative Assembly to invest more effort in providing modders with access to the insides of later versions of the game. The Total War: Shogun two realized more extensive support for mods, and in many subsequent releases appeared compatible with the Steam Workshop API.



Finally


The evolution of the war brought with it many problems, but as a result provided players with a smarter and more fun gameplay. Players sought greater credibility and control over this process, and this led to the heyday of the modders community, which is still active in many games of the Total War franchise. I hope you enjoyed the second part of the series on AI Total War . In the third part, I will consider one of the most important but controversial game in the series: 2013 Total War: Rome II . This part made the most serious changes in AI and allowed us to reconsider the views on AI systems used in AAA-class games.

Also popular now: