The Diplomacy AI in Total War: Attila | AI and Games #24

AI and Games · Beginner ·⚡ Algorithms & Data Structures ·8y ago

Key Takeaways

The video discusses the diplomacy AI in Total War: Attila, which utilizes a Monte Carlo tree search algorithm and a data-driven diplomacy system, and explores its design and implementation, including the use of weighted summation functions and pre-filtered lists, with a focus on game development and AI in games, specifically in the context of ui ux design

Full Transcript

[Music] hi I'm Tommy Thompson this is AI in games and welcome to part four of the AI of total war in part three of this series I explored the campaign AI of one of the most pivotal entries in the franchise 2013's total war room to a game that completely rebuilt the campaign AI systems to accommodate for an increasingly more complex series of mechanics resources and consequences room 2 adoption of the Monte Carlo tree search algorithm is a critical step in bringing the campaign AI up to spec for more contemporary entries in the series but the innovations at campaign level didn't stop there in this video I'm going to look at how the MCTS systems were improved upon as well as how the diplomacy systems have been scaled up for the modern era as rome gave way to 2015's Total War Attila Attila as the ninth entry in the total war franchise and transposes the conflict to the late fourth and early fifth century a period of history known as the migration period the Roman Empire begins to falter even fracture the Empire is separated with the Latin speaking Roman Empire to the west and the Greek speaking Byzantine Empire to the east the Roman Empire is on borrowed time amalong we survive another 200 years at best as it is besieged by the Vandals Franks Saxons and perhaps most importantly the Huns players bring Attila the Huns rise to power as the eunuch Empire forms over what is now Eastern Europe total war Attila is in many respects a natural successor to Rome - with a campaign map of similar size and shape that succeeds the rise of the Roman Empire and the previous title only to see a crack and crumble with a total of 56 factions appearing as either a lie or fall in the original version of the game but of course it's not just the change of setting the underlying tech continues to change and evolve as well the introduction of Monte Carlo tree search in Rome - the focus of part three of this series was a massive and taking MCTS had not made the transition into triple-a gaming at that time and naturally there was so much to learn as to how to utilize the system's full potential so let's take a quick look at the gradual changes and improvements made to the algorithm between post launch updates for Rome 2 all the way to the launch of Attila the MCTS was updated to address some notable issues and performance and results notably the algorithm was slow to decide but was typically making good choices a big part of this was that the state space coverage becomes increasingly difficult the longer the game progresses the number of AI factions begins to grow the number of possible future states could always at an exponential rate in addition the underlying path finding tools to calculate distances between factions in the lake during MCTS play outs was proving very expensive to resolve this the algorithm was trimmed to prune the number of strategies it considers this required additional analysis of a game state using metrics from the developers themselves to determine whether a target was unreachable a battle was unwinnable there was a low probability of a strategy succeeding or a given path in the tree was redundant and then removed it from the decision-making process this last part isn't as easy as it might sound given a lot of strategies are essentially identical executed in a slightly different order and result in a similar outcome this required the system to break up searching into sub phases such that it enforces an arbitrary ordering this helped identify multiple strategies that essentially are the same when ordered a specific way in addition this old required aggressive patching of the pathfinding system to precache some calculations and simply reduce the number of calculations taken only asking of the MCTS decision-making process deemed it necessary this resulted in a system that was way more memory efficient and ultimately faster it shows that the MCTS algorithm while relatively simple in its design and execution is also one that requires additional care when tackling large and complex problem spaces given it may need some assistance in order to make its decisions more efficiently especially when trying to ship it in a triple-a product [Music] one area of the franchise I've not yet touched on is the notion of diplomacy the process by which campaign AI players accept offer and negotiate trade deals and alliances diplomacy is driven by an entire AI system in and of itself adding to the steadily growing collection of AI subsystems such as threat analysis path finding and siege battles which I'll cover in part 5 diplomacy is primarily interested in answering three key questions for the campaign AI on a given tone what deal should I accept meaning it has to derive a value to each and coming deal given by another faction what deals would I like to offer this requires the system to generate deals that it can propose to other factions and lastly how do I negotiate a given deal it needs to ensure the deal is valuable to both parties this is both valid for an incoming or outgoing deal given it once the other faction to accept his proposal but conversely it may need to haggle an incoming proposal to its satisfaction the diplomacy system is driven by the same information in logic as the player it can't take any shortcuts even when two AI factions are dealing with one another they still go through the same process as a player would either with an AI or another player this is a highly data-driven process with each faction having specific and unique configurations of values that drive diplomacy in an effort to ensure they all behave slightly differently this is pretty important in deriving their personality through a given campaign which I'll come back to discuss a little bit later in order for the AI to pull it off it transforms these three key questions into diplomacy subsystems or sub subsystems I guess deal evaluation generation and negotiation each of these systems utilizes four key metrics that are generated by the system given the incoming information it has received the economic value is this deal going to actually benefit me monetarily the stance value do I even like these guys who are negotiating with me the strategic value well I gained a powerful ally from this deal this is important for war and peace declarations given the current threat as perceived on the campaign map done so using influence mapping can hell determine whether this will make life easier or more difficult and the diplomatic value what will other factions think of me if I sign into this treaty if diplomatic value is negative it means that everyone else really won't like you signing this deal in addition things like stance and strategic value are influenced by a balance factor that is hand tweet by designers the bounce factor is incorporated into the difficulty and in game progression such that when an AI is losing really badly it will be more likely to accept offers that might not even be that useful even from people they don't really like given it may help ensure their survival for deal evaluation all of these values are then pumped into a weighted summation function to give what is called the deal value if the deal is scored as higher than zero it means it's worth the AI player accepting that deal meanwhile in deal generation it needs to make some smart decisions on what to offer the list of all possible diplomatic actions is too long to consider as such the system will use a pre filtered list based on the current strategic situation factoring strategic and economic values pertinent to the current state of the game that then prioritizes each deal by evaluating it with the actual evaluation shifting throughout gameplay given that a deal may have more or less value at different times during a given campaign lastly the system negotiates deals by starting with a collection of generated deals that are evaluated as useful it will then begin to offer these to other players but as mindful of previous offers that is made with a given faction if it receives an offer that the deal evaluation scoring disliked then it will make a counteroffer with a given probability or just simply reject it the AI players are made to wait a certain number of tons before attempting diplomacy with a given faction again so as to avoid spamming you with new offers every to Menace the actual discussion between faction leaders that takes place during negotiation is powered by a separate sub system that ensures that the dialogue fits the style of the character of a given faction speaking of AI factions by the time all of the DLC was released for atella there was over 80 factions in the game so how do you make all of this diplomacy not feel stilted or simi with each and every faction you deal with as mentioned before the diplomacy system is data-driven so each faction is fed data that influences how it behaves in areas such as budgeting diplomatic evaluations and negotiations and technologies these components craft what creative assembly considered to be AI personalities each of these components are often quite extreme and binary with budgeting making the AI range from Scrooge McDuck to Kanye West each of these personality traits are effectively communicated via the user interface such that players can establish just how to deal with a given faction but it's not enough to just have a static personality through a given campaign it needs to change and evolve over time as such each faction has a personality group with multiple personalities it can choose from the choice of selecting which personality it wants to use is driven by a number of factors such as the current difficulty of the game and the stage of the campaign itself as such ultra aggressive burna all down style personalities don't appear as frequently at the start of the campaign but are more likely to appear towards endgame in addition many of the personality swaps are tied into the progression of faction leadership with new personalities adopted as a faction leader dies and their heir comes into power while deciding how to conduct war can be challenging so too can forge alliances and making peace with others the scope and complexity of total AI continues to be vast in scale to a point that the number of minor AI systems continues to grow in order to support the unit battle in campaign AI but diplomacy isn't enough in times of conflict some things we just need to force our point of view on our enemies to make them bow to our will in part 5 of my exploration of the AI of total war I'm going to look at another of the AI subsystems and play one that's responsible for laying siege to an enemy fortification while these have been critical to the series for many iterations I'm going to take a look at the more recent innovations brought to the system alongside some fresh perspective for the franchise as history is cast aside for fantasy and we enter the world of Warhammer [Music]

