Jump to content

Diplomacy and AI behaviour


Recommended Posts

I had some ideas for how AIs may act depending on diplomacy.

Since I found no exactly fitting topic I'll start a new one. I hope that's OK. Otherwise feel free to join this with an older topic like:

http://www.wildfireg...showtopic=14070

http://www.wildfireg...showtopic=16484

http://www.wildfireg...showtopic=16665

http://www.wildfireg...showtopic=15313

http://www.wildfireg...showtopic=15150

A rough description of how AIs could react to player interaction dependent on diplomacy:

-- General:

- The AIs store "favor points" for each other player starting with 0.

- The AI focuses attacking the player with the least favor.

- The AI offers a "peace treaty" to the player with the most favor.

-- Depending on time:

- If the sum of an AIs favor for all other players is > 0 each players favor increases over time.

- If the sum of an AIs favor for all other players is < 0 each players favor decreases over time.

(Additionally the values absolute could drop over time by e.g. 1/10 each 10 seconds to simulate "forgetting"/"forgiving")

-- Depending on kills:

- Favor decreases for a player if that player kills an entity of the AI

- Favor increases in an AI for a player if that player kills enemy entities (not owned by that player) inside the AIs teritory.

-- Depending on tributes:

- A player gains favor for an AI if he gives tributes to that AI.

Reaction if a player offers an AI a "peace treaty":

- The AI sends that player a message telling him how much tribute that player has to provide to reach the "first rank" in the favor list (perhaps only if his favor is > 0, otherwise the player has to "guess" how much tribute is needed).

Reaction on best favor change:

- The AI tells the former ally how much tribute it will cost him to keep this alliance (tribute depends on how far the "new" high favor player is apart in terms of favor).

- If the former ally does not react in a current amount of time (e.g. 1 min) he cancels his old alliance and offers a "peace treaty" to the new highest favor player.

Reaction on a peace offer denied by an other AI:

- Decide if the value of the requested tribute is worth it and pay it if it's worth it (see below).

Problems and further questions:

-- Scaling:

- Time (press average to 0): Indeed this could be instant: A favor value has changed -> for all players: favor - sumOfFavorOfAllPlayers / numOfOtherPlayers

OR it could depend on time indeed: Every 10 seconds: for all players: favor - sumOfFavorOfAllPlayers / numOfOtherPlayers / 10

- Time (forget/forgive): See above.

- Kills: The amount of favor gained/lost by kills should depend on the actual population of the AI e.g. 100 / (actual population + 1).

- Tributes: The value in favor of a resource type should depend on the AIs needs. So it could be: resourceAmountGivenOfA Type / (AIsActualAmountOfThatResource + 1/3 * amountOfThatResourceInsideTheAIsTeritory).

-- Determine the worth of a players alliance:

- That should depend (easiest) on the players actual population (and maybe the territory he has claimed and perhaps on the amount of resources he has). Most fitting would be the total worth of a player (sum of the resources all his entities costs + his actual resources, NOTE: For this to work well entities resource costs would need to be balanced and they are far from being balanced right now!).

Edited by FeXoR
Link to comment
Share on other sites

I think this is a good start, ambitious as i am, imho the final version will be far more complicated than this. First because you're describing a mercenary AI, that allies with whomever gives it more money, and imo there should be more reliable "personalities". This said, we just have to keep in mind some players will surely try to abuse the easyness of creating and breaking alliances, so we'll have to make AIs analyze deeply both the player's past actions in a match and what good that alliance would bring for both parts and how it would affect the game as a whole (would any other players shatter their alliances or start working together too? If so, is that event dangerous to your own kingdom?).

Link to comment
Share on other sites

Yeah, i was right now thinking those TBS games have much to teach us AI-wise...

well, i'm a TBS games fan, so i will be very happy if these diplomacy modifiers will be included, but i must say that even a simplified version like the one that it's implemented in the actual SVN code could be enough for a RTS game :)

Link to comment
Share on other sites

well, i'm a TBS games fan, so i will be very happy if these diplomacy modifiers will be included, but i must say that even a simplified version like the one that it's implemented in the actual SVN code could be enough for a RTS game :)

I'm a fan, too, mainly of Civilization and Heroes of Might and Magic series, and i'm, too, looking forward for some of these features, at least those modifiers listed at the bottom of the page.

Link to comment
Share on other sites

Ai needs to surrender if you get a kicka... Battle. if Ai offers surrender you must propose to it be Ally or Client player (Vassal).

This concerns "victory/defeat condition" not diplomacy.

If Ai beat you (not absolute defeat) they offers a peace if you: Lose in 1-1 match. in Multiplayer, give Tribute, some units, an maybe a extra territory an Ally with in against other opponent. in all Ai/players against you obviously but in ally vrs ally you must be change to team for example 2 vs 2 be a 3 vs 1.

I'm not sure I get this right but it seams something like "game settings" are mixed in here. My description is purely for an AI player that has the same possibilities as a human player in a game where diplomacy is enabled.

you can force a peace if all factions lacks of Citizen soldiers (perfect in a 1vs1 game). the peace be 15 minutes or less.

This is independent of diplomacy as well.

in mode screen you can choose a initial ceasefire to 10-30 min. see Empire earth II

This would be a possible game setting that indeed does interfere with diplomacy. But implementing this befor diplomacy works would be quide pointless ^^.

same last but for Initial to first player in game to research III Phase.(a tech Run XD)

This would be a possible "victory/defeat condition". Nothing to do with diplomacy.

In All Nautral players map (free deplomacy setting) the Ai can be negotiate with all Neutral playesr and in 15 don't make a treaty they change to enemy (in Hard level Ai) with player that don't answer they request.

yes that be conditionated by Level of the Ai.(that my opinion)

Easy! Fist make it work, then make it have difficulty settings.

Edit: Since hard AIs are likely to cheat they will have more resources and units in total so the effect of a non-cheating human player will be quite low (see the "scaling" part close to the end of the first post). It "naturally" scales with the difficulty settings and does not need to be further tweaked.

Please try to stay close to the topic ;)

Edited by FeXoR
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...