Unit-ship:Spy

__NOWYSIWYG__

General information
As soon as you build 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 in which you wish to gather information on. The option to deploy a spy will appear in the floating 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. __NOWYSIWYG__

Spies=

The math
Add mission risk base to current risk, subtract defending/target town hall level multiplied by 2, subtract the attacking hideout level multiplied by 2, add risk generated by defending spies working in defending/target city multiplied by 5.

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 + 5s + 2e - 2t - 2h$$

$$If Calculated Risk < 5\%, Total Risk = 5\%$$

$$If Calculated Risk > 95\%, Total Risk = 95\%$$

Where $$C$$ is equal to Current Risk (see Risks section below); $$M$$ is equal to the Mission Risk Base; $$s$$ is risk generated by the number of spies working in defense in the defending/target city; $$e$$ is equal to the defending/target's hideout level; $$t$$ is equal to the defending/target town level; $$h$$ is equal to the attacking hideout level.

A simplified version of the above algorithm can be used to determine the Calculated Risk of catching or stopping an attacking spy, by making certain useful assumptions:


 * All of the spies in the defending/target hideout are working in defense: $$s = e$$
 * The attacking hideout level is 32 (most large towns have this): $$h = 32$$
 * An attacking player will wait til attacking spy's Current Risk is 0: $$C = 0$$

Thus the simplified algorithm for defense: $$ Calculated Risk = M + 7e - 2t - 64$$ __NOWYSIWYG__

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.


 * 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%


 * 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%. __NOWYSIWYG__

Risk Levels
__NOWYSIWYG__
 * Risk 1 Base: 5% - Infiltrate Town
 * Risk 2 Base: 24% - Spy out treasure chamber
 * Risk 3 Base: 30% - Inspect Warehouse, Recall Spy
 * Risk 4 Base: 40% - Spy out level of research
 * Risk 5 Base: 50% - Online status
 * Risk 6 Base: 70% - Spy out garrison
 * Risk 7 Base: 80% - Observe fleet and troop movements
 * Risk 8 Base: 90% - Observe communication

Example
The algorithm:

$$Calculated Risk = C + M + 5s + 2e -2t -2h$$


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


 * Mission: Spy out garrison $$M=70\%$$


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


 * Level of target town's Hideout: Level 1 $$e=1$$


 * Level of target town: Town hall Level 6 $$t=6$$


 * Level of your Hideout: $$h=2$$


 * $$0 + 70 + 5\cdot1 + 2\cdot1 -2\cdot6 -2\cdot2 = 61$$


 * The risk for the mission is then: $$61\%$$

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. __NOWYSIWYG__

Town Spy Defense
Remember the previous simplified algorithm:

$$ Calculated Risk = M + 7e - 2t - 64$$

For Spy Infiltration: $$M = 5$$

With this information we can calculate what level of hideout you need to prevent spies from infiltrating your town or how much protection you are getting from your current level of hideout. The following table uses the formula above with its assumptions that the attacking hideout is level 32 and all of the spies in your defensive hideout are working in defense. It visually shows you what the percentage chance of catching a spy is, for a given defending town level and its hideout level.

The column at far left shows in ascending order the level of the defensive hideout. The remaining columns represent the defending town's level, $$t$$. The numbers in the middle of the table represent the percentage Risk for catching a spy that is attempting to infiltrate.

To determine the level of hideout you need, trace over to the current level of your town. Then trace down that column until you reach your desired percentage chance of stopping the spy. Trace over to the left on the same row until you reach the far left column, and this number will be your required defensive hideout level, assuming all of its spies are working in defense.

For example, if you have a level 6 town, and you want to stop a spy from infiltrating at least 75% of the time, you need go to the column at the top that says, $$t=6$$. Then scroll down that column until you reach a number that is 75 or higher. In this case it is $$76$$. Then trace over to the left on the same row until you reach the far left column, and you will see that you need a hideout level of $$21$$.

To determine your current % protection from infiltration, with one finger find your town level, $$t$$, at the top, and trace down that column. With the other finger find the row with your current hideout level at the left, and trace across to the right until both fingers meet. The box, where your two fingers meet, will show you what your current % protection from infiltration is.

Additional Notes:

To determine your level of protection if some of your spies are not working in defense (i.e. spying on other people), then simply subtract 2% for every spy on a mission from the number in the box.

The two exceptions to this rule are when the number in the box is 5 or 95. If it is 5, it will always remain at 5. If it is 95, then you can use the formula below:

$$Calculated Risk = 7e - 2a - 2t - 59$$

Where $$a$$ is the number of spies who are not working in defense (i.e. spying on other people).

Caught spies
Occasionally, spies are being caught due to high level of spy out chance. However, the level of spy out chance will decrease after a certain amount of time and will increase again after another mission.

If unfortunate, you may get a report like this:

This means that your spy has been caught and executed, so he won't be able to return to your town. Based on a random chance, he may give a report as shown in the above section, so the player you wanted to spy may be informed of what he was trying to do, how many resources you have in your town, how many workers you have assigned on your island or how many and what units are stationed in your town. There also a chance that they may receive no information other than the spy's capture. You will need to train and deploy a new spy as a replacement.

Some times you may also get a report like this:


 * 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...

The player you wanted to spy will be informed about your spy that has been caught and maybe the mission he was trying to complete.

Wine is used, but sometimes... they can get rowdy __NOWYSIWYG__
 * Spy Caught Report

Usefulness of some abilities
Due to certain mechanics of the game, the player can automatically observe the wealth of another by looking in the high-scores, opposed to risking the chance of a spy being lost and wasting gold.

Also, observing communications can also be quite futile, as the only things the spy can get is who the enemy is communicating to, and what the subject is, which itself is only limited to certain options. __NOWYSIWYG__ Spying=

Spying provides useful information on towns. First you need to research Espionage and build a Hideout, then you can build Spies.

Once you make a spy for and, you can set him to work by clicking on your target city and using the Actions menu on the far left of the screen to "Send Out Spy." You'll see the amount of risk involved to infiltrate the town, and decide if it's worth spying on them. __NOWYSIWYG__

Spy Abilities
After infiltrating you merely have to click on your Hideout that you trained the spy at, and then you'll see the following image beneath the normal Hideout info:



The name of the city is a link, by clicking it you are able to view the city which your spy has infiltrated! You will be able to view the buildings and building levels which are in that city.
 * 1) Denotes which city the spy is currently in as well as the city's coordinates (which have been edited in this screenshot).
 * 1) The Current Risk meter. Each time you perform a mission using your spy without being caught, the Risk Meter goes up. Waiting will reduce the Current Risk, and the Risk Meter will go down again. The lowest the Current Risk can be is 5%, and this is included in the Mission Risk, meaning what you will see is the Mission Risk + Current Risk when viewing the missions' quoted risk.

There exists the chance on every mission that your spy will be detected. When this happens the player catching the spy even has a chance of determining where the spy came from.

The risk of detection is massively increased for a short time after every mission. Wait a while before you assign your spy another mission to reduce the risk of being detected. __NOWYSIWYG__

Missions
Click the "Mission" button to give your spy an order. You will be shown a screen with a list of missions that may be performed and the risk involved of failing, and possibly getting caught.

Risk rating system: Lower the number, lower the risk. Higher the number, higher the risk.


 * Level of your Hideout - reduces the chance of being detected by 2% per each level.
 * Size of the infiltrated town - reduces the chance of being detected by 2% per each level.
 * Number of opposing spies in the infiltrated town - increases chances of being detected by 5% per each spy defending that town.
 * Level of Target town's Hideout - increases chances of being detected by 2% per each level.

Spies have the following missions:

Spy defense
Each spy in its home town automatically defends against any and all espionage against that town. To be exact, each defending spy adds 5% to the risk of infiltrating the town and missions performed in the town.

Also, the level of the Hideout in the town adds 2% per level to the risk of espionage in that town.

The maximum you can increase espionage risk to is 95%. The lowest risk a mission can be is 5%. __NOWYSIWYG__