Original Description

AI and Games is a crowdfunded show and needs your support. You can help fund this series on Paypal, KoFi and Patreon (where you can get access to additional content). http://www.paypal.me/AIandGames http://www.ko-fi.com/AIandGames http://www.patreon.com/ai_and_games You can follow AI and Games on Facebook and Twitter: http://www.facebook.com/AIandGames http://www.twitter.com/AIandGames Learn more about the making of this video on Patreon: https://www.patreon.com/posts/ -- In part four of the Total War series I take a look at improvements made to the Monte Carlo Tree Search algorithm as well as the diplomacy AI personalities that reside within Total War: Attila. -- Music in this episode (in order of appearance): "Scourge of God" "Main Menu" "Warriors of Ahura" "Attack of the West" from the Total War: Attila soundtrack "Skirmish" from the Total War: Warhammer soundtrack
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from AI and Games · AI and Games · 19 of 60

1 Evolving Particle Weapons in Galactic Arms Race | AI and Games #04
Evolving Particle Weapons in Galactic Arms Race | AI and Games #04
AI and Games
2 Pac-Man AI Research and Competitions | AI and Games #06
Pac-Man AI Research and Competitions | AI and Games #06
AI and Games
3 The Behaviour Tree AI of Halo 2 | AI and Games #09
The Behaviour Tree AI of Halo 2 | AI and Games #09
AI and Games
4 Researching Super Mario Bros. Level Design | AI and Games #10
Researching Super Mario Bros. Level Design | AI and Games #10
AI and Games
5 Teaching Robots to Play | AI and Games #12
Teaching Robots to Play | AI and Games #12
AI and Games
6 The Quest for AI Game Designers | AI and Games #13
The Quest for AI Game Designers | AI and Games #13
AI and Games
7 HTN Planning in Transformers: Fall of Cybertron | AI and Games #14
HTN Planning in Transformers: Fall of Cybertron | AI and Games #14
AI and Games
8 The AI of Alien: Isolation | AI and Games #15
The AI of Alien: Isolation | AI and Games #15
AI and Games
9 Status Performance Analysis in Team Fortress 2 | AI and Games #17
Status Performance Analysis in Team Fortress 2 | AI and Games #17
AI and Games
10 Training the Shadow AI of Killer Instinct (2013) | AI and Games #18
Training the Shadow AI of Killer Instinct (2013) | AI and Games #18
AI and Games
11 Resurrection & Reverence: The Return of DOOM | Design Dive
Resurrection & Reverence: The Return of DOOM | Design Dive
AI and Games
12 Left Behind on LV-426 - The Design of Aliens: Colonial Marines | Design Dive
Left Behind on LV-426 - The Design of Aliens: Colonial Marines | Design Dive
AI and Games
13 Games By ANGELINA, the AI Game Designer | AI and Games #20
Games By ANGELINA, the AI Game Designer | AI and Games #20
AI and Games
14 Prepare to Die by Simple AI - Dark Souls and Difficulty | Design Dive
Prepare to Die by Simple AI - Dark Souls and Difficulty | Design Dive
AI and Games
15 Looking for Love on Pandora: PCG and Borderlands 2 | Design Dive
Looking for Love on Pandora: PCG and Borderlands 2 | Design Dive
AI and Games
16 The AI of Shogun: Total War | AI and Games #21
The AI of Shogun: Total War | AI and Games #21
AI and Games
17 The Campaign AI of Total War: Rome II | AI and Games #23
The Campaign AI of Total War: Rome II | AI and Games #23
AI and Games
18 AI 101: Monte Carlo Tree Search
AI 101: Monte Carlo Tree Search
AI and Games
The Diplomacy AI in Total War: Attila | AI and Games #24
The Diplomacy AI in Total War: Attila | AI and Games #24
AI and Games
20 A History of AI Research in StarCraft | AI and Games #26
A History of AI Research in StarCraft | AI and Games #26
AI and Games
21 Dota 2, MOBA's and the Future of AI Research | AI and Games #27
Dota 2, MOBA's and the Future of AI Research | AI and Games #27
AI and Games
22 Procedural Level Generation in Sure Footing | AI and Games #28
Procedural Level Generation in Sure Footing | AI and Games #28
AI and Games
23 Behind the AI and Storytelling of Spec Ops: The Line | AI and Games #29
Behind the AI and Storytelling of Spec Ops: The Line | AI and Games #29
AI and Games
24 The AI of DOOM (2016) | AI and Games #30
The AI of DOOM (2016) | AI and Games #30
AI and Games
25 Machine Learning Analysis of Player Behaviour in Tomb Raider: Underworld | AI and Games #31
Machine Learning Analysis of Player Behaviour in Tomb Raider: Underworld | AI and Games #31
AI and Games
26 How A Navigation Mesh Works in 3D Games | AI 101
How A Navigation Mesh Works in 3D Games | AI 101
AI and Games
27 How Halo 3 Builds Large-Scale AI Battles | AI and Games #33
How Halo 3 Builds Large-Scale AI Battles | AI and Games #33
AI and Games
28 Enemy AI Design in Tom Clancy's The Division (Part 1 of 2) | AI and Games #34
Enemy AI Design in Tom Clancy's The Division (Part 1 of 2) | AI and Games #34
AI and Games
29 Building the Online World of Tom Clancy's The Division (Part 2 of 2) | AI and Games #35
Building the Online World of Tom Clancy's The Division (Part 2 of 2) | AI and Games #35
AI and Games
30 Behaviour Trees: The Cornerstone of Modern Game AI | AI 101
Behaviour Trees: The Cornerstone of Modern Game AI | AI 101
AI and Games
31 Why Friendly AI Cheat in Ghost Recon Wildlands | AI and Games #36
Why Friendly AI Cheat in Ghost Recon Wildlands | AI and Games #36
AI and Games
32 The AI of Horizon Zero Dawn | Part 1: Rise of the Machines | AI and Games #37
The AI of Horizon Zero Dawn | Part 1: Rise of the Machines | AI and Games #37
AI and Games
33 The AI of Horizon Zero Dawn | Part 2: Metal Militia | AI and Games #38
The AI of Horizon Zero Dawn | Part 2: Metal Militia | AI and Games #38
AI and Games
34 Augmented Reaction: Vanquish - 9 Years Later | Design Dive
Augmented Reaction: Vanquish - 9 Years Later | Design Dive
AI and Games
35 Building Mario Levels with Machine Learning | AI and Games #39
Building Mario Levels with Machine Learning | AI and Games #39
AI and Games
36 The AI of Half-Life: Finite State Machines | AI 101
The AI of Half-Life: Finite State Machines | AI 101
AI and Games
37 Building a Pirate's Paradise in Sea of Thieves | AI and Games #40
Building a Pirate's Paradise in Sea of Thieves | AI and Games #40
AI and Games
38 The Secrets of Skeleton and Shark AI in Sea of Thieves | AI and Games #41
The Secrets of Skeleton and Shark AI in Sea of Thieves | AI and Games #41
AI and Games
39 How Megalodon, Kraken and Skeleton Ships Haunt the Sea of Thieves | AI and Games #42
How Megalodon, Kraken and Skeleton Ships Haunt the Sea of Thieves | AI and Games #42
AI and Games
40 How Rare Tests Sea of Thieves to Stop Bugs Reaching Players | AI and Games #43
How Rare Tests Sea of Thieves to Stop Bugs Reaching Players | AI and Games #43
AI and Games
41 The Legacy of GoldenEye 007 | Design Dive
The Legacy of GoldenEye 007 | Design Dive
AI and Games
42 The Secrets of GoldenEye's AI Revealed | AI and Games #44
The Secrets of GoldenEye's AI Revealed | AI and Games #44
AI and Games
43 Sandbox Assassin: The AI of Hitman (2016) | AI and Games #45
Sandbox Assassin: The AI of Hitman (2016) | AI and Games #45
AI and Games
44 The Dangers of AI, Microtransactions & Lootboxes | Design Dive
The Dangers of AI, Microtransactions & Lootboxes | Design Dive
AI and Games
45 Minecraft Villages Built by AI - The Generative Design in Minecraft Competition | AI and Games #46
Minecraft Villages Built by AI - The Generative Design in Minecraft Competition | AI and Games #46
AI and Games
46 The Secret Reward Systems of Dark Souls II | Design Dive
The Secret Reward Systems of Dark Souls II | Design Dive
AI and Games
47 Why Adding Bots to Fortnite Was a Great Idea | Design Dive
Why Adding Bots to Fortnite Was a Great Idea | Design Dive
AI and Games
48 The Best Games Engines for AI (2019) | AI 101
The Best Games Engines for AI (2019) | AI 101
AI and Games
49 How Atriox Can Beat You in Halo Wars 2 Without Cheating | AI and Games #47
How Atriox Can Beat You in Halo Wars 2 Without Cheating | AI and Games #47
AI and Games
50 How AlphaStar Became a StarCraft Grandmaster | AI and Games #48
How AlphaStar Became a StarCraft Grandmaster | AI and Games #48
AI and Games
51 Why AlphaStar Does Not Solve Gaming's AI Problems | Design Dive
Why AlphaStar Does Not Solve Gaming's AI Problems | Design Dive
AI and Games
52 Designing the Enemy AI of Tom Clancy's The Division 2 | AI and Games
Designing the Enemy AI of Tom Clancy's The Division 2 | AI and Games
AI and Games
53 Bringing Washington D.C. to Life: The AI of Tom Clancy's The Division 2 | AI and Games
Bringing Washington D.C. to Life: The AI of Tom Clancy's The Division 2 | AI and Games
AI and Games
54 The Secret AI Testers Inside Tom Clancy's The Division 2 | AI and Games
The Secret AI Testers Inside Tom Clancy's The Division 2 | AI and Games
AI and Games
55 DOOM 64 Revisited | Design Dive
DOOM 64 Revisited | Design Dive
AI and Games
56 The Story of Facade: The AI-Powered Interactive Drama | AI and Games #49
The Story of Facade: The AI-Powered Interactive Drama | AI and Games #49
AI and Games
57 Building the AI of F.E.A.R. with Goal Oriented Action Planning | AI 101
Building the AI of F.E.A.R. with Goal Oriented Action Planning | AI 101
AI and Games
58 Revisiting the AI of Alien: Isolation | AI and Games #50
Revisiting the AI of Alien: Isolation | AI and Games #50
AI and Games
59 How Splinter Cell: Blacklist Builds Balance for Stealth | AI and Games #51
How Splinter Cell: Blacklist Builds Balance for Stealth | AI and Games #51
AI and Games
60 Endure and Survive: the AI of The Last of Us | AI and Games #52
Endure and Survive: the AI of The Last of Us | AI and Games #52
AI and Games

