How do the covert ops mechanic work in Beyond Earth?
I've found a few pages online that discuss how the Covert Ops mechanic in Civ:BE works, but none of them actually use any numbers. The game explains that some Covert Ops are "Easy", "Medium", and "Hard". It also explains that intrigue level plays into the chance along with the rank of the agent.
But how do the mechanics for Covert Ops actually work? What factors determine the chance of success and how much do they affect it? Actual numbers would be preferred. I'd love to know what the actual math involved is.
Solution 1:
I decided to look into the LUA and XML files for Beyond Earth and came across most of my answer there. Interestingly intrigue level has nothing to do with chances of success or failure.
Each operation type has a base difficulty that is defined in the XML files for the game. This is used as the base number at the start of all of the covert operation calculations. I've included a table at the bottom of this answer with all of the base difficulty values. As far as I can tell Recruits have a rank of 1, Agents a rank of 2, and Special Agents a rank of 3.
Chances of Success
The formula for chance of success is:
100 - (Base Difficulty + ((Defending Agent Ranks * 5) + 5) - (Attacking Agent Ranks * 5) - (Operation Success Percent * Unassigned Covert Agents))
I was unable to determine what the constant was that is used for Operation Success Percent, but if you are not doing the Operations Reconnaissance project it will definitely be at zero. I suspect Operation Success Percent is 1 or 2 though based off of the other National Security Projects. The game also sets a minimum 10% chance for success.
Chances of Detection
The formula for chance of detection is:
Base Difficulty - (Attacking Agent Ranks * 7) + Defender Policy Modifier + (Defending Agent Ranks * 10) - (Agent Survival Percent * Unassigned Covert Agents )
Again here I was unable to determine the value for Agent Survival Percent, but I once more speculate that it is either 1 or 2 based off the bonuses given by other National Security Projects. If an agent is detected AND there is a counter-spy in the city then there is an equal (33%) chance of the agent just being detected, being identified, and being killed. The game sets a maximum of a 90% chance of detection.
Time Required for Operation
The formula for time required for an operation is:
Ceiling(((Base Turns - (Attacking Agent Ranks - 1)) + (Base Turns + (Misc Attacker Modifiers / 100)))) * (Game Scale / 100)
The number for Base Turns is defined just like Base Difficulty is, and I've included it in my chart below. Game Scale appears to be 100 for a Standard length game and 25 for a Quick game. I'm not sure about the other game speeds. Misc Attacker Modifiers I assume to be bonuses given by wonders and virtues, but it doesn't actually look like any items in the game provide a modifier here. EDIT: This is likely used to implement the ARC's unique ability.
Travel Time
The formula for travel time is:
(Base Travel Time - Agent Ranks) * (Covert Ops Travel Turns Percent / 100)
Covert Ops Travel Turns Percent appears to be a constant defined in the game. I was not able to determine the value. All travel takes a minimum of 1 turn to complete.
Covert Operations Table
Operation | Base Turns | Base Difficulty |Base Intrigue
-----------------------------------------------------------------
Establish Network | 5 | 0 | 0
Siphon Energy | 20 | 35 | 15
Steal Research | 20 | 35 | 15
Steal Tech | 20 | 50 | 20
Hack Satellites | 15 | 60 | 15
Call Worms | 15 | 70 | 100
Dirty Bomb | 15 | 70 | 100
Sabotage | 15 | 70 | 100
Recruit Defectors | 20 | 50 | 20
Coup | 20 | 60 | 50
Deliver Dossier | 0 | 10 | 5
Extract Operative | 0 | 10 | 5
This table also includes Base Intrigue, which was also in the game files. I believe that this is the amount that the intrigue level in the city is increased by when the operation is performed successfully.