How is the amount of energy stolen in a Siphon Energy Covert Operation determined?

The Siphon Energysiphon energy covert operation has the following description:

Diverts energy resources from the target city to the player.

However I can't find anywhere on the web where it describes even roughly how the amount of energy stolen is calculated. I know that I tend to get more in late game, and I think on one of the 3 wikis I saw a x1, x2, and x3 multiplier but no mention of what conditions trigger them. Perhaps different ranks?

My best guess is either city population, city energy production, or total science of the victim civ have some impact on the amount stolen, though that could be totally wrong.

How is the amount of energy stolen during a Siphon Energy Covert Operation calculated?


Solution 1:

Edit: Found the values for "getCovertOpsRewardPercent", it was in one of the XML files for some reason. The value scales depending on game speed and is as follows:

Quick: 67 Standard: 100 Epic: 150 Marathon: 300

So, you should be able to actually fill all the numbers in for the final function and get an accurate estimation of what does what.

Original: So, the thing about Civ games in general is that they don't do a lot to hide the inner-workings. Most of the aspects of the game, including cover ops, are run by Lua scripts you can find just in the game directory. In this case, the answer is in a file called SiphonEnergyCovertOperation.lua.

It's only 107 lines long and the part of interest is a single function, shown below:

----------------------------------------------------
-- Operation-specific Functions
----------------------------------------------------
function Operation.GetRewardEnergy(agent)
    local player = Players[agent:GetOwner()];
    local rank = agent:GetRank();

    -- Base reward
    local reward;
    if (rank == CovertAgentRank.RECRUIT) then
        reward = 5;
    elseif (rank == CovertAgentRank.AGENT) then
        reward = 10;
    else
        reward = 15;
    end

    -- Modifiers
    local modifier = 0;
    modifier = modifier + Game.GetGameTurn() * 0.2;

    -- Scalars
    local scaler = 1;
    scaler = scaler * Game:GetCovertOpsRewardPercent() / 100;

    reward = math.ceil((reward + reward * modifier) * scaler);

    return reward;
end

return Operation;

So, at the time of this writing, 3 months after being asked so it might have been patched, energy is determined like this:

  • Start with a base value of 5, 10, or 15, depending on agent rank.
  • Get a modifier from what turn it is, taking the turn number and multiplying it by 0.2
  • Get some other "scalar" that I can't really find the base of in the Lua files. The "getCovertOpsRewardPercent()" function seems to be one of the hidden-from-user things. Presumably it's a decimal number between 0.0 and 1.0 if it's a percent. It's then multiplied by 1...which is 1, then divided by 100.
  • Plug into the final equation. (math.ceil basically just rounds the number up to the next highest integer) So, (reward + reward * mod) * scalar. Lua follows normal math order of operations, so the multiplication inside of the parentheses goes first, then the addition inside the parenthesis with the product of that multiplication and then the multiplication of that sum with the scalar.
  • The result is the amount of energy you get from a successful op.

Sorry I can't give exact examples, but that mystery "getCovertOpsRewardPercent()" eluded my search for what the value actually is, and while I have an educated guess (0.0-1.0), I'd prefer not going on just a guess.