The video explores the design and implementation of the diplomacy AI in Total War: Attila, including the use of Monte Carlo tree search algorithm and data-driven diplomacy system, and discusses its relevance to game development and AI in games, specifically in the context of ui ux design. The diplomacy AI is a complex system that requires careful consideration of various factors, including economic value, stance value, strategic value, and diplomatic value. By understanding the design and implem

Key Takeaways
  1. Implement Monte Carlo tree search algorithm for campaign AI
  2. Design data-driven diplomacy system using weighted summation function
  3. Use pre-filtered list to make smart decisions on diplomatic actions
  4. Adjust parameters for optimal performance
  5. Consider economic value, stance value, strategic value, and diplomatic value in diplomacy AI
  6. Apply LLM foundations to game development
  7. Fine-tune AI system for diplomacy
  8. Test and evaluate diplomacy AI system
💡 The diplomacy AI in Total War: Attila is a complex system that requires careful consideration of various factors, including economic value, stance value, strategic value, and diplomatic value, and the use of weighted summation functions and pre-filtered lists can help make smart decisions on diploma

Related AI Lessons

Bloom Filters, Explained Properly
Learn how Bloom filters work and their benefits, including tiny memory and blazing speed, in exchange for potential false positives.
Dev.to · Daksh Gargas
Prefix Sums: The Preprocessing Trick That Makes Range Queries Instant
Learn how prefix sums enable instant range queries in arrays, boosting performance in various applications
Medium · Programming
I Thought I Was Ready for the Interview — Then One Simple Math Question Destroyed Me
A simple math question can destroy a developer's interview, highlighting the importance of being prepared for unexpected questions
Medium · Programming
Week 2(Day 10): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute…
Learn to remove duplicates from a sorted array using the two pointers technique, improving from brute force to optimized solutions
Medium · Python
Up next
Stump Grinder Carbide Wheel Grinds Hardwood To Chips
Innoforge Studio
Watch →