azum4roll's Espionage Rework Draft

azum4roll

Lost the game
Joined
Jul 17, 2018
Messages
4,017
Location
Somewhere
I'm with @Enginseer that if you want CS spies and major civ spies be balanced with each other, the easiest thing would be simplifying major civ spying to have automatic missions (= CS rigging in strength) + active button (= coups in strength). So I've come up with the following proposals:

Proposal 1

Number of spies
Base number = 1 + Number of CS at game start / 10
All spy gains are multiplied by this base number, except the initial English spy.

Shadow Networks
+3% culture per active spy, divided by base number. Still capped at 30%, but it's not like you can reach there.


Proposal 2

All duration mentioned below does NOT scale with game speed.

Spy rank: Recruit = 1, Agent = 2, Special Agent = 3, not affected by England UA
Spy level = spy rank for non-England civs, and spy rank + 1 for England

Travel time
Travel time to any city is simplified: 1 turn if target city is :c5trade: connected to your capital (need Open Borders if other major civ, or Friendship if CS), and 2 turns if not. This is determined when the spy is sent out and won't change even if :c5trade: connection is gained/lost while it's traveling.

Establish surveillance
Foreign city: base 5 turns, -1 turn per spy level above 1 and -1 turn if Popular to target civ.
Own city: instant


Proposal 3

Spy Experience
Currently, there are two types of function calls to level up a spy.
  • LevelUpSpy(uiSpyIndex) simply raises the rank of the spy. Experience is retained. Only used in one situation in VP (likely unintended, see below).
  • LevelUpSpy(uiSpyIndex, iExperience) adds experience to the spy, and ranks it up if it has 100 experience or more. All excess experience is discarded when a spy levels up this way.
The second call can feel bad if your spy has 95 experience and gain 50 more. I propose we remove this experience discarding mechanic.

By the way, uncovering intrigue for "building up an army for a naval attack" currently uses the old method of having 15% chance to level up the spy. This is likely an oversight when switching to new experience model and should be changed to +25 experience instead like the land attack version.


Proposal 4

Automatic missions

When your spy finishes establishing surveillance, you get vision around the city (same as CS) and a list of "automatic" missions to pick from. Every 15 turns (same as election rigging time), all foreign spies in the city would fight it out (using the same mechanics as rigging) to determine which spy gets to do their mission for the next 15 turns. No spy deaths or identifications occur here unless a counterspy is present (more on that below).

List of automatic missions (names not final, need suggestions):
Steal Food: -50% :c5food: Food per turn in the target city, and the lost amount is added to your :c5capital: Capital. This does not affect Distress calculation.
Steal Gold: -50% :c5gold: Gold per turn in the target city, and the lost amount if added to your treasury. This does not affect Poverty calculation.
Steal Research Materials: -50% :c5science: Science per turn in the target city, and the lost amount is added to your research progress. This does not affect Illiteracy calculation.
Spread Heresy: -50% :c5faith: Faith per turn in the target city, and the lost amount is added to your global Faith pool. Also -50% Pressure emitted by the target city (this is especially useful against India who relies on high base pressure).
Kidnap Specialists (against Capitals only): -1 :c5greatperson: GPP per Specialist in the target city, and +1 :c5greatperson: GPP per Specialist in your :c5capital: Capital (stackable).

All numbers above are diminished by half of the target city's security level (will be shown on the notification when the mission starts). Stolen yields are calculated based on the base yield, pre-modifiers. For example, if the target city has 100 :c5science: +60%, security level is at 30% and the Steal Research Materials mission is active, the siphoned amount is 100 * 50% * (1 - 30% / 2) = 42.5 :c5science:. This amount is recalculated per turn using the current city yield, but keeping the security level at the start of mission.

Automatic missions last for up to 15 turns as long as the spy stays in the city. The target is notified when a mission starts or ends (some spy is stealing X yield in the city Y). At the end of the 15 turns, you get another event popup and can pick a mission again.

