Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
AI to AI diplomacy

So, the following happened today...

A friend of mine who pretty much hates the game but ends up playing it every once in a while anyway for some reason, played on Normal.
He was playing Chaos/Nature (random generated) and his plan was to turn a Chaos/Life wizard into an ally.
Things were going fairly well, he had a wizard's pact, and the relation went up to calm.
He could have made the alliance at one point if he had money, but he did not so the AI refused with the new "i expected a better offer" message which indicates they wanted gold or spells. He had a spell to give to the AI, so it was clearly gold. (bug? I thought if the AI wants money but there is no money, they try for spells. I remember fixing that recently. Weird.Investigating. Yes, it's a bug. AI wants a spell that is at least priority>=current turn. Obviously impossible 99% of the time. Wither we should make this something like (turn/8)<=priority or eliminate it altogether. Max spell priority is 54 and those are spells no one would ever give to the AI even for an Alliance.)

Anyway, he missed the chance to get the alliance. So some time goes by, now the AI has more military (was playing barbarian warlord. Yes, that's serious bad luck, he has that sort of luck all the time. Resist 9 Gargoyles died at least 70% of the time to black sleep while he was playing.) and now refuses the alliance due to that.

However he attacks another AI which has an alliance with this AI due to having peaceful personality. Books are Chaos/Life vs Nature/Sorcery so relation is about zero, but peaceful is enough to overcome that. So then the alliance forces the AI to break the wizard's pact and declaring war. And of course this is all the game's fault and mine, definitely not his for attacking that person. (who built a city on their continent, but hey, 1408...was likely the last free tile on the map, not that the AI can comprehend this anyway. Why not attack them after making the alliance? It's not like he had the armies to fight that one player, even ignoring the other AI, especially during a war with a third person and losing his largest army to an air elemental node (I also don't get why he reloaded battles with 1 gargoyle a dozen times but not losing his entire javelineer stack in the node, whatever.))

So this rises a few questions, in particular :
-Maybe the AI should not make alliances on Normal and lower difficulty?
-Alternately, maybe reducing the difficulty modifier in the AI to AI diplomacy formula was a mistake? If the difficulty modifier is high, but is set up in a way the result is unchanged in Expert, then the AI will ally less on lower difficulties. (but they ally more on Master which I think would be a problem.)
-Maybe the AI should not use only their own personality in the formula? As is, the human does get the advantage of making alliances with the peaceful wizard, but if they wanted to attack that one and be on good terms with the ruthless one instead (which depending on book colors or overall game state can be the good choice) they do not have this sort of advantage while that Peaceful AI still enjoys the Peaceful benefit in making an alliance with a Ruthless wizard. So maybe the formula should be the average of the two personalities, instead of only one of them?

His other complaint was he expected the Chaos/Life wizard to declare war on the nearby Death wizard. This never happened - Militarist is scaled by game turns and the game was only played up to 1408 so it couldn't work (otherwise it should have eventually triggered as Barbarian Warlord was far ahead in military strength). Generic was was not an option due to the difference. Relation wasn't low enough (0 alignment vs -10) to force an automatic war. Hostility rolls had, if I remember the formula well, 52% chance of turning hostile every time, but either his bad luck, or the fact the AI has no curses and due to low difficulty, no relevant forces to actually attack with, so even if hostile, not war happens as nothing worsens relations resulted in nothing happening at all until 1408.
Ultimately, all the mechanism we added to make sure the AI doesn't declare too much war on the human, resulted in the human unhappy because the AI wasn't declaring war on itself.
I don't really think anything can be done about this one, nor do we need to, just saying, less war even if beneficial to humans, makes them unhappy. Anything short of directly helping them by making AI's fight each other is just not enough to satisfy...quite a lot of players I think. But doing that would make the game way too easy.
Reply

I think that would probably be fine to implement for the lower difficulties. Something like don't change expert and above, but for the lower difficulties, do a progressive chance where things like peaceful on fair would get the full penalty of the ruthless modifier, on normal it might even get a reduced bonus for being peaceful when doing relations with other ai, on advanced (which I think is harder than fair?) they would get half the penalty of the ruthless modifier?
Reply

Do we need to scale that by difficulty?

I mean, do we need the peaceful+peaceful to have the same chance of an alliance or wizard's pact as peaceful+maniacal on high difficulty?

Let me think, the only downside to that is, if the human does manage to take advantage of peaceful, but the maniacal wizard does not, then the human can, if at war with the maniacal, request the peaceful to also declare war on the maniacal. So basically, it increases the likelihood of your peaceful ally actually helping you instead of just getting allied with all 4 players and the alliance only being useful to prevent that AI to attack you when you fight their enemies.
But for that to actually happen, since the average of peaceful and maniacal is still 27 so above average, the two wizards have to be on a quite bad relation, especially on high difficulty where the difficulty modifier is slightly higher.

I'm not sure I see anything wrong with the player being able to ask their allies to declare war on shared enemies those wizards should be hating anyway.

(yes, technically, peaceful+maniacal rolls on maniacal chances every second time, so instead of rolling 50%, 50%, 50%, 50%, they get 50%, 0%, 50%, 0% etc. But the peaceful rolls have high enough success rate that making half as many rolls still guarantees it happening even on the timescale of 3-4 years. Although using the average would then just do all 25% rolls and it's not much different (it's slightly lower chance as two 25%s is less than one 50% but not that much less). Ok this maybe wasn't a very good idea.)

Maybe the formula is still not fine tuned enough and still offers a too high % chance of getting a treaty per roll? What chance do you think would be ideal, per roll (assuming 1 roll each year on average, per wizard, slightly more on higher difficulty), for each personality/difficulty/current relation combination? (yeah that's a lot of cases actually, 3 variables...)

Do note the AI's also roll for hostility meanwhile as well as check war declaration rules, so they don't have an infinite time to roll a success on the treaty unless they are both lawful/peaceful, as they might end up fighting, which further complicates this.
Reply

I calculated the actual percentage chances current formulas result in. (real percentages are slightly lower on the pact as the random number is a sum of two random generations, not a single random number, but the difference is small)
   

Relation going from the very bad to the very good (like opposite books and identical books) is a 75-100% difference in wizard's pact probability, and I think that's about right. We don't want any treaties between wizards of enemy realms.

Difficulty increases probabilities by about 10 to 25% (higher on worse personalities). This seems to be about right as well.

The effect of personality is also roughly 100% (going from Maniacal to Peaceful). I think this is way too much. While personality should be a major effect, it should be secondary to relation scores. 

   

This is what we could have if Personality had halved effect and we moved the required total roll threshold to an appropriate position for that.

I believe this would be much better.
Reply

   

Same table for alliances and trading, this shows what I think would be good for a new version (using the same halved personality formula).

For alliances, note the AI needs a good starting relation (similar realms) otherwise the natural gravitation will not allow REL to grow to 66 and will likely stop at 40 or even below.

Also, the AI does not have a hard threshold of 40 relation required for alliances, but with that table, the chances of it happening below 40 are close to zero so that should be fine. (Peaceful on Lunatic might sometimes score one at, idk, 35 maybe?)

I'm not entirely sure what relation we want the AI to start trading at, and what relation they want maximal chance at, but this is my best guess.
Reply



Forum Jump: