User:Eliria/spy

As soon as you possess a hideout you can train spies. For each expansion stage you can train an additional spy. To deploy a spy, click the town on the Island Map which you want to gather information on. The option to deploy a spy will appear on the left menu. When you select this, one of your spies will try to infiltrate the town. When a spy has successfully infiltrated a town, you can assign missions from your hideout.


 * Requires: Research: Espionage and building: Hideout

The math
In layman's terms: Add mission risk base to current risk, subtract target town hall level multiplied by 6, subtract your hideout level multiplied by 2, add risk generated by defending spies working in target city multiplied by 15 (your opponent's spies, not yours). If calculated value is between 5 and 95 then this is Total Risk, if it's below 5 then Total Risk is 5%, if it's above 95 then Total Risk is 95%.

The algorithm: $$ Calculated Risk = C + M + s\cdot15 -t\cdot6 -h\cdot2$$ $$If Calculated Risk < 5\%, Total Risk = 5\%$$ $$If Calculated Risk > 95\%, Total Risk = 95\%$$

Where $$M$$ is equal to the Mission Risk Base; $$t$$ is equal to the target town level; $$h$$ is equal to the hideout level; $$s$$ is risk generated by each spies working defense in target city; $$C$$ is equal to Current Risk.

Risks?
There are three different kinds of risks calculated in this game.
 * Calculated Risk
 * This is the intermediate risk after performing the calculations in the formula above. This number can have a wide range of values from -255% up to 255%. There currently is a bug where if calculated risk is above 255%, the total risk shows 0% with a full bar. This is instant death for the spy.


 * Total Risk
 * This is the risk seen when you look at the spy. No matter what this risk % is, your spy can not be caught. Only by performing actions can a spy be caught. This ranges from 5% to 95%


 * Current Risk
 * This is the risk associated after a successful Spy action. This is usually the number seen on the bar that slowly decreases. There is actually a number behind the scene that counts down past 5% total risk seen on the bar. This value is always between 0% and 95%

Risk Levels
Risk 7 Base:145%: Observe fleet and troop movements

Risk 6 Base:125%: Observe communication

Risk 5 Base:95%: Spy out garrison

Risk 4 Base:68%: Infiltrate Town

Risk 3 Base:65%: Spy out level of research

Risk 2 Base:45%: Inspect Warehouse, Recall Spy

Risk 1 Base:35%: Online status, Spy out treasure chamber

Example:
The algorithm: $$ Calculated Risk = C + M + s\cdot15 -t\cdot6 -h\cdot2$$

Your hideout: $$h=2$$

Target town level: $$t=6$$

Current risk: $$C=0\%$$

Mission: Spy out garrison $$M=95\%$$

Enemy Spies: One spy in defense $$s=1$$

$$\rightarrow (0 + 95 + 1\cdot15 -6\cdot6 -2\cdot2) $$ $$\rightarrow (0 + 95 + 15 - 36 - 4)$$ $$\rightarrow 70 \% $$ Since this is between 5 and 95%, we leave it.

Current risk is increased every time a spy performs an espionage mission; but it cannot be greater than 95%. Current risk drops gradually until it reaches 0% (5% total risk still visible). If current risk is high, it can make even easy missions (like checking online status) hard to perform; so it is advisable to wait a certain amount of time until current risk drops to a lower level.

What does this mean?
With this information we can calculate the enemy's current number of spies in defense. One can also set themselves up with 95% defense in every town. The following table assumes that the enemy's hideout is level 21 or lower. The number of spies in the column represent the minimum number one needs in defense (in your town) to guarantee 95% defense against enemy spy infiltration.

Caught spies
Occasionally, on getting caught, a spy will reveal useful information about his employer. An example, slightly edited for readability (in 0.2.1 in the English version of the game, it is much less readable):

We have discovered a spy! The spy talks and talks and reveals everything about his employer:

Home town: Zagreb

Gold in town: 12095 Building material in town: 2160 Wine in town: 256 Marble in town: 62 Crystal glass in town: 246 Sulphur in town: 525

35 Slinger 1 Swordsman 5 Phalanx 1 Ram-Ship

We have "retired" this spy, to prevent him from giving away any more information.

Your spy doesn´t answer?
If unfortunate, you may get a report like this:

"Spy on mission
 * "* C.... (27,34)
 * "* Your spy doesn´t answer anymore"

Your spy has been caught in the target city, and "retired." Based on a random chance, he may give a report as shown in the above section, they may be informed of what he was trying to do, or they may receive no information other than his capture.

You will need to train and deploy a new spy as a replacement.

some times you may also get a report may also get a like this: An example, slightly edited for readability

Mission: 	Online status

Target town: 	Ysabel

Status: 	Mission aborted...

Report: 	Your spy was discovered, but could flee in time. He is now returning to your home town. You should give him a little rest...

Vakooja Vakoilija Espion Kém Generaler