Detailed explanations of what happens on the "election" turn (it's basically just like that):
When a spy has finished establishing surveillance, they enter the "Gathering Intel" state and starts gaining "intel" points equal to (spy level)^2 per turn. Spies gain double the amount if owner has the Covert Action tenet. Counterspies gain double the amount if owner has the Police State tenet.
On election turn, all intel points are used as weights to randomly determine the "winner". The winner in this case gets to carry out their automatic mission. Intel points are reset to 0 for the winner.

Tactical missions

The coup equivalent are the "tactical" missions, which your spy can attempt at any time after surveillance is established. Pressing the button would bring up a list of tactical missions, each with a different base success rate. Final success rate is determined by spy level, counterspy level, policy, security level, open borders, tech/policy count difference and number of times the spy has carried out automatic missions in this city, just like how coup rate is calculated. If the spy fails, it dies. Either way it's identified and triggers a diplomatic penalty. The target city cannot be hit by another tactical mission for 10 turns.

List of tactical missions (names not final, need suggestions):
NamePrerequisiteEffectBase success rate
Steal a techTarget must have at least one tech you haven't researched.Gain one tech the target has researched that you haven't.50%
Steal a Great WorkTarget city must have at least one Great Work.Steal a random Great Work in the target city.50%
Arm the local populaceTarget city must be unhappy.Target city enters resistance for 2 turns. 5 Rebel units spawn around the city. No :tourism: Tourism is generated in the city for 10 turns.50%
Sabotage rural infrastructureSpy must be level 2 or above.
Target city must have at least one pillageable improvement on a resource tile that's not a Fort or Citadel.
All improved resource tiles owned by this city are pillaged. Each road/railroad also has a 50% chance to be pillaged. Does not affect Forts and Citadels.40%
Target city defenseSpy must be level 2 or above.All Forts and Citadels owned by this city are pillaged. City is blockaded, cannot perform :c5rangedstrength: ranged strike or benefit from extra :c5strength: strength from buildings for 3 turns.40%
Sabotage city productionSpy must be level 2 or above.
Target city must be producing something (not Process).
Completely remove all progress towards the current :c5production: production. Reduced production is capped at 10 turns of current city :c5production: production. It does not undo investments.60%

Formula for success rate
B = Base success rate, differs from quest to quest
C = Counterspy level, 0 if not present
D = Spy level difference (your spy - counterspy). Target spy level is counted as 0 if there's no counterspy.
P = Policy Modifier, 1 if having Covert Action, 0 otherwise
N = Number of times your spy has attempted an automatic mission. This count is reset when the spy leaves the city.
S = Security level, ranged from 0% to 100%
O = Open Borders Modifier, 20% if target's borders are (peacefully) open to you, 0 otherwise
T = Tech/Policy difference (theirs - yours). It compares the tech count and policy count only, and doesn't factor in tech/policy choices. Bottomed at 0 for each category, i.e. T = max(0, tech difference) + max(0, policy difference)

Modded base success rate M = B * 3 / (C + 3) + 20% * N * (D + 4) / 4 if D is positive (or 0), and B * 3 / (C + 3) + 20% * N * 4 / (D + 4) if D is negative
Exponent E (aka number of rolls) = 1 + P + O + 0.1T - S
Final success rate = 1 - (1 - M) ^ E, similar to how coup success rate is calculated.

This means you can only ensure a 100% success rate through keeping the spy in the city for a long time. Using a high level spy and facing off a low level counterspy (or no counterspy) speeds up this process. Other modifiers merely increase the number of rolls. The defending side should make sure to send a counterspy if they notice the city keeps being hit by automatic missions!

Security level

Security level and spy resistance are merged back into one thing (no more sliding mechanism), determined by traits, buildings, policies, population, trade routes, public works, local happiness. Counterspy is NOT accounted into this to not reveal its presence. It's shown as the star rating on the espionage screen.

The Formula
Base security level = 50%

Negative:
  • -4% per city :c5citizen: population
  • -8% per excess :c5unhappy: unhappiness
  • -2% per :trade: trade route from/to this city
Positive:
  • +1000% before anyone reaches Renaissance or everyone has gained their first spy, whichever is easier to implement
  • +25% for England
  • +25% from Empiricism policy
  • +15% from Bletchley Park (global)
  • +10% per Public Work
  • +25% from Constabulary
  • +33% from Wat
  • +25% from Police Station
  • +1% per city :c5citizen: population if Police Station is built
  • +10% from Military Base
  • +15% from National Intelligence Agency
  • +100% from Great Firewall
  • +25% from Piazza San Marco

Counterspying

Counterspies can also fight for automatic missions every 15 turns with a bonus (mentioned above). If a counterspy wins this, +1 :c5happy: in the city and no foreign auto mission effect occurs for the next 15 turns, and the following effects occur depending on spy level and buildings in the city/empire:

Constabulary built in the city:
Counterspy owner gains 25 :c5culture: and 25 :c5science:, scaling with era, and identifies (+kicks out) all foreign spies.

Counterspy level 2 or above + Police Station built in the city or White Tower built in any owned city:
All foreign spies are captured. For each captured spy, you can pick one of the options below via event popups.

(X = rank of the captured spy)
Event choicePrerequisiteDescription
Release spyNoneThe captured spy returns to hideout.
Imprison spyNoneThe captured spy is unavailable for use for 5X turns.
Triggers a negative opinion with the spy owner.
Release spy after ransom paidConstabulary built in city.
Spy owner must have the gold to pay.
You gain 50X :c5gold: Gold while the spy owner loses the same. Amount scales with era.
The spy owner is notified of this.
Release spy after intel gatheredPolice Station built in city.You gain 50X :c5science: Science, scaling with era.
The spy owner is notified of this.
Turn spy into double agentDouble Agent tenet, you must have the gold to spend.Spend 100X :c5gold:, scaling with era. For the next 15 turns, you gain :c5science: Science as if the captured spy is doing the "Steal Research Materials" automatic mission in the spy owner's capital.
The spy owner does not lose :c5science: Science and is NOT notified of this, and instead gets a notification as if the spy is released.
Make effective propaganda with spyPolice State tenet+5 :c5happy: Happiness in the city and +15% :c5strength: on all military units for 5X turns (the duration stacks). The captured spy is unavailable for use for 5X turns.
Triggers a negative opinion with the spy owner.

Counterspies also have their own tactical mission: Capture Foreign Spies, that's available only if the counterspy is level 3 or above.
Attempt to capture all foreign spies immediately. For each foreign spy, the below outcomes can happen:
1. The spy is captured. This triggers the above event from capturing spies.
2. The spy is killed. This does not identify the spy, but the owner loses it.
3. The spy escapes and goes back to the hideout.

Formula for success rate
D = Spy level difference (counterspy - spy)
P = Policy Modifier, 1 if having Double Agent, 0 otherwise
N = Number of times your counterspy has attempted an automatic mission. This count is reset when the counterspy leaves the city.
S = Security level, ranged from 0% to 100%

Base success rate B = 60%
Modded base success rate M = B + 20% * N * (D + 4) / 4 if D is positive (or 0), and B + 20% * N * 4 / (D + 4) if D is negative
Probability of Outcome 1 (P1) = (1 - (1 - M) ^ (P + S - 1) / 2
Probability of Outcome 2 (P2) = (1 - (1 - M) ^ (S - 1)) / 2
Probability of Outcome 3 (P3) = 1 - P1 - P2

After doing this mission, the counterspy immediately goes into retirement and a new spy replaces it. You should make sure there are a lot of foreign spies acting in the city before attempting this.

Spy experience in the new model

This should not have conflict with Proposal 3, which changes the LevelUpSpy function only.

Current experience amounts:
Major city spying: +20 for successful mission (identified or not)
Uncovering intrigue: +25 except the oddity mentioned in Proposal 3
Rigging election: +15 if successful
Coup: +50 if successful
Killing a foreign spy: +50

Proposed experience amounts:
Automatic mission (spy): on election turn, +20 if successfully carried out mission, +10 if not
Automatic mission (counterspy): on election turn, +10 experience, and +20 additional for each foreign spy identified/captured
Tactical mission (spy): +50 if successful
Tactical mission (counterspy): N/A (retirement)
Diplomat: +1 every turn
Uncovering intrigue: +15
Rigging election: +20 if successful
Coup: +50 if successful

Tenet changes​

From now on, the term "automatic mission" includes election rigging and "tactical mission" includes coup.

Covert Action: Success rate for automatic missions doubled, and success rate for tactical missions increased (+1 roll). Receive 1 Spy (plus 1 Spy for every 10 City-States ever existed)
Double Agents: Can access the "Turn spy into double agent" option if a foreign Spy is captured. Counterspies are more likely to capture foreign Spies in the Capture Foreign Spies mission (+1 roll). Receive 3 Spies (plus 3 Spies for every 10 City-States ever existed).
Police State: Can access the "Make effective propaganda with spy" option if a foreign Spy is captured. Counterspies are twice as likely to succeed in automatic missions. +3 :c5happy: Happiness from Courthouses, and +1 :c5happy: Happiness from Police Stations. +100% :c5production: towards Courthouses.

Building changes​

Constabulary
+25% Security Level
-1 :c5unhappy: Unhappiness from Distress
Unlocks "ransom" option if foreign spy is captured in this city
Counterspy in this city can automatically identify foreign spies
+25 :c5science: Science and :c5culture: Culture in this city for each successful counterspy automatic mission, scaling with era

Wat
All Constabulary stuff
+33% Security Level instead of +25%
Otherwise same as current version

Police Station
+25% Security Level
+1% Security Level per :c5citizen: Population
-1 :c5unhappy: Unhappiness from Distress, Poverty, Illiteracy and Boredom
Unlocks "gather intel" option if foreign spy is captured in this city
Counterspy in this city can automatically capture foreign spies

White Tower
All Ironworks stuff
+3 :c5strength:
+2 :c5gold::c5science::c5culture: (in addition to the Production from Ironworks)
+25 :c5gold: Gold when a building is built, scaling with era (in addition to the Science from Ironworks)
Provides 1 free :greatwork: Great Work of Art
+25 :c5gold: Gold and :c5science: Science in this city for each successful automatic or tactical mission, scaling with era
Constabulary, Castle, Armory: +1 :c5culture: Culture



Feel free to voice out your opinions here or on Discord.
 
Last edited:
General mechanical direction is a good start for discussing this topic, but something I haven't seen talked about on the forums much is the strategic goals of the Espionage system. I think it's is (or at least should be) a somewhat important way for lagging civs --those not at the top of their respective victory conditions-- to catch up.

To that end, I'd prefer any improvements to keep some sort of sling-shot mechanic in the mix: currently it's empire size, but that was voted out, and I think something more like the trade route science and culture formulas (based on the number of unique techs and policies the target has) would support this use case better anyway. I'm not talking anything too involved, just scaling the stolen yields based on the number of techs they have that you don't, and just for siphoning science and culture.

Also, I like the idea of freshening up Spies, and better balancing City-State versus Civ uses; is it possible to do something similar with Diplomats? Nothing like adding special activities or anything, but some way to give a yield trickle (like the basic Spy options), but to a unique yield type so it at least has a niche (Edit: oh wait, you already get +Tourism from Diplomats)? These reworks seem like they'll be putting a premium on either attacking or defending with spies; do others feel like the option to shell out gold for votes, and the added tourism, is already worth the opportunity cost of a spy?
 
Last edited:
The catch up mechanic is already represented as a higher chance to succeed in tactical missions if you're more behind in tech/policy than the target, which includes tech/GW steal.

Tech/policy difference does not affect automatic missions as those already scale with city yields and the ones ahead should have more of those.
 
Last edited:
Updated the OP to provide highly detailed missions with numbers and formulas. Now split into 3 separate proposals (unfortunately the third is huge but each part can't be standalone).
 
Last edited:
Counterspies also have their own tactical mission: Capture Foreign Spies.
Attempt to capture all foreign spies immediately. For each foreign spy, the below outcomes can happen (best to worst):
The spy is captured. This triggers the above event choice from capturing spies.
The spy is killed. This does not identify the spy, but the owner loses it.
The spy escapes and goes back to the hideout.

You can get a better outcome with a higher level counterspy, espionage buildings or the Double Agent tenet.
After doing this mission, the counterspy immediately goes into retirement and a new spy replaces it. You should make sure there are a lot of foreign spies acting in the city before attempting this.
So, if I'm understanding correctly, I can essentially use one of my own spies to go to a city I own, at worst kick out every enemy spy in the city, and the only penalty is that my spy's experience is reset to zero. That seems like rather strong counterplay to me, especially given how quickly my spy can set up in my own city (or is there a cooldown before the new spy comes in as a replacement?)
 
So, if I'm understanding correctly, I can essentially use one of my own spies to go to a city I own, at worst kick out every enemy spy in the city, and the only penalty is that my spy's experience is reset to zero. That seems like rather strong counterplay to me, especially given how quickly my spy can set up in my own city (or is there a cooldown before the new spy comes in as a replacement?)
It'll be locked to level 3. Please wait for me to finalize the last section.
 
Hopefully I haven't missed anything. Comment away!
 
City is blockaded, cannot perform :c5rangedstrength: ranged strike or benefit from extra :c5strength: strength from buildings for 3 turns.
Does that mean pre walls CS Strength? If so, it seems op.

I like all the ideas a lot, but I feel like the base sucess rate of these missions is too high (especially Tech Steal) as the negative consequence isn't very high, the exponential modifier would be mostly above 1 and you get a lot more than automatic missions give you. Also initially a Counterspy has no impact on the calculation and even after its very low. Because of this, spies seem very powerful so double agents would be op.
I feel like 4 % per population is high
A constabulary would be worth 6 pop which seems low.
 
Does that mean pre walls CS Strength? If so, it seems op.
Yes, but you have garrison.
Every tactical mission can be op when used right.

negative consequence isn't very high
Failing a tactical mission is still experience loss and turn loss (travel + establish + spy replacement) which usually adds up to more than 15 turns.
Also initially a Counterspy has no impact on the calculation
Yeah I should actually add a base penalty if a counterspy is present. Done!
 
Last edited:
It'll be locked to level 3. Please wait for me to finalize the last section.
Nice; I think this change makes the mechanic feel really good now.

Also, I love the flavor of the unique counterspy actions locked behind the three ideological tenets. (They're mechanically interesting, too.)

Two things I really love about this system as I'm currently reading it: (1) there is an elegance to having the automatic/tactical mission symmetry for spy use cases, and (2) these interactions make the whole spy system feel like it comes alive.
 
Top Bottom