Reserved for summary. If you're not helping research the espionage system, come back once I have something here.
Introduction
OK, so let's tackle the espionage issue. This is going to be a crash course in understanding how the espionage mechanics work, and this is going to be a long post. I've been reading up on this at CivFanatics and testing different things in Worldbuilder mode to get a sense for how the system works. Here's a very short summary:
* The espionage system is poorly designed and even more poorly documented. Very few of the real calculations have much to do with what's listed in-game. It is also horribly abusable in the wrong hands.
* The most important single number in the calculations is "Total Espionage Points ever spent against anyone." Where you actually spend the points, and whether you spend them at all, only factors into the passive benefits. (This is incredibly non-intuitive and the game interface suggests the opposite.)
* Counterespionage missions are extremely effective, and are by far the best defense against anything espionage related.
* There are indeed ways to defend against espionage, but you can only make things more expensive, have a greater chance to detect, and reduce the probability of success of enemy spies. There is no way to shut down espionage completely, and no unit that will simply reveal enemy spies. The lack of counterplay to the espionage system is a gaping weakness in the mechanic, and a major reason why it is so broken.
Passive Espionage
We'll tackle this first. Espionage points grant passive benefits against enemy teams as they accumulate over time as follows:
Note that this is where the famous "43/43" espionage point spending agreements come from; your 43 EP divided by their (43 + 100) EP becomes 43 / 143 = 0.301 and enough for both teams to see one another's Demographics.
Passive espionage is the only thing associated with the system based on the current ratio between the two teams. Let me repeat this: nothing else in the espionage system is based on the current EP between teams. Only the passive functions. Everything else is based on number of EP ever generated, and it doesn't even matter where those points were spent:
This is one of the most non-intuitive parts of the whole system. It explains why teams who invest heavily into EP will always have good ratios for spying, no matter where they spend their points, and why it's so hard to spy against them. I'm not sure why the system functions this way, but it does. On to active espionage.
Spies: Chance to be Detected
This is a spy. Spies generally do not do anything in your territory, with one exception we'll get to in a minute. In order do anything espionage-related, a spy must be moved into an enemy city. (You can also pillage tile improvements with them, but this is normally a waste of time and EP.) And maybe this seems really basic, but I've used the espionage system so little that I didn't know initially that these guys had to move into enemy cities. So there.
Any time a spy moves into enemy territory, there is a chance that it will be detected each turn, based on a number of factors. Here is the explanation from Bhruic:
Let's try to unpack that dense mass of information a bit. One of the biggest factors in whether a spy gets caught is the presence or lack of Open Borders. This is a multiplicative factor for the rest of the calculation, and it gets multiplied by 10 with Open Borders present, by 25 without Open Borders. In other words, just closing borders greatly increases the odds of a spy being detected, by a factor of 2.5! For the purposes of our game, we should close borders with anyone we think might be spying against us (already done: Apolyton and CivPlayers closed borders with us).
Another major part of the calculation is the total espionage points spent between teams, not the current ratio. This is where we are boned in this game, thanks to Apolyton's Great Spy and CivPlayers early rush to sacrificial altars. The good news is that this only affects the "EISM", which has a weight of 25 in the calculations. Even with our awful ratios, it's only one component in the formula, thank god.
Then there are three other parts to this formula. You can make (some) defense against spies by building a security bureau or having a defensive spy standing in a city (these do not stack; they do exactly the same thing). This is "EIC" in the formula and has a weight of 15. Basically, put a defensive spy in any city where you expect to be targeted. You can also run a counterespionage mission ("EICM"), which has a weight of 20. Note that this is weighted almost as high as the ratio of total espionage points spent through the whole game, yay! Good news for us. Then finally, there's a penalty every turn a spy moves ("EIRM") with a weight of 15 as well. After doing that big calculation above, we get the chance for a spy to be caught.
Let's look at an example of CivPlayers using a spy against us, and our team using a spy against them. I'll estimate that CivPlayers has outgenerated us on EP by a 5:1 ratio for the whole game thus far. (It may be worse than this but it doesn't chance the calculation that much.) We do not have Open Borders. Assume we are able to get a defensive spy in place in a core target city (like Brick By Brick) and run counterespionage mission. Our chance to detect the spy is:
= ((EISM * REP) + EIC + EICM + EIRM) * ESIM
= ((25 * (1000 / (5000 + 1000)) + 15 + 20 + 15) * 25
= 13.5% chance to detect the spy on the first turn, 9.8% chance each turn afterwards
In other words, not too bad. But if we take out the defensive spy and counterespionage:
= ((EISM * REP) + EIC + EICM + EIRM) * ESIM
= ((25 * (1000 / (5000 + 1000)) + 0 + 0 + 15) * 25
= 4.8% chance the first turn, 1.0% chance after it stops moving. Counterespionage and defensive spies make a very large difference.
How about our own use of spies against CivPlayers? Assuming no counterespionage mission and no defensive spy, we get:
= ((EISM * REP) + EIC + EICM + EIRM) * ESIM
= ((25 * (5000 / (5000 + 1000)) + 0 + 0 + 15) * 25
= 9% chance while moving, 5.2% chance while stationary. Clearly we cannot spend much time in enemy territory, we'll get caught quickly.
This is another major problem with the espionage system: a huge amount of what happens comes down to low odds dice rolls on whether spies get caught as they infiltrate. There's nothing to do other than cross your fingers and hope not to be found, or send lots of spies, and that's a poorly designed game mechanic.
Spies: Mission Costs
Once a spy has made it into an enemy city, it's time to start carry out spy missions. All of these missions have a set cost in espionage points (EP), which is determined by a large number of modifiers. These costs are also poorly documented in the game, and all of the relevant info can only be found on third party websites like CivFanatics. The general formula is as follows:
We can ignore the number of players for all non-teamer games, and the 0.01 is only in there to convert things to a percentage. The key items are the base mission cost and the mission cost modifiers. Let's tackle each in turn.
All of the spying missions have a base cost. Here's each of them:
The cheap missions are therefore stealing gold (not economically efficient most of the time), pillaging tile improvements, and those annoying poison water / city unhappiness missions the AI loves to run. The medium cost missions are the ones that destroy production in a city, revolt a city, and change civics / state religion. By far the most expensive spy mission involves stealing techs, and with good reason.
It should also be apparent immediately that forcing civics and religious changes are laughably cheap and do not scale with map size at all. You can force a civics change in a 50 city empire on a Huge map for effectively the same cost as revolting a single city. It's ridiculously, incredibly broken as a concept. No serious competitive game between humans should ever allow this under any circumstances. Thanks, alexman.
Counterespionage is one of the cheapest missions available, and is the best way for the weak to fight back against the strong. We'll see just how effective it is at increasing the cost of doing anything in the following modifiers section.
So those are the base costs of each mission. =Then they get scaled by the following modifiers:
Let's unpack this mass of text as well. Missions start with a 100% cost rate equal to the base cost. Then different modifiers get added to that. The city pop thing... I have no idea what that's supposed to mean, and it doesn't seem to do anything in-game. Ignore it. Here are the real modifiers:
* Does the spying team have a trade route to that city? (Note that this generally is the same thing as having Open Borders with them, but not always.) If so, then the cost of the mission is reduced by 20%.
* If the city has our state religion inside, subtract 15% from the cost. If the city has our state religion and we control the Holy City, subtract 25% from the cost. This is a major factor in making espionage missions cheaper. You want to target cities that have your state religion present. Keep this in mind.
* If the city has some of the culture of the spying team present, it also reduces the cost of the mission. This doesn't really factor into our current game, so I'll avoid it for now. It's very cheap to steal for a city where you have a ton of cultural pressure (like if we wanted to steal from that CFC city on the border where our culture is dominant).
* There is a penalty for distance. The further away a city is from the spying team's capital, the more expensive it is to run missions. I checked in our sandbox, and CFC's capital (18 tiles away) had a distance modifier of 38% on this map. CivPlayers will have less than that for our border cities.
* There is a modifier based on the espionage spending ratio between teams. This is again not equal to the current EP points ratio, but the total EP ever spent by either team. It can be seen on the Espionage screen:
This number here. Apolyton, CivPlayers, and UniversCiv would all get sizable mission discounts against us. (Note again how these percentages have nothing to do with the CURRENT espionage point totals between the teams, or even what they have spent against one another. We've spent more EP against CFC than they have spent against us, and they have the 108% advantage. Have I mentioned espionage is a poorly designed and badly documented system?)
* There is a bonus for a spy staying in place inside a city. Every stationary turn drops 10% off of the cost of the mission, up to a cap of 50% after five stationary turns. This is a major reason why tech stealing can be so much cheaper than doing your own research. I also think this is an idiotic mechanic - 50% off missions for standing in place for 5 turns?! - but it's the way the system works, and it's important to understand.
* If there is a security bureau in the city, then the cost of the mission is increased by 50%. This is NOT listed in the original post by Detektyw, but it is observed in-game. A defensive spy does not change the cost of the mission; this is the only way in which defensive spies differ from security bureaus. (The defensive spy DOES increase the cost of detecting the enemy spy, and decreases the chance of the mission succeeding. But it does not affect mission cost in EP.)
* Finally, if there's a counterespionage mission in place, the cost of any mission is increased by 100%. This is the largest of any modifier, and it shows why counterespionage is so effective. Even with a terrible EP total, a team can make it prohibitably expensive to do anything by running counterespionage.
Let's look at some examples now. I'll pick missions that we can expect to be running or have used against us.
Here's a counterespionage mission from the Single Player game I did on YouTube (courtesy of Worldbuilder). The base cost is 100 as mentioned before, and this is always the same for counterespionage under all circumstances. Then there's a bonus having our state religion (with no Holy City control), a penalty for distance, a penalty for the city having a security bureau (non-applicable in our game), and then a penalty for total EP ratio.
And now another weird factor in determining the cost of these missions. Despite the fact that the interface clearly makes it look like these numbers are added together, they are actually MULTIPLED instead. Just watch:
100 * (1 + (50 + 54 + 26 - 15) / 100) = 215 EP
100 * (1.5 * 1.54 * 1.26 * 0.85) = 247 EP (there's some rounding in here somewhere)
Just a little more silliness of this system. What would counterespionage cost for us against CivPlayers? Here's a good estimate:
- 100 base cost
- no trade route, no state religion bonus
- distance roughly ~20-25% penalty
- EP spending penalty 37%
- standing in place bonus 10-50%, although somewhat risky
Put that together, and we're looking at 100 * (1.25 * 1.37) = 171 EP needed, roughly speaking. Note that with 5 turns of stationary spy discount, this drops all the way down to 85 EP. It's a huge modifier. Unfortunately, whether our spy gets caught during those five turns is pretty much pure luck.
What about city revolt? We won't be using this, but CivPlayers might want to use it against us. The base cost is 650, which is trivial later on but still high for this point in the game. If we can get a counterespionage mission in place, we can make this decently expensive for CivPlayers:
- 650 base cost
- no trade routes, state religion bonus in any of our border cities
- distance roughly 20% penalty
- EP spending ratio bonus of 37%
- standing in place bonus of 10-50%
- counterespionage penalty of 100% [the tooltip says it increases cost by 200% but I think this is incorrect]
650 * (1.2 * 0.63 * [1.0 to 0.5] * 2) = anywhere from 491 EP to 983 EP depending on the number of turns spent standing in place. The cost is half of this if we don't run counterespionage. CivPlayers has about 1500 EP invested in us right now, built up over the entire game thus far, which means they would have to invest a large sum to revolt a city, and probably couldn't revolt more than one city unless they went over to major EP slider spending. That's a bit of good news.
Finally we come to tech steals. They work the same way as everything else, with the base cost being 1.5 times the beaker cost of the tech. That sounds expensive, but with enough multipliers in place, the techs can be picked up for pennies on the dollar. Here's how Apolyton stole their group of techs from us.
- 20% discount for trade route
- 25% discount for state religion in city + Holy City control
- 30% penalty for distance, roughly speaking
- 64% bonus for EP spending ratio after using Great Spy
- 50% bonus for five turns standing in place
base tech cost * 1.5 * (0.8 * 0.75 * 1.3 * 0.36 * 0.5) = 21% of the base tech cost. They picked up Engineering, Nationalism, and Liberalism (7500 beakers) for the cost of a single Great Spy. A very nice move that also highlights the balance problems with the espionage system.
Can we do the same thing back to them and steal Rifling tech? Not really. We don't have any trade routes now with Apolyton, and there's no cities in reach with our state religion. (There is one Apolyton city with Hinduism present, but it's way on the other side of their territory, near the UniversCiv border. Not really accessible.) Instead of a 64% bonus to stealing techs, we'd get a 64% penalty from the EP ratio. Granted, that would go down close to zero as we ran the EP slider, but at best we would be breaking even there with no advantage. But even after doing all that, we're looking at basically:
base tech cost * 1.5 * (1.3 [distance] * 0.5 [stationary spy]) = .975 base tech cost
Not worth it. We'd do better just to research the tech ourselves. Because spies are not guaranteed to succeed in their missions...
Spies: Mission Success / Failure
There's one more component to espionage, and that's whether or not the mission succeeds. All missions other than counterespionage have a chance to fail, in which case the spy dies and no EP are spent. Note that this is separate from the chance for spies to be detected moving around the map, which also causes them to die. The capture of spies never causes you to lose EP, however, only a successful mission will see EP getting spent. In the event of a successful mission, a spy will teleport back to the capital and can be used again.
There's another longish formula for the success/failure chance of spy missions:
With the "DM" or difficulty modifier of each mission defined as follows:
We'll do the usual thing and try to unpack the formulas a bit. The first half of the formula is literally exactly the same as the chance to detect a spy as it moves around in your territory. However, instead of being multiplied by either 10 (Open Border) or 25 (no Open Borders), it gets multiplied by the "DM" or difficulty modifier. Some missions are much easier to perform than others. Those infuriating poison water missions have an extremely high chance of success. City revolt is neutral (why it's easier to revolt a city entirely over destroying a building is puzzling to me). Steal treasury and steal techs are equally difficult, which is laughable given how bad stealing gold works out to be. Swapping civics and religion are the most difficult things to do, thank goodness. Counterespionage always succeeds.
I'll use some examples from our game against CivPlayers again. We already know the first half of the formula from earlier, and we'll assume again that we're running counterespionage and have a defensive spy in a city like Brick By Brick. What are the odds of CivPlayers being able to revolt the city?
= (EISM * REP) + EIC + EICM + EIRM) * (100 + DM)) / 100)
= (25 * (1000 / (5000 + 1000)) + 15 + 20 + 15) * ((100 + 0) / 100
= 54% chance to fail, 46% chance to succeed
Note that the number of turns spent standing in a city don't affect this number, outside of the initial turn spent moving onto a tile. The rough takeaway is that CivPlayers would have about a 50/50 shot for a spy to succeed in a city revolt, even if they have the EP available to spend. Note that things get much more dicey if we don't have a defensive spy and aren't running counterespionage:
= (EISM * REP) + EIC + EICM + EIRM) * (100 + DM)) / 100)
= (25 * (1000 / (5000 + 1000)) + 0 + 0 + 15) * ((100 + 0) / 100
= 19% chance to fail, 81% chance to succeed
Basic takeaway: run counterespionage and put a defensive spy in any city you think will be targeted! The defensive spy both increases the chance of the invasive spy getting detected, and also increases the chance that the mission will fail. Counterespionage pulls triple duty: increases the chance of detection, increases the cost of all missions, and also increases the chance of the spy missions failing. Counterespionage is really freaking good!!!
* * * * * * * * * * * * * * * *
Well, there's your basic primer on how the espionage system works. As I said in the beginning, it's possible to defend in some ways, but far too much of the system is in the hands of dice rolls. It's also a poor system because many of the benefits just sit there accruing passively in the background, leading to a "bigger is better" empire system. As you build courthouses and jails, the EP pile up in the background, doing nothing in the vast majority of normal games. More cities means more of these buildings generating passive EP without doing anything; you don't need to focus on espionage at all to be generating thousands of EP by the end of a game. It's much like the way that the culture/faith/tourism/etc. points pile up passively in the background in Civ5, which is another reason why I don't particularly like the design of that game. And unlike Civ5, which increases the cost of policies with more cities, bigger is always better in Civ4's espionage system, with nothing in place to scale with map size or game speed. The whole system is a balance trainwreck, and clearly didn't have the proper amount of design work put into it. Not to mention the extremely poor documentation of what's actually going on, the unintuitive way in which the EP ratios work, etc....
I'm stealing the top post in Mardoc's thread. If you've read through all this, you should have a good idea of what's going on, and we can figure out how best to deal with the situation.
Introduction
OK, so let's tackle the espionage issue. This is going to be a crash course in understanding how the espionage mechanics work, and this is going to be a long post. I've been reading up on this at CivFanatics and testing different things in Worldbuilder mode to get a sense for how the system works. Here's a very short summary:
* The espionage system is poorly designed and even more poorly documented. Very few of the real calculations have much to do with what's listed in-game. It is also horribly abusable in the wrong hands.
* The most important single number in the calculations is "Total Espionage Points ever spent against anyone." Where you actually spend the points, and whether you spend them at all, only factors into the passive benefits. (This is incredibly non-intuitive and the game interface suggests the opposite.)
* Counterespionage missions are extremely effective, and are by far the best defense against anything espionage related.
* There are indeed ways to defend against espionage, but you can only make things more expensive, have a greater chance to detect, and reduce the probability of success of enemy spies. There is no way to shut down espionage completely, and no unit that will simply reveal enemy spies. The lack of counterplay to the espionage system is a gaping weakness in the mechanic, and a major reason why it is so broken.
Passive Espionage
We'll tackle this first. Espionage points grant passive benefits against enemy teams as they accumulate over time as follows:
Quote:Passive Missions
Base Factor * (100+How much they have against you)
Demographics=0.3
City Visibility=1.2
Investigate=2
See Research=0.75
Note that this is where the famous "43/43" espionage point spending agreements come from; your 43 EP divided by their (43 + 100) EP becomes 43 / 143 = 0.301 and enough for both teams to see one another's Demographics.
Passive espionage is the only thing associated with the system based on the current ratio between the two teams. Let me repeat this: nothing else in the espionage system is based on the current EP between teams. Only the passive functions. Everything else is based on number of EP ever generated, and it doesn't even matter where those points were spent:
Krikkitone Wrote:Espionage points 'In the bank' v. a specific civ only do ONE(two) things
1. Give you passive benefits
2. Stop other civs from getting passive benefits v. you
They do not help you defend against rival spies or change the costs of your missions.
So if you are not interested in Active Espionage missions, send your spy spending against whoever you want to see, because that's all they are good for.
If you want to defend against Rival spies or increase the cost of their missions, then spend all your EPs on counter espionage.
Otherwise it doesn't matter who your EPs are against, or if you have spent them
Actually, EP that you generate before you meet anyone go into the 'Espionage points' genrated Ever
So if your civ has been isolated for 100 turns your Palace would still give you 400 EPs in the 'Espionage points ever'
so Those Espionage points would still act to help
lower the cost for your spies
increase your spies chance of survival+success
and do the opposite for any enemy spies
of course you could never spend those 400 EP, and they wouldn't help you with looking at anyone.
This is one of the most non-intuitive parts of the whole system. It explains why teams who invest heavily into EP will always have good ratios for spying, no matter where they spend their points, and why it's so hard to spy against them. I'm not sure why the system functions this way, but it does. On to active espionage.
Spies: Chance to be Detected
This is a spy. Spies generally do not do anything in your territory, with one exception we'll get to in a minute. In order do anything espionage-related, a spy must be moved into an enemy city. (You can also pillage tile improvements with them, but this is normally a waste of time and EP.) And maybe this seems really basic, but I've used the espionage system so little that I didn't know initially that these guys had to move into enemy cities. So there.
Any time a spy moves into enemy territory, there is a chance that it will be detected each turn, based on a number of factors. Here is the explanation from Bhruic:
Bhuric Wrote:There are a number of variables to take into consideration. The first is the intercept modifer. If we have an Open Borders treaty with them, we have "ESPIONAGE_SPY_NO_INTRUDE_INTERCEPT_MOD", or ESNIIM = 10 (it's stored as -90, but the actual value is used as "100 + ESNIIM"). If not, we have "ESPIONAGE_SPY_INTERCEPT_MOD", or ESIM = 25 (or -75). The next variable is the ratio of total espionage points between us and them. That is the complete total amount of espionage points ever put in, not merely the points we have put into them or vice versa. Let's call our total points as OME, and theirs as TME, and the ratio as REP. The formula for the ratio is: TME / (TME + OME). This number is multiplied by a variable called "ESPIONAGE_INTERCEPT_SPENDING_MAX", or EISM, which is defined as 25.
Next is counter-spying. Counter-spying can be accomplished in two ways - by them having a spy on the square we are on, or by them having built the Security Bureau in the city we are in. If that's the case, that triggers the "ESPIONAGE_INTERCEPT_COUNTERSPY" or EIC, value of 15. Next, is the possibility that they have ran the counter-intelligence mission against us. If that's the case, they triggered "ESPIONAGE_INTERCEPT_COUNTERESPIONAGE_MISSION" , or EICM which is defined as 20. And finally, if our spy just moved onto the square, or if we already have a spy on that square, we trigger "ESPIONAGE_INTERCEPT_RECENT_MISSION", or EIRM, value of 15.
So to recap:
ESNIIM = 10
ESIM = 25
REP = TME / (TME + OME)
EISM = 25
EIC = 15
EICM = 20
EIRM = 15
The complete formulas, assuming all values are relevant is:
((EISM * REP) + EIC + EICM + EIRM) * ESNIIM (Open Borders)
((EISM * REP) + EIC + EICM + EIRM) * ESIM (No Open Borders)
Note that the:
((EISM * REP) + EIC + EICM + EIRM)
part of the formula is capped at a range of 0..100.
Once the formula is used to get a number, the game generates a random number from 0..9999. If the random number is greater or equal to the number generated by the formula, then the spy is not discovered. If the random number is less than the number from the formula, the spy is caught.
A couple examples to give some concrete numbers:
Our spy moves on to their tile where they have a spy. We don't have an open borders treaty with them. They have not run a counter-intelligence mission on us. We have generated a total EPs of 1000 over the game, they have generated 3000.
REP = TME / (TME + OME)
REP = 3000 / (3000 + 1000)
REP = 0.75
= ((EISM * REP) + EIC + EICM + EIRM) * ESIM
= ((25 * 0.75) + 15 + 0 + 15) * 25
= 1218.75
= 1218 (rounded down)
So percentage-wise, they have a 12.2% chance of detecting our spy.
Another example. Our spy has been sitting on a square for 2 turns, they have no spy on the square, they have not run a counter-intelligence mission, and we have an Open Borders treaty with them. Let's reverse the EPs from above (so we have generated 3000, they have generated 1000).
REP = TME / (TME + OME)
REP = 1000 / (1000 + 3000)
REP = 0.25
= ((EISM * REP) + EIC + EICM + EIRM) * ESNIIM
= ((25 * 0.25) + 0 + 0 + 0) * 10
= 62.5
= 62 (rounded down)
So percentage-wise, they have a 0.6% chance of detecting our spy.
Let's try to unpack that dense mass of information a bit. One of the biggest factors in whether a spy gets caught is the presence or lack of Open Borders. This is a multiplicative factor for the rest of the calculation, and it gets multiplied by 10 with Open Borders present, by 25 without Open Borders. In other words, just closing borders greatly increases the odds of a spy being detected, by a factor of 2.5! For the purposes of our game, we should close borders with anyone we think might be spying against us (already done: Apolyton and CivPlayers closed borders with us).
Another major part of the calculation is the total espionage points spent between teams, not the current ratio. This is where we are boned in this game, thanks to Apolyton's Great Spy and CivPlayers early rush to sacrificial altars. The good news is that this only affects the "EISM", which has a weight of 25 in the calculations. Even with our awful ratios, it's only one component in the formula, thank god.
Then there are three other parts to this formula. You can make (some) defense against spies by building a security bureau or having a defensive spy standing in a city (these do not stack; they do exactly the same thing). This is "EIC" in the formula and has a weight of 15. Basically, put a defensive spy in any city where you expect to be targeted. You can also run a counterespionage mission ("EICM"), which has a weight of 20. Note that this is weighted almost as high as the ratio of total espionage points spent through the whole game, yay! Good news for us. Then finally, there's a penalty every turn a spy moves ("EIRM") with a weight of 15 as well. After doing that big calculation above, we get the chance for a spy to be caught.
Let's look at an example of CivPlayers using a spy against us, and our team using a spy against them. I'll estimate that CivPlayers has outgenerated us on EP by a 5:1 ratio for the whole game thus far. (It may be worse than this but it doesn't chance the calculation that much.) We do not have Open Borders. Assume we are able to get a defensive spy in place in a core target city (like Brick By Brick) and run counterespionage mission. Our chance to detect the spy is:
= ((EISM * REP) + EIC + EICM + EIRM) * ESIM
= ((25 * (1000 / (5000 + 1000)) + 15 + 20 + 15) * 25
= 13.5% chance to detect the spy on the first turn, 9.8% chance each turn afterwards
In other words, not too bad. But if we take out the defensive spy and counterespionage:
= ((EISM * REP) + EIC + EICM + EIRM) * ESIM
= ((25 * (1000 / (5000 + 1000)) + 0 + 0 + 15) * 25
= 4.8% chance the first turn, 1.0% chance after it stops moving. Counterespionage and defensive spies make a very large difference.
How about our own use of spies against CivPlayers? Assuming no counterespionage mission and no defensive spy, we get:
= ((EISM * REP) + EIC + EICM + EIRM) * ESIM
= ((25 * (5000 / (5000 + 1000)) + 0 + 0 + 15) * 25
= 9% chance while moving, 5.2% chance while stationary. Clearly we cannot spend much time in enemy territory, we'll get caught quickly.
This is another major problem with the espionage system: a huge amount of what happens comes down to low odds dice rolls on whether spies get caught as they infiltrate. There's nothing to do other than cross your fingers and hope not to be found, or send lots of spies, and that's a poorly designed game mechanic.
Spies: Mission Costs
Once a spy has made it into an enemy city, it's time to start carry out spy missions. All of these missions have a set cost in espionage points (EP), which is determined by a large number of modifiers. These costs are also poorly documented in the game, and all of the relevant info can only be found on third party websites like CivFanatics. The general formula is as follows:
Quote:Mission Cost = BaseMissionCost * MissionCostModifier * Number Of Players In Your Team * 0.01
We can ignore the number of players for all non-teamer games, and the 0.01 is only in there to convert things to a percentage. The key items are the base mission cost and the mission cost modifiers. Let's tackle each in turn.
All of the spying missions have a base cost. Here's each of them:
Quote:Destroy Improvement: 75
Destroy Building: 500
Destroy Project: 500
Destroy Production: 500
Steal Treasury: 3 * amount of gold stolen
Insert Culture: 300
Poison Water: 120
City Unhappiness: 120
City Revolt: 650
Steal Tech: 1.5 * beaker cost
Switch Civic: 600 [scales by game speed]
Switch Religion: 600 [scales by game speed]
Counterespionage: 100
The cheap missions are therefore stealing gold (not economically efficient most of the time), pillaging tile improvements, and those annoying poison water / city unhappiness missions the AI loves to run. The medium cost missions are the ones that destroy production in a city, revolt a city, and change civics / state religion. By far the most expensive spy mission involves stealing techs, and with good reason.
It should also be apparent immediately that forcing civics and religious changes are laughably cheap and do not scale with map size at all. You can force a civics change in a 50 city empire on a Huge map for effectively the same cost as revolting a single city. It's ridiculously, incredibly broken as a concept. No serious competitive game between humans should ever allow this under any circumstances. Thanks, alexman.
Counterespionage is one of the cheapest missions available, and is the best way for the weak to fight back against the strong. We'll see just how effective it is at increasing the cost of doing anything in the following modifiers section.
So those are the base costs of each mission. =Then they get scaled by the following modifiers:
Detekyw Wrote:Mission Cost Modifier
We start off with the coefficient equal to 100%
We add ESPIONAGE_CITY_POP_EACH_MOD * (CityPop - 1)
We add ESPIONAGE_CITY_TRADE_ROUTE_MOD if the city has trade routes with us
We add ESPIONAGE_CITY_RELIGION_STATE_MOD if the city has our state religion (and the enemy DOESN'T) but we don't have holy city, and ESPIONAGE_CITY_HOLY_CITY_MOD if we have the founding location
We multiply by 1 - (YourCultureInTheCity * ESPIONAGE_CULTURE_MULTIPLIER_MOD) / max(1,OwnersCulture + YourCulture)
We add the distance modifier
We subtract ESPIONAGE_EACH_TURN_UNIT_COST_DECREASE * NumOfStationaryTurns (atm capped at 50)
We add (ESPIONAGE_SPENDING_MULTIPLIER * (2 * targetPoints + ourPoints) / max(1,targetPoints + 2 * ourPoints)
If the enemy has an active counterespionage mission against us we add 100%
Then we round the value down cutting off all further decimal places.
max(x,y) means the greater of x and y
min(x,y) means the lesser of x and y
NOTES:
Default defines:
ESPIONAGE_CITY_POP_EACH_MOD = 0
ESPIONAGE_CITY_TRADE_ROUTE_MOD = -20
ESPIONAGE_CITY_RELIGION_STATE_MOD = -15
ESPIONAGE_CITY_HOLY_CITY_MOD = -25
ESPIONAGE_CULTURE_MULTIPLIER_MOD = 50
ESPIONAGE_SPENDING_MULTIPLIER = 100
ESPIONAGE_EACH_TURN_UNIT_COST_DECREASE = 10
Let's unpack this mass of text as well. Missions start with a 100% cost rate equal to the base cost. Then different modifiers get added to that. The city pop thing... I have no idea what that's supposed to mean, and it doesn't seem to do anything in-game. Ignore it. Here are the real modifiers:
* Does the spying team have a trade route to that city? (Note that this generally is the same thing as having Open Borders with them, but not always.) If so, then the cost of the mission is reduced by 20%.
* If the city has our state religion inside, subtract 15% from the cost. If the city has our state religion and we control the Holy City, subtract 25% from the cost. This is a major factor in making espionage missions cheaper. You want to target cities that have your state religion present. Keep this in mind.
* If the city has some of the culture of the spying team present, it also reduces the cost of the mission. This doesn't really factor into our current game, so I'll avoid it for now. It's very cheap to steal for a city where you have a ton of cultural pressure (like if we wanted to steal from that CFC city on the border where our culture is dominant).
* There is a penalty for distance. The further away a city is from the spying team's capital, the more expensive it is to run missions. I checked in our sandbox, and CFC's capital (18 tiles away) had a distance modifier of 38% on this map. CivPlayers will have less than that for our border cities.
* There is a modifier based on the espionage spending ratio between teams. This is again not equal to the current EP points ratio, but the total EP ever spent by either team. It can be seen on the Espionage screen:
This number here. Apolyton, CivPlayers, and UniversCiv would all get sizable mission discounts against us. (Note again how these percentages have nothing to do with the CURRENT espionage point totals between the teams, or even what they have spent against one another. We've spent more EP against CFC than they have spent against us, and they have the 108% advantage. Have I mentioned espionage is a poorly designed and badly documented system?)
* There is a bonus for a spy staying in place inside a city. Every stationary turn drops 10% off of the cost of the mission, up to a cap of 50% after five stationary turns. This is a major reason why tech stealing can be so much cheaper than doing your own research. I also think this is an idiotic mechanic - 50% off missions for standing in place for 5 turns?! - but it's the way the system works, and it's important to understand.
* If there is a security bureau in the city, then the cost of the mission is increased by 50%. This is NOT listed in the original post by Detektyw, but it is observed in-game. A defensive spy does not change the cost of the mission; this is the only way in which defensive spies differ from security bureaus. (The defensive spy DOES increase the cost of detecting the enemy spy, and decreases the chance of the mission succeeding. But it does not affect mission cost in EP.)
* Finally, if there's a counterespionage mission in place, the cost of any mission is increased by 100%. This is the largest of any modifier, and it shows why counterespionage is so effective. Even with a terrible EP total, a team can make it prohibitably expensive to do anything by running counterespionage.
Let's look at some examples now. I'll pick missions that we can expect to be running or have used against us.
Here's a counterespionage mission from the Single Player game I did on YouTube (courtesy of Worldbuilder). The base cost is 100 as mentioned before, and this is always the same for counterespionage under all circumstances. Then there's a bonus having our state religion (with no Holy City control), a penalty for distance, a penalty for the city having a security bureau (non-applicable in our game), and then a penalty for total EP ratio.
And now another weird factor in determining the cost of these missions. Despite the fact that the interface clearly makes it look like these numbers are added together, they are actually MULTIPLED instead. Just watch:
100 * (1 + (50 + 54 + 26 - 15) / 100) = 215 EP
100 * (1.5 * 1.54 * 1.26 * 0.85) = 247 EP (there's some rounding in here somewhere)
Just a little more silliness of this system. What would counterespionage cost for us against CivPlayers? Here's a good estimate:
- 100 base cost
- no trade route, no state religion bonus
- distance roughly ~20-25% penalty
- EP spending penalty 37%
- standing in place bonus 10-50%, although somewhat risky
Put that together, and we're looking at 100 * (1.25 * 1.37) = 171 EP needed, roughly speaking. Note that with 5 turns of stationary spy discount, this drops all the way down to 85 EP. It's a huge modifier. Unfortunately, whether our spy gets caught during those five turns is pretty much pure luck.
What about city revolt? We won't be using this, but CivPlayers might want to use it against us. The base cost is 650, which is trivial later on but still high for this point in the game. If we can get a counterespionage mission in place, we can make this decently expensive for CivPlayers:
- 650 base cost
- no trade routes, state religion bonus in any of our border cities
- distance roughly 20% penalty
- EP spending ratio bonus of 37%
- standing in place bonus of 10-50%
- counterespionage penalty of 100% [the tooltip says it increases cost by 200% but I think this is incorrect]
650 * (1.2 * 0.63 * [1.0 to 0.5] * 2) = anywhere from 491 EP to 983 EP depending on the number of turns spent standing in place. The cost is half of this if we don't run counterespionage. CivPlayers has about 1500 EP invested in us right now, built up over the entire game thus far, which means they would have to invest a large sum to revolt a city, and probably couldn't revolt more than one city unless they went over to major EP slider spending. That's a bit of good news.
Finally we come to tech steals. They work the same way as everything else, with the base cost being 1.5 times the beaker cost of the tech. That sounds expensive, but with enough multipliers in place, the techs can be picked up for pennies on the dollar. Here's how Apolyton stole their group of techs from us.
- 20% discount for trade route
- 25% discount for state religion in city + Holy City control
- 30% penalty for distance, roughly speaking
- 64% bonus for EP spending ratio after using Great Spy
- 50% bonus for five turns standing in place
base tech cost * 1.5 * (0.8 * 0.75 * 1.3 * 0.36 * 0.5) = 21% of the base tech cost. They picked up Engineering, Nationalism, and Liberalism (7500 beakers) for the cost of a single Great Spy. A very nice move that also highlights the balance problems with the espionage system.
Can we do the same thing back to them and steal Rifling tech? Not really. We don't have any trade routes now with Apolyton, and there's no cities in reach with our state religion. (There is one Apolyton city with Hinduism present, but it's way on the other side of their territory, near the UniversCiv border. Not really accessible.) Instead of a 64% bonus to stealing techs, we'd get a 64% penalty from the EP ratio. Granted, that would go down close to zero as we ran the EP slider, but at best we would be breaking even there with no advantage. But even after doing all that, we're looking at basically:
base tech cost * 1.5 * (1.3 [distance] * 0.5 [stationary spy]) = .975 base tech cost
Not worth it. We'd do better just to research the tech ourselves. Because spies are not guaranteed to succeed in their missions...
Spies: Mission Success / Failure
There's one more component to espionage, and that's whether or not the mission succeeds. All missions other than counterespionage have a chance to fail, in which case the spy dies and no EP are spent. Note that this is separate from the chance for spies to be detected moving around the map, which also causes them to die. The capture of spies never causes you to lose EP, however, only a successful mission will see EP getting spent. In the event of a successful mission, a spy will teleport back to the capital and can be used again.
There's another longish formula for the success/failure chance of spy missions:
Bhruic Wrote:The chance of success for a spy mission is an almost identical formula. In fact, it is an identical formula, although it's for the chance to be detected, not the chance to be successful.
If you recall in my first post, I list "ESPIONAGE_SPY_NO_INTRUDE_INTERCEPT_MOD" and "ESPIONAGE_SPY_INTERCEPT_MOD" as being 10 and 25, respectively? But the actual values in GlobalDefines.xml is -90 and -75, I just handled the fact it does 100 + X (where X is the -90 or -75) by short cutting it.
So the formula is identical, just replace the -90 or -75 with the difficulty modifier (DM) for that particular mission.
The percentage chance of being detected while performing a mission is:
(((EISM * REP) + EIC + EICM + EIRM) * (100 + DM)) / 100
The dividing by 100 is just to get it into percentage form. The chance of being successful, therefore, is:
100 - ((((EISM * REP) + EIC + EICM + EIRM) * (100 + DM)) / 100)
With the "DM" or difficulty modifier of each mission defined as follows:
RolandJohansen Wrote:The values are as follows:
Destroy Improvement: 0
Destroy Building: 10
Destroy Project: 25
Destroy Production: 0
Steal Treasury: 25
Insert Culture: 0
Poison Water: -50
City Unhappiness: -50
City Revolt: 0
Steal Tech: 25
Switch Civic: 50
Switch Religion: 50
Counterespionage: -100
The basic chance that your spy is caught during a mission is a value between 0% and 25%. This chance is dependent on the total amount of espionage points produced by you and your target civilisation.
An enemy spy or the security bureau present in the tile of your spy increases the chance of being caught by 15%.
A counterespionage mission performed against you increases the chance of being caught by 20%.
When one of your spies has just moved or is on the same tile as another one of your spies, then it has a 15% increased chance of being caught. You thus usually will want to wait at least one turn after arriving on a tile and having multiple spies on a single tile adversely affects your chance of a successful mission. (There is also a cost reduction for waiting on a tile for up to five turns.)
These chances are summed up meaning, the chance of being caught during a mission is a value between 0% and 75%.
These percentages are then multiplied by the mission modifier which is equal to (100 + difficulty modifier)/100. This means that the Counterespionage mission will always succeed and that the Poison water supply mission and the foment unhappiness mission only have halve the basic chance to fail. However, the switch civic and switch religion missions have a 1.5 times as high chance to fail, a value between 0% and 1.5*75=112,5%. Thus when your opponent has defended itself in an excellent way, then these missions will often fail. Usually, there will be a few cities which are vulnerable enough to be targeted by these missions successfully.
We'll do the usual thing and try to unpack the formulas a bit. The first half of the formula is literally exactly the same as the chance to detect a spy as it moves around in your territory. However, instead of being multiplied by either 10 (Open Border) or 25 (no Open Borders), it gets multiplied by the "DM" or difficulty modifier. Some missions are much easier to perform than others. Those infuriating poison water missions have an extremely high chance of success. City revolt is neutral (why it's easier to revolt a city entirely over destroying a building is puzzling to me). Steal treasury and steal techs are equally difficult, which is laughable given how bad stealing gold works out to be. Swapping civics and religion are the most difficult things to do, thank goodness. Counterespionage always succeeds.
I'll use some examples from our game against CivPlayers again. We already know the first half of the formula from earlier, and we'll assume again that we're running counterespionage and have a defensive spy in a city like Brick By Brick. What are the odds of CivPlayers being able to revolt the city?
= (EISM * REP) + EIC + EICM + EIRM) * (100 + DM)) / 100)
= (25 * (1000 / (5000 + 1000)) + 15 + 20 + 15) * ((100 + 0) / 100
= 54% chance to fail, 46% chance to succeed
Note that the number of turns spent standing in a city don't affect this number, outside of the initial turn spent moving onto a tile. The rough takeaway is that CivPlayers would have about a 50/50 shot for a spy to succeed in a city revolt, even if they have the EP available to spend. Note that things get much more dicey if we don't have a defensive spy and aren't running counterespionage:
= (EISM * REP) + EIC + EICM + EIRM) * (100 + DM)) / 100)
= (25 * (1000 / (5000 + 1000)) + 0 + 0 + 15) * ((100 + 0) / 100
= 19% chance to fail, 81% chance to succeed
Basic takeaway: run counterespionage and put a defensive spy in any city you think will be targeted! The defensive spy both increases the chance of the invasive spy getting detected, and also increases the chance that the mission will fail. Counterespionage pulls triple duty: increases the chance of detection, increases the cost of all missions, and also increases the chance of the spy missions failing. Counterespionage is really freaking good!!!
* * * * * * * * * * * * * * * *
Well, there's your basic primer on how the espionage system works. As I said in the beginning, it's possible to defend in some ways, but far too much of the system is in the hands of dice rolls. It's also a poor system because many of the benefits just sit there accruing passively in the background, leading to a "bigger is better" empire system. As you build courthouses and jails, the EP pile up in the background, doing nothing in the vast majority of normal games. More cities means more of these buildings generating passive EP without doing anything; you don't need to focus on espionage at all to be generating thousands of EP by the end of a game. It's much like the way that the culture/faith/tourism/etc. points pile up passively in the background in Civ5, which is another reason why I don't particularly like the design of that game. And unlike Civ5, which increases the cost of policies with more cities, bigger is always better in Civ4's espionage system, with nothing in place to scale with map size or game speed. The whole system is a balance trainwreck, and clearly didn't have the proper amount of design work put into it. Not to mention the extremely poor documentation of what's actually going on, the unintuitive way in which the EP ratios work, etc....
I'm stealing the top post in Mardoc's thread. If you've read through all this, you should have a good idea of what's going on, and we can figure out how best to deal with the situation.
EitB 25 - Perpentach
Occasional mapmaker
Occasional mapmaker