Improvement Ideas: Move Troops from Borders Request

Recursive

Already Looping
Moderator
Supporter
Joined
Dec 19, 2017
Messages
4,683
Location
Antarctica
So I've seen a fair number of complaints about the current mechanics for the AI requesting that you move your troops from their borders.

I'll post the current code here, translated into plaintext. If you have any suggestions on how to improve the mechanic, I'd love to hear any replies.

The AI will send a request that you move your troops from their borders if the following conditions are met:
Code:
CvDiplomacyAI::DoAggressiveMilitaryStatement

(note: Player = the player whose troops are near the AI's borders)

Check if *one* of these two conditions are true:
- Player has a military aggressive posture of HIGH this turn and they didn't last turn
- Player has a military aggressive posture of MEDIUM this turn, and last turn they had a posture of NONE

If either condition is true, then send the statement, unless one of these is true:
- Player is already at war with this AI;
- Player is not able to declare war on this AI;
- Player resurrected this AI;
- Player and this AI have a Declaration of Friendship;
- AI has given this player Open Borders in AI's lands;
- Player and this AI are at war with any common foe;
- Player is at war with any of this AI's neighbors (player proximity NEIGHBORS);
- AI has already sent this message within the past 40 turns.

If none of the above conditions are true, the message is sent.

Military aggressive posture is determined by the following function:
Code:
CvDiplomacyAI::DoUpdateOnePlayerMilitaryAggressivePosture

1. Don't run this function for teammates, unmet players, dead players, players with 0 cities, and Barbarians.

2. Don't run this function for players that AI has a Declaration of Friendship with or has given Open Borders to.

3. Store the military aggressive posture last turn, before we update it for this turn.

4. Loop through all of this player's units.

4a. If the unit is a non-combat or scouting unit, ignore it.
4b. If the unit is on a plot that we can't see, ignore it.
4c. Assume the unit has 2 movement. If it can't reach any of our cities within 4 turns of movement, ignore it.
4d. Assume the unit has 2 movement. If the player who owns the unit is at war with another player, AND this unit could reach one of that player's cities within 4 turns of movement, AND that other player is alive, then ignore it.

5. If we got here, then the unit is threatening to us. Add 10 threat value.

6. If the unit is within the player's own borders, halve the threat value to 5 (since they may just be defending their own lands).

7. If threat value is...
80 or higher: Aggressive posture is INCREDIBLE.
50-75: Aggressive posture is HIGH.
30-45: Aggressive posture is MEDIUM.
10-25: Aggressive posture is LOW.
0-5: Aggressive posture is NONE.

NOTES
- You are supposed to be able to request that the AI move their troops if you are not at war with them, you have not requested this within the past 30 turns, and the AI's aggressive posture towards you is at least MEDIUM.

- If aggressive posture towards the AI is at least LOW, you will see the opinion modifier "Your military deployment is threatening."

- If it is at least HIGH, you will see the opinion modifier "Your military deployment is extremely threatening."
 
Last edited:
I'm not sure about the logic on open border. If I understand correctly, currently, if I buy open border to an AI and send my army through their territory, they will feel threatened. But if I sell open border to an AI, and put a huge army in front of their border, they will say nothing. That seems wrong to me.

I see that the aggressivity does not take in account the size of the border (10 units nearby one city, or 10 units along a 10-cities border, are seen as the same). I know that's complex to take in account, and that it is only relevant in corner cases, but that's the first flaw that came to my mind.
 
I feel like I get those requests when I bulk-upgrade units in one turn, which maybe shouldn't trigger it (as no unit has actually moved towards the AI)?
 
I'm not sure about the logic on open border. If I understand correctly, currently, if I buy open border to an AI and send my army through their territory, they will feel threatened. But if I sell open border to an AI, and put a huge army in front of their border, they will say nothing. That seems wrong to me.

I see that the aggressivity does not take in account the size of the border (10 units nearby one city, or 10 units along a 10-cities border, are seen as the same). I know that's complex to take in account, and that it is only relevant in corner cases, but that's the first flaw that came to my mind.

If they have given you Open Borders, they will not feel threatened by your military. You giving them OB does nothing. I updated my wording for clarity.

It is true that it only counts the number of units, not the concentration in one area, but I'm not sure how that could be improved. Open to suggestions!

I feel like I get those requests when I bulk-upgrade units in one turn, which maybe shouldn't trigger it (as no unit has actually moved towards the AI)?

It shouldn't. If you have a save where that happens and it isn't meeting the above conditions, report it on Github.
 
So I'm curious, what does having this mechanic actually add to the game? It gives you a choice, obviously: Declare now and lose the advantage, or promise not to declare and then decide what to do with it, with appropriate consequences for those actions. This gives the attacked player a one-turn advantage to position their defensive troops and/or eliminate a few attackers. In some cases, this can be a huge difference; in the majority of cases, in my experience, it's basically meaningless since it's not like you were going to swoop in and take that city in one turn anyway. "All wars start as defensive wars" is a quote used often here, and it's true; very often the first thing I do after declaring is immediately press "Next Turn" without actually moving any units, since I'm planning to try to meatgrinder them anyway.

More importantly, though, is this: Fully 90% of the time I encounter this dialog, it's an incidental trigger from someone I had no intentions of attacking anyway. I very, very rarely run into this from someone I was intending to attack, and if I do, it's probably because I planned to. Once in a blue moon, it catches me a turn or two early and I have to scramble a tiny bit to establish a foothold.

I would personally be open to the idea of scrapping the "move or declare" interaction entirely and replacing it with a simple warning from the AI that they suspect you of ill intent, simply so that the player knows when they trigger it accidentally so they can move their troops, or something along those lines. I don't personally feel like it adds much to the game, and it's a frequent cause of annoyance.

I'm sure that won't happen and there's probably good reasons for that which I haven't considered, but that's my thoughts.
 
So I'm curious, what does having this mechanic actually add to the game? It gives you a choice, obviously: Declare now and lose the advantage, or promise not to declare and then decide what to do with it, with appropriate consequences for those actions. This gives the attacked player a one-turn advantage to position their defensive troops and/or eliminate a few attackers. In some cases, this can be a huge difference; in the majority of cases, in my experience, it's basically meaningless since it's not like you were going to swoop in and take that city in one turn anyway. "All wars start as defensive wars" is a quote used often here, and it's true; very often the first thing I do after declaring is immediately press "Next Turn" without actually moving any units, since I'm planning to try to meatgrinder them anyway.

More importantly, though, is this: Fully 90% of the time I encounter this dialog, it's an incidental trigger from someone I had no intentions of attacking anyway. I very, very rarely run into this from someone I was intending to attack, and if I do, it's probably because I planned to. Once in a blue moon, it catches me a turn or two early and I have to scramble a tiny bit to establish a foothold.

I would personally be open to the idea of scrapping the "move or declare" interaction entirely and replacing it with a simple warning from the AI that they suspect you of ill intent, simply so that the player knows when they trigger it accidentally so they can move their troops, or something along those lines. I don't personally feel like it adds much to the game, and it's a frequent cause of annoyance.

I'm sure that won't happen and there's probably good reasons for that which I haven't considered, but that's my thoughts.

The AI is being tuned in the next version to avoid starting attack operations if they aren't actually interested in conquest, so that strategy may be less worthwhile soon.

The purpose of the mechanic is to trigger the "military promise". If the request is sent, you can either declare war, which grants you a permanent opinion penalty with that AI for refusing to move your troops, or promise not to declare war on them for 20 turns. If you break this promise, you get a global diplo penalty with every civ whether they've met you or not, and a larger penalty with the specific AI you betrayed.

AI players also receive these penalties if they break/ignore the promise, which can be made between AIs too.

The idea is that the AI is trying to get you to declare now or face a global diplo penalty for trying to get the drop on them.

This mechanic is a Firaxis decision, not a VP one.
 
This mechanic is a Firaxis decision, not a VP one.

Sure, and I hated it in vanilla a lot more than in VP, since VP enables the player to do it as well. VP made it tolerable.

Does that mean it's hard coded such that we couldn't do away with it even if we wanted to?
 
If the request is sent, you can either declare war, which grants you a permanent opinion penalty with that AI for refusing to move your troops

That makes little sense to me if I understand it correctly. Permanent penalty for refusing to move my troops but not for declaring actual war. I didn't refuse to move my troops, I moved them into his territory right away.


Fully 90% of the time I encounter this dialog, it's an incidental trigger from someone I had no intentions of attacking anyway.

In my case it's about 50%. AI often spots my effort of accumulating troops close to his borders as I prepare for invasion and presents me a choice of either let him do the first move on his turn or cancelling my attack until I can manage to do a sudden alpha strike next time. I realize many advanced players declare war and don't advance in order to let the stupid AI come to them to be destroyed more easily. Not in my case.
I quite like this mechanics actually.
 
Sure, and I hated it in vanilla a lot more than in VP, since VP enables the player to do it as well. VP made it tolerable.

Does that mean it's hard coded such that we couldn't do away with it even if we wanted to?

It is possible to remove it rather easily. But, personally, I'd be inclined towards improving it rather than removing it - there's no clear consensus that it's a super unpopular mechanic.

That makes little sense to me if I understand it correctly. Permanent penalty for refusing to move my troops but not for declaring actual war. I didn't refuse to move my troops, I moved them into his territory right away.

In my case it's about 50%. AI often spots my effort of accumulating troops close to his borders as I prepare for invasion and presents me a choice of either let him do the first move on his turn or cancelling my attack until I can manage to do a sudden alpha strike next time. I realize many advanced players declare war and don't advance in order to let the stupid AI come to them to be destroyed more easily. Not in my case.
I quite like this mechanics actually.

Declaring war normally gets you only the warmongering penalties, plus extra penalties if you declared war on a friend. Declaring war when the AI sends this request gives you an additional permanent opinion penalty with that AI, although it's less severe than the one for breaking a promise, and is not global.

In summary, after the AI sends the request:

"You're right to worry, and it's time for you to die. (DECLARE WAR)"
Declares war with the usual penalties, and also applies an additional permanent penalty: "You refused to remove your troops from their borders when they asked!"

"We mean no harm. Our troops are merely passing through the area."
Makes a 20-turn promise not to declare war on that AI. If kept, no diplo penalty. If broken, a large diplo penalty with that AI, and a global diplo penalty with all AIs (both of which are permanent), regardless of if they've met you or not.
 
Declares war with the usual penalties, and also applies an additional permanent penalty: "You refused to remove your troops from their borders when they asked!"
Thanks for the explanation.
This sentence makes little sense to me. Like they put an additional blame on me for refusing to move my troops away from their border. I didn't refuse, I declared war on them. Whether I kept them on their borders or moved them away AFTER I've DOW'd them is no longer relevant, imho.


I really don't like permanent diplo penalties or any penalties that last more than two eras.

I generally agree. I'd extend it for about 3 eras, and only for the most severe "crimes", like attacking a friend or attacking after having promised not to.
 
Backstabbing and breaking promises should be permanent. Refusing to make a promise or insulting leaders should not.
 
I really don't like permanent diplo penalties or any penalties that last more than two eras.
I partially agree with it, but I would rather go on the other direction. "Crime" that are currently given a permanent diplo penalty are here to punish the player for exploiting the AI in ways that cannot be effectively predicted by the game. But I'd rather have them being replaced by unbreakable promises.

For example:

"You have too many troops nearby, are you about to declare war to us?.
A: Yes (declare war).
B: No, I promise you so (unilateral peace treaty for 10 turns)."

(Note: I'm not sure unilateral peace treaty are a thing possible in the code, but that would be great if it was)
 
Unilateral peace treaty is just unfair. Better make it mutual if it must be changed.
 
  • Like
Reactions: 4CV
I really don't like permanent diplo penalties or any penalties that last more than two eras.

Agreed 100%. It feels like major cheese.

I partially agree with it, but I would rather go on the other direction. "Crime" that are currently given a permanent diplo penalty are here to punish the player for exploiting the AI in ways that cannot be effectively predicted by the game. But I'd rather have them being replaced by unbreakable promises.

For example:

"You have too many troops nearby, are you about to declare war to us?.
A: Yes (declare war).
B: No, I promise you so (unilateral peace treaty for 10 turns)."

(Note: I'm not sure unilateral peace treaty are a thing possible in the code, but that would be great if it was)

I like this quite a bit, although probably not at your example number. Would probably need to be at least double before I would feel actually penalized by it; 10 turns is just a fairly minor delay in my plans, particularly anytime before the late game.

Unilateral peace treaty is just unfair. Better make it mutual if it must be changed.

How so? It seems fine to me; the aggressor is simply reassuring a concerned leader that he's not attacking.



Though that does bring up an interesting idea; interesting to me, at least. It'd be neat if you could sign some sort of enforced non-aggression pact, and even neater if such a thing could be coded to be usable with civs that don't particularly like you. I know there are many times when the only thing holding me back from taking down a civ that should be a concern to both myself and another neighbor is that self-same neighbor; he doesn't like me and I know if I attack our theoretical mutual enemy, there's a decent chance of being flanked. If we could sign or trade something that said "neither of you can declare war on the other for 30 turns" or whatever, I could focus on the "real enemy."

The AI is being tuned in the next version to avoid starting attack operations if they aren't actually interested in conquest, so that strategy may be less worthwhile soon.

Now that's just plain rude.
 
Last edited:
A condition I find on occasion: the AI has expanded its territory to a tile adjacent to my idling warrior, and by such expansion thereby invokes the 'move it' message.
 
I can remove the diplo penalty for refusing to make the promise, or put it on a timer.

Any other suggestions?
 
Put it on a timer.
A condition I find on occasion: the AI has expanded its territory to a tile adjacent to my idling warrior, and by such expansion thereby invokes the 'move it' message.
That's his territory now. Move it or make the promise.
 
  • Like
Reactions: 4CV
I can remove the diplo penalty for refusing to make the promise, or put it on a timer.

Any other suggestions?
Make all "promise refusals" expire over time, like refusing to not spy, not settle nearby, not send missionaries, etc. Also do it for insults like "You'll pay for this in time."
 
Top Bottom