There was a question in another thread about what AI diplomacy model might be appropriate for freeciv. Since I am trying to program such a model, I will briefly spell out what I've been trying to do and hope that people can contribute some ideas or links to discussions about this topic.
First of all, you need to realize how diplomacy in freeciv works. When two players "meet", each has a window in which various proposals are put forth, and then each player might "ok" or not the entire deal.
So what is needed is some kind of model to estimate whether such a deal is beneficial to the AI or not (and also if doing the deal will make the game fun). What I did was to try to convert every proposal into a gold value. The worth of treaties between players are estimated by looking at our desire for war or peace with that player, and his relative military strength.
The AI will pick one player as his main target, and attempt to achieve peace, cease fire or alliances with every other player while pounding on this target. The target selection depends on three factors: economic strength (gang up on and bring down the strongest), relative military strength (try not to be suicidal) and spacerace (always attack someone who is about to win by space race unless he is your ally).
The target will be frozen for some turns, and then the viability of continued war will be evaluated by looking if there now are other targets that really should be dealt with instead. Otherwise, continue until target is dead, then repeat on next target. There might also be some code later to check if the war has degenerated into a stalemate, or if we are losing it (ooops!) by checking the relative development of our economic strength during the war.
(BTW, part of the patch will be the possibility to win as an alliance and share the score. This is not currently possible.)
Opinions/flames/criticism/ideas welcome
First of all, you need to realize how diplomacy in freeciv works. When two players "meet", each has a window in which various proposals are put forth, and then each player might "ok" or not the entire deal.
So what is needed is some kind of model to estimate whether such a deal is beneficial to the AI or not (and also if doing the deal will make the game fun). What I did was to try to convert every proposal into a gold value. The worth of treaties between players are estimated by looking at our desire for war or peace with that player, and his relative military strength.
The AI will pick one player as his main target, and attempt to achieve peace, cease fire or alliances with every other player while pounding on this target. The target selection depends on three factors: economic strength (gang up on and bring down the strongest), relative military strength (try not to be suicidal) and spacerace (always attack someone who is about to win by space race unless he is your ally).
The target will be frozen for some turns, and then the viability of continued war will be evaluated by looking if there now are other targets that really should be dealt with instead. Otherwise, continue until target is dead, then repeat on next target. There might also be some code later to check if the war has degenerated into a stalemate, or if we are losing it (ooops!) by checking the relative development of our economic strength during the war.
(BTW, part of the patch will be the possibility to win as an alliance and share the score. This is not currently possible.)
Opinions/flames/criticism/ideas welcome
Comment