Failed spying attempts
__NOWYSIWYG__

Spy doesn't answer
Your spy has been caught and executed. You will have to train a new one to replace them.

Warning: If this occurs it is possible the spy has revealed information to the target, including who sent the spy, what mission the spy was attempting, or even information about the town the spy was sent from such as resources, gold, and personnel in that town. __NOWYSIWYG__

Mission aborted
If he is caught there is also a possibility he will escape and return to the town in which he was trained, preventing any info from being revealed, effectively getting away, but will have failed the mission. __NOWYSIWYG__

Spy Report
Wine is used, but sometimes... they can get rowdy

__NOWYSIWYG__

Tactics
If you want to keep tabs on somebody, starting out by checking if they're on or not using the Online Status mission will let you know if they're paying attention right now. This can be important if you're going to attack somebody, as obviously they can't retaliate or make new troops if they're offline.

Checking their garrison will provide you with the knowledge to decide if you can win a battle, and what to use to fight them. While these tactics are for another guide, attacking with Spearmen against Hoplites is hopeless. Also, checking to see what troops they have will also tell you if they have enough units to fill the front lines slots. If they only have 30 hoplites, for example, you may not need to fill all of the battle slots, since their army will not take much to destroy it after the wall has been breached.

You can see what buildings they have and what level the buildings are by clicking twice on their town in the Island View and hovering over a building to see the level. This can be vital, as knowing what levels their Wall and Warehouse are will let you know how difficult it would be to get past their defenses, and how much of their resources are protected. (Remember, if a player is active, their warehouse(s) protects 6% of its stored goods, but if they are inactive, it only protects 1%.)

Determining the research they've obtained will let you know what troops and ships could prove a challenge.

Observing Troop and Fleet movements will tell you when they have a cargo ship coming in so you can blockade the city beforehand to grab the goods on board. Also, any troops coming back will be sunk, and any enemy ships returning will have to fight you to get past the blockade. This can also tell you who they're attacking and how long those units will be gone.

Observing Communication and looking at the Treasury are the most useless abilities. Observing Communication only tells you the 'subject' - meaning whether or not it was a message or treaty, and who it was with. Not terribly useful. You can also find out how much gold they have by looking at the Highscores and Goldstock score. Neither of these are recommended to use. __NOWYSIWYG__

Risk
The risk involved to infiltrate a town depends on the Hideout level the spy is being sent from, the level of the target town, and how many spies are acting in defense of the target town.

The risk of each mission depends on a fixed percentage for each mission, which is reduced by the Hideout level the spy is being sent from and the level of the target town, but is raised by any spies acting in defense of the target town. __NOWYSIWYG__

Formula
Each level of your Hideout lowers the risk by 2% and each level of the target town lowers the risk by 2%, whereas each spy in the target town raises the risk by 5%. The risk will never be lower than 5% or higher than 95%, however. So there's always a chance to get caught and always a chance to accomplish the mission.

Each mission has a base risk associated with it, which are the following:


 *  Risk Base #1: 5%:  Infiltrate town
 *  Risk Base #2: 24%:  Spy out treasure chamber
 *  Risk Base #3: 30%:  Inspect warehouse & Recall spy
 *  Risk Base #4: 40%:  Spy out level of research
 *  Risk Base #5: 50%:  Online status
 *  Risk Base #6: 70%:  Spy out garrison
 *  Risk Base #7: 80%:  Observe fleet and troop movements
 *  Risk Base #8: 90%:  Observe communication __NOWYSIWYG__

Algorithm
The nuts and bolts:

The risk for a mission is $$ Risk = C + M + s\cdot5 + e\cdot2 -t\cdot2 -h\cdot2$$


 * $$C$$ is the Current Risk (whenever you perform a mission, infiltrate, or evacuate, your Current Risk goes up).
 * $$M$$ is the Mission risk base shown above,
 * $$s$$ is the number of enemy spies in the target town,
 * $$e$$ is the target town's Hideout level,
 * $$t$$ is the target town level,
 * $$h$$ is the infiltrating spy's Hideout level. __NOWYSIWYG__