Diplomacy AI Dev Log
The diplomacy system in Airships has a number of design goals mostly informed by my frustrations with the shortcomings of diplomacy in other games, in particularly the Civilization series and Paradox grand strategy games. (Which, to be clear, I love and have played hundreds of hours of.) In no particular order: I want AI behaviour to make sense to the player. I want them to be able to understand why the AI makes the diplomatic decisions it does. Without this, diplomacy becomes frustrating as AIs will declare war or make peace seemingly at random. There may be a sophisticated system behind those decisions, but if the player cannot understand it, it might as well be random. I want the diplomacy system to allow for deals between empires that consist of multiple parts. Modern strategy games generally all have this, but older Civ games do not. For example, you want to be able to sweeten a non-aggression pact by including a good trade deal. Defensive pacts! All the mutual protection of an alliance with none of the being dragged into wars by the AI. My least favourite version of this is when your AI ally drags you into a war you don't want and then makes peace with the enemy again, a peace that does not include you. And you find yourself unable to make peace yourself, so now you're stuck in this war. It should be possible for the player to ignore diplomatic niceties, making war on whomever they like. Of course, they will miss out on the safety and benefit of treaties. Relatedly, no system of claims or war goals like in Paradox games. You can declare war on anyone at any time (though the diplomatic consequences may be dire) and when you conquer something, it's yours. Finally, I want rich communications between humans and AIs. Of course, humans can use language to negotiate an agreement in detail and then put it through the diplomacy system, but how do you have this kind of conversation with an AI player? In part, this is helped by the first point, having understandable AI behaviour. You don't have to guess whether the AI wants a trade treaty - the game will tell you whether it does, and why. The other thing I put in to make this work are ultimatums, which allow you to make a demand backed by a threat. The demand is an agreement that is against your victim's interests (give me tribute, dissolve this defensive pact I don't need anymore), and the threat is some unilateral action you could take that would be even worse (or I will declare war, or I will stop paying you tribute). This way you can actually communicate what you want and what you're prepared to do to get it.
These are nice goals for a diplomatic system, but how can I teach the AI to interact with them? Again, there are things I want to avoid: AI players that love or hate you for no clear reason, AI that is not actually playing to win, AI whose decisions are so opaque as to feel random. For example, Civ 6 has the concept of AI player agendas, where e.g China wants to build world wonders and gets annoyed if you build them first. This is a cool idea in theory, but you're not actually going to avoid building wonders just because of that, right? And the AIs also have some (initially) hidden agendas, which in practice mean they just randomly like or dislike you. So instead of an AI that likes or dislikes you, it should act according to strategic situation. If another empire is threatening, can the threat be reduced with a non-aggression pact? Or do we share a common enemy where an alliance would make sense? Can another empire be bullied into paying tribute? The real-world term for this is "realpolitik" - a theory of international relations that's based on the relative power of states behaving "rationally" - that is, with little regard to fairness or past history. Your former enemy can become your friend if it makes sense for them to be so, and vice versa. If you are in a position of strength, you exploit that strength. The 19th century, on which the world of Airships is approximately based, was also the heyday of realpolitik, so it's a good fit. And the AI knows what victory is in terms of the game and tries to win. Victory is achieved by conquering all cities, being in an alliance that controls all cities, or having your ruler crowned emperor. (The latter two victory conditions can also be toggled off.) This makes sense in-universe as the empires are attempting to achieve dominance over one another. To figure out what it wants, the AI assigns each diplomatic situation (war, peace, trade treaty) a score and then tries to get to a higher-scoring situation. This means that if it really wants a non-aggression pact with you (+22) but doesn't especially want a trade treaty (-5), offering it both in the same deal will have it accept. And these numbers get shown in the GUI for making diplomatic offers to AI players, so you don't have to guess.
To make diplomatic offers to human players, the AI can put together a package of terms that it likes and that it thinks you will like too. That second part is needed because otherwise the AI would start every negotiation with "and of course you should pay me tribute", because why not, it's nice for them. Instead, it will send you an offer that, while perhaps not entirely in your favour, is at least somewhat reasonable.
The diplomacy GUI also allows you to modify offers and send them back, so you can always change it to something more to your liking.
To come to agreements with other AI empires, the game looks at the relative strength of two empires and picks an agreement that they both like, but that's tilted towards the stronger partner. This is meant to simulate the result of a bunch of negotiations.
Then there's ultimatums. A good ultimatum demands something that's in your favour and threatens something scary to the target that's also an acceptable outcome for you. The classic ultimatum is "pay me tribute or I declare war", where of course you'd like tribute, but you're powerful enough that you'd also be happy with war. Meanwhile, for your victim, tribute is unpleasant, but not as unpleasant as being conquered. And this produces a pretty clear mathematical definition for what an ultimatum is. To construct an ultimatum, the AI can look through things it wants but its intended victim does not, and things it could do to its victim that the victim would really dislike. Those are the demand and threat of the ultimatum. To determine whether the AI should cave in to an ultimatum - whether sent by a human player or an AI - we can also look at the difference between the demand and the threat scores. Let's say the demand is to pay tribute and enter a trade treaty, rated at -22. But the threat is war, rated at -60. So the demand is 38 points better than the threat. This is then directly converted into the likelihood that the AI will agree to the demand, by default by multiplying it by 2. So this particular ultimatum has a 76% chance of being accepted. Unlike as with normal diplomatic offers, where you know right away whether the AI will accept, ultimatums have a probability of acceptance to make them a gamble. If they reject your ultimatum, you have to either follow through with the threat or lose a chunk of reputation.
So ultimatums can be sent from humans to humans, humans to AIs, and AIs to humans, and should be a pretty flavourful way of conducting diplomacy and getting what you want.
Of course not every AI is exactly the same. All the numbers governing these evaluations can be tweaked (and modded), resulting in different personalities. Upstanding empires that don't break agreements or do ultimatums. Bullies that try to extract tribute from you but then back down from the threatened war. Lone wolves who simply want to be left in peace but will relentlessly pursue war when provoked. Diplomats who try to embed themselves into a web of pacts for safety. Traders who are mostly peaceful but won't pass up an opportunity to invade a sufficiently weak neighbour. Weaklings that will readily cave in to ultimatums. Overly principled empires who would rather be conquered than ever agree to anything they don't want. Even omnicidal maniacs who will pretty much ignore diplomacy and just attack at will. And sometimes, you also want AIs that are more emotionally driven. There already is some of this in the system I'm building, because it does consider diplomatic grievances and reputation levels in its actions. On top of that, AI personalities can have an attitude to other empires based on their past relationship. Were you at war? Have you been in a long-term stable pact? Do you own some land they consider theirs? In and of itself this isn't enough: geopolitics provide much more interesting motivations, and at the start, no one has any history with anyone else. But it can be a good additional layer for some personalities that deviate from this pure realpolitik concept.
So yes, all this is what I've been working on. Things are going pretty well, with the AI able to make and respond to diplomatic messages. There's still a bunch of problems to work out. For example, if you successfully demand tribute through an ultimatum, the AI will immediately send you a diplomatic offer that just consists of cancelling the tribute, because after all, that would be to its advantage. And I'm working on making the user interface for this as good as I can, showing the right information in the right places, plus generous quantities of tooltips. I'm also still considering additional types of diplomatic interaction on top of the ones that currently exist, which are:
[ 2021-09-23 14:44:25 CET ] [ Original post ]
I'm now working on the AI for the upcoming diplomacy features. I've already implemented the diplomacy systems themselves: what war and peace mean, the ability to negotiate agreements and send ultimatums, and so on. But of course AI empires need to be able to interact with these systems: responding to players' diplomatic offers and making their own, and also conducting diplomacy between themselves.
Aims
The diplomacy system in Airships has a number of design goals mostly informed by my frustrations with the shortcomings of diplomacy in other games, in particularly the Civilization series and Paradox grand strategy games. (Which, to be clear, I love and have played hundreds of hours of.) In no particular order: I want AI behaviour to make sense to the player. I want them to be able to understand why the AI makes the diplomatic decisions it does. Without this, diplomacy becomes frustrating as AIs will declare war or make peace seemingly at random. There may be a sophisticated system behind those decisions, but if the player cannot understand it, it might as well be random. I want the diplomacy system to allow for deals between empires that consist of multiple parts. Modern strategy games generally all have this, but older Civ games do not. For example, you want to be able to sweeten a non-aggression pact by including a good trade deal. Defensive pacts! All the mutual protection of an alliance with none of the being dragged into wars by the AI. My least favourite version of this is when your AI ally drags you into a war you don't want and then makes peace with the enemy again, a peace that does not include you. And you find yourself unable to make peace yourself, so now you're stuck in this war. It should be possible for the player to ignore diplomatic niceties, making war on whomever they like. Of course, they will miss out on the safety and benefit of treaties. Relatedly, no system of claims or war goals like in Paradox games. You can declare war on anyone at any time (though the diplomatic consequences may be dire) and when you conquer something, it's yours. Finally, I want rich communications between humans and AIs. Of course, humans can use language to negotiate an agreement in detail and then put it through the diplomacy system, but how do you have this kind of conversation with an AI player? In part, this is helped by the first point, having understandable AI behaviour. You don't have to guess whether the AI wants a trade treaty - the game will tell you whether it does, and why. The other thing I put in to make this work are ultimatums, which allow you to make a demand backed by a threat. The demand is an agreement that is against your victim's interests (give me tribute, dissolve this defensive pact I don't need anymore), and the threat is some unilateral action you could take that would be even worse (or I will declare war, or I will stop paying you tribute). This way you can actually communicate what you want and what you're prepared to do to get it.
AI Logic
These are nice goals for a diplomatic system, but how can I teach the AI to interact with them? Again, there are things I want to avoid: AI players that love or hate you for no clear reason, AI that is not actually playing to win, AI whose decisions are so opaque as to feel random. For example, Civ 6 has the concept of AI player agendas, where e.g China wants to build world wonders and gets annoyed if you build them first. This is a cool idea in theory, but you're not actually going to avoid building wonders just because of that, right? And the AIs also have some (initially) hidden agendas, which in practice mean they just randomly like or dislike you. So instead of an AI that likes or dislikes you, it should act according to strategic situation. If another empire is threatening, can the threat be reduced with a non-aggression pact? Or do we share a common enemy where an alliance would make sense? Can another empire be bullied into paying tribute? The real-world term for this is "realpolitik" - a theory of international relations that's based on the relative power of states behaving "rationally" - that is, with little regard to fairness or past history. Your former enemy can become your friend if it makes sense for them to be so, and vice versa. If you are in a position of strength, you exploit that strength. The 19th century, on which the world of Airships is approximately based, was also the heyday of realpolitik, so it's a good fit. And the AI knows what victory is in terms of the game and tries to win. Victory is achieved by conquering all cities, being in an alliance that controls all cities, or having your ruler crowned emperor. (The latter two victory conditions can also be toggled off.) This makes sense in-universe as the empires are attempting to achieve dominance over one another. To figure out what it wants, the AI assigns each diplomatic situation (war, peace, trade treaty) a score and then tries to get to a higher-scoring situation. This means that if it really wants a non-aggression pact with you (+22) but doesn't especially want a trade treaty (-5), offering it both in the same deal will have it accept. And these numbers get shown in the GUI for making diplomatic offers to AI players, so you don't have to guess.
To make diplomatic offers to human players, the AI can put together a package of terms that it likes and that it thinks you will like too. That second part is needed because otherwise the AI would start every negotiation with "and of course you should pay me tribute", because why not, it's nice for them. Instead, it will send you an offer that, while perhaps not entirely in your favour, is at least somewhat reasonable.
The diplomacy GUI also allows you to modify offers and send them back, so you can always change it to something more to your liking.
To come to agreements with other AI empires, the game looks at the relative strength of two empires and picks an agreement that they both like, but that's tilted towards the stronger partner. This is meant to simulate the result of a bunch of negotiations.
Ultimatums
Then there's ultimatums. A good ultimatum demands something that's in your favour and threatens something scary to the target that's also an acceptable outcome for you. The classic ultimatum is "pay me tribute or I declare war", where of course you'd like tribute, but you're powerful enough that you'd also be happy with war. Meanwhile, for your victim, tribute is unpleasant, but not as unpleasant as being conquered. And this produces a pretty clear mathematical definition for what an ultimatum is. To construct an ultimatum, the AI can look through things it wants but its intended victim does not, and things it could do to its victim that the victim would really dislike. Those are the demand and threat of the ultimatum. To determine whether the AI should cave in to an ultimatum - whether sent by a human player or an AI - we can also look at the difference between the demand and the threat scores. Let's say the demand is to pay tribute and enter a trade treaty, rated at -22. But the threat is war, rated at -60. So the demand is 38 points better than the threat. This is then directly converted into the likelihood that the AI will agree to the demand, by default by multiplying it by 2. So this particular ultimatum has a 76% chance of being accepted. Unlike as with normal diplomatic offers, where you know right away whether the AI will accept, ultimatums have a probability of acceptance to make them a gamble. If they reject your ultimatum, you have to either follow through with the threat or lose a chunk of reputation.
So ultimatums can be sent from humans to humans, humans to AIs, and AIs to humans, and should be a pretty flavourful way of conducting diplomacy and getting what you want.
AI Personalities
Of course not every AI is exactly the same. All the numbers governing these evaluations can be tweaked (and modded), resulting in different personalities. Upstanding empires that don't break agreements or do ultimatums. Bullies that try to extract tribute from you but then back down from the threatened war. Lone wolves who simply want to be left in peace but will relentlessly pursue war when provoked. Diplomats who try to embed themselves into a web of pacts for safety. Traders who are mostly peaceful but won't pass up an opportunity to invade a sufficiently weak neighbour. Weaklings that will readily cave in to ultimatums. Overly principled empires who would rather be conquered than ever agree to anything they don't want. Even omnicidal maniacs who will pretty much ignore diplomacy and just attack at will. And sometimes, you also want AIs that are more emotionally driven. There already is some of this in the system I'm building, because it does consider diplomatic grievances and reputation levels in its actions. On top of that, AI personalities can have an attitude to other empires based on their past relationship. Were you at war? Have you been in a long-term stable pact? Do you own some land they consider theirs? In and of itself this isn't enough: geopolitics provide much more interesting motivations, and at the start, no one has any history with anyone else. But it can be a good additional layer for some personalities that deviate from this pure realpolitik concept.
What Remains
So yes, all this is what I've been working on. Things are going pretty well, with the AI able to make and respond to diplomatic messages. There's still a bunch of problems to work out. For example, if you successfully demand tribute through an ultimatum, the AI will immediately send you a diplomatic offer that just consists of cancelling the tribute, because after all, that would be to its advantage. And I'm working on making the user interface for this as good as I can, showing the right information in the right places, plus generous quantities of tooltips. I'm also still considering additional types of diplomatic interaction on top of the ones that currently exist, which are:
- War - A state of conflict. You may freely attack each others' fleets and conquer each others' cities.
- Truce - Formal cessation of hostilities. Automatically turns into a state of peace after five months.
- Peace - A neutral relationship. You may not send ships to each others' cities, and doing so is a declaration of war.
- Non-Aggression Pact - A promise not to attack each other. You can freely send ships to each others' cities.
- Defensive Pact - A promise to defend each other. If the other empire is attacked, you automatically declare war on the attacker. If they declare war, you stay neutral.
- Alliance - A full alliance sharing in all wars. Your ally's allies automatically become your allies too.
- Trade Treaty - Gain 5% of each others' incomes.
- Research Treaty - Gain 10% of each others' research output. Technologies the other has researched are 40% faster to research.
- Tribute - Receive 10% of their income.
Airships: Conquer the Skies
David Stark
David Stark
2018-08-16
Action Indie Strategy Singleplayer Multiplayer
Game News Posts 306
🎹🖱️Keyboard + Mouse
Overwhelmingly Positive
(5250 reviews)
http://www.zarkonnen.com/airships/
https://store.steampowered.com/app/342560 
The Game includes VR Support
Airships Linux 53 [139.2 M]Airships Linux 64 [545.79 M]
Airships: Conquer the Skies - Soundtrack
Airships: Heroes and Villains
Design steampunk pixel airships out of functional modules and conquer the skies!
In the game, ships are viewed side-on, and their modules are operated by individual crew members. During combat, players give high-level commands to a small fleet, positioning their ships, ramming and boarding others. Ships and terrain are fully destructible: they can catch fire, explode, break apart, and fall. Players can also compete against one another in Internet and LAN matches.
The ships are highly detailed, teeming with sailors moving around at their individual tasks, like an ant farm or a cut-away drawing. The player's choices in ship layout are crucial, and an important part of the game is exploring the design space of different airships and their matching tactics.
In the game, ships are viewed side-on, and their modules are operated by individual crew members. During combat, players give high-level commands to a small fleet, positioning their ships, ramming and boarding others. Ships and terrain are fully destructible: they can catch fire, explode, break apart, and fall. Players can also compete against one another in Internet and LAN matches.
The ships are highly detailed, teeming with sailors moving around at their individual tasks, like an ant farm or a cut-away drawing. The player's choices in ship layout are crucial, and an important part of the game is exploring the design space of different airships and their matching tactics.
MINIMAL SETUP
- OS: Ubuntu/Debian/Mint
- Processor: 1.8 Ghz+Memory: 256 MB RAM
- Memory: 256 MB RAM
- Graphics: 1 GB VRAM+
- Storage: 1 GB available spaceAdditional Notes: Not currently compatible with Intel HD graphics controllers. May run on other Linux distros. but no guarantees.
- OS: Ubuntu/Debian/Mint
- Processor: 2.2Ghz+ Dual-coreMemory: 2 GB RAM
- Memory: 2 GB RAM
- Graphics: 2 GB VRAM+Network: Broadband Internet connection
- Storage: 1 GB available spaceAdditional Notes: Not currently compatible with Intel HD graphics controllers. May run on other Linux distros. but no guarantees.
GAMEBILLET
[ 5951 ]
GAMERSGATE
[ 3198 ]
FANATICAL BUNDLES
HUMBLE BUNDLES
by buying games/dlcs from affiliate links you are supporting tuxDB