Darkest Hour - Dev Diary #3 - Spying System

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Fernando Torres

Darkest Hour Game Designer
48 Badges
Dec 2, 2006
10.182
40
rayan-nezzar.fr
  • Rome: Vae Victis
  • Penumbra - Black Plague
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Ship Simulator Extremes
  • Supreme Ruler 2020
  • Supreme Ruler: Cold War
  • Victoria 2
  • Victoria 2: A House Divided
  • Europa Universalis III Complete
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
  • Elven Legacy Collection
  • Hearts of Iron II: Beta
  • Pride of Nations
  • Rise of Prussia
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Achtung Panzer
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • For The Glory
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Crusader Kings II
  • Commander: Conquest of the Americas
  • Darkest Hour
  • Deus Vult
  • East India Company
  • East India Company Collection
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Arsenal of Democracy
  • For the Motherland
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis III Complete
  • Iron Cross
  • Legio
  • The Kings Crusade
  • Lost Empire - Immortals
  • Magicka
  • Majesty 2
  • March of the Eagles




‘Introduction: Some history’

Spying in DD/Arma 1.2 had many bugs: missions that do not work for the AI - including counter-intelligence, broken AI mission selection code, and incorrect messages to name just few. Once we fixed all known bugs in the code and ran some tests using advanced logging (logger is part of DH) we found that in a game AI countries do tens of thousands send and kill spy missions outperforming any player because of the micromanagement involved in the spying and very few real missions (about 10%). It was clear for us that the old system needed to be changed and after some brainstorming and few tries Martin and Chris came up with the spy system used in Arma 1.3.

Its main features are:
- Fixed spying AI - it can do any mission
- Send/kill spies missions removed and replaced with Spy network levels (0..20)
- increased game speed
- all modifiers exported to spy_cost.txt and AI files
- there are more here that are out of my mind after 2 years

These changes while to drastic for a patch and not welcomed by all modders at the time paved the road to the auto-spying system we implemented in DH.

Changes:
- merged AI and player auto-spying code
- cleared spy_cost.txt file and moved old and new spying modifiers to a new section in misc.txt


‘All warfare if based on deception’



That quote from Sun Tzu enlightens the prominent role played by intelligence operations in times of war. But while popular myths have been created around a few people like Mata Hari or Joseph Sorge, intelligence and counter-intelligence operations have truly been of a great importance in the events of two World Wars witnessed by the XXth century. Darkest Hour therefore intends to put a certain emphasis on this matter.

Darkest Hour spying system addresses two main issues which are the realism of the intelligence operations and their planning in the long-run as a Head of State.
The first thing that you need to know is that there two modes: manual and semi-automatic intelligence. While the manual mode has many similarities with Hearts of Iron II spying system, the semi-automatic is much more interesting. There you can allocate a certain part of the national income to intelligence operations. There are also others factors that you can play with such as spy activity or the minimum level of infiltration required prior to any foreign operation.

Furthermore, as the Head of your State, you can assign generic or specific priorities to your intelligence services. Playing the United Kingdom, you might for instance be willing to grab more informations about Nazi Germany. Specific country priorities can therefore be set in that regard.

But there are also missions specific priorities which allow you tell your intelligence services what specific mission to perform (either globally or in a certain country). You will for instance be able to perform only industry sabotage in one country or couple it with industrial espionage, provided that you need two times more sabotage missions.

That way, you have a relative control over the operations led by your intelligence agency. You are also encouraged to plan your spying strategy in the long run and check the reports on a regular basis when you used to be overwhelmed with micro management in Hearts of Iron II (where you had to send every spy and perform every operation manually). Hence Darkest Hour spying system is not a clicks contest but instead, a panel that lets you plan your policy in the long run.
This was also a matter of realism because as a Head of State, you obviously have a certain level of involvement, which sending all spies one by one should be excluded from.

Automation:
- Can be enabled or disabled
- Even when enable players still can do any mission to any country manually if they want
- auto-increase of spy levels to manually set Max level (0..20)
- set spy money threshold (use money above XXX)
- Min. spy level threshold before try to do any foreign missions (0..20)
- Spy activity
- Min chances for every spy mission - do no try a mission if chances are less
- Can add/remove countries from spying list
- Can set country priority for each country in the list
- Can set missions priority for each country in the list
- Can apply same priorities to all countries at once
- Can clear countries list at once

Spy reports, added:
- Transports/Escorts
- Resources
- Submarines, TPs


Moddability


We are also looking forward to making Darkest Hour as mod friendly as possible.
Thus, many parameters will be subject to changes in mods, such as:

AI priorities

Code:
    ###################################
    # Spying
    ###################################
    spyprefs =
    {
       percentage_on_spies       = 0.2
       percentage_foreign_mission    = 0.6

       # Used for Intell efficiency and for setting minimum chance to succeed for the AI to do that particular type of mission
       spyprefsdata =
       {
          NumberOfSpies = 10
          min_number_of_spies = 3
          steal_blueprint = 10
          minister_assassination = 5
          smear_campaign    = 10
          coup = 3
          sabotage_industry = 10
          nuclear_sabotage = 5
          found_partisans   = 10
          massmedia = 10
          disrupt_techteam = 10
          country = CHC
       }
       spyprefsdata = {
          country_priorities   = 4
          steal_blueprint    = 10
          minister_assassination          = 1
          smear_campaign       = 3
          coup             = 0
          sabotage_industry    = 5
          nuclear_sabotage    = 0
          found_partisans    = 2
          massmedia          = 1
          disrupt_techteam   = 5
          country          = CHI
       }
       spyprefsdata = {
          country_priorities   = 6
          steal_blueprint    = 10
          minister_assassination          = 1
          smear_campaign       = 3
          coup             = 0
          sabotage_industry    = 5
          nuclear_sabotage    = 0
          found_partisans    = 2
          massmedia          = 1
          disrupt_techteam   = 5
          country          = JAP
       }
    }

General parameters


Code:
    intelligence = {
    # Days between spy missions in a country. Do not use fractions
       20 #8
    # Days between increase intelligence levels. Do not use fractions
       180
    # Chance to detect the initiator of a spy mission; Values = [0 - 100]; 0 = never detected, Do not use fractions
       20 #50
    # Relationships hit for detected missions
       5 #10
    # Distance modifier: -1000 = No distance modifier; else: Higher value = Distance has smaller effect = Higher Chances
       20
    # Distance modifier for neighbours; Values = [0.0 - 1.0]; 0.0 = No neighbour distance bonus.
       0.25
    # Spy lvl bonus on Distance modifier: 0 = No bonus from Spy lvl's; else: Higher value = Higher bonus from spy lvl = Higher Chances.
       2
    # Distance modifier for Spy lvl's above 10: 0 = all levels use same distance bonus; else: X = bonus for levels 11-20th
       30
    # Spy information accuracy modifier. Values = [-10 - 10]; 10 = Full info
       0
    # IC modifier on Cost; 0: Cost = base cost; 1: cost = base cost * base IC in target; 2 or more: cost = base cost * ( 1 + base IC in target / this )
       1
    # Min IC on cost modifier; If base IC in target < this use this, else use base IC
       30
    # Max IC on cost modifier; If base IC in target > this use this, else use base IC
       80
    # Extra Basic Daily maintenance cost for Spy lvl's above 10th; 0 = no extra cost; X = extra cost for levels 11-20th
       0.5
    # Basic Cost for Increasing Spy lvl's above 10th; 0 = Normal Basic cost; else: Basic cost for each lvl = X
       500
    # Show 3rd country spy reports: 0 = no reports; 1 = only detected; 2 = detected + all successful; 3 = all reports
       1
    # percentage_on_spies to money modifier
       100.0
    }

And mission basic costs and chances

Code:
    intelligence = {


    #   _HOID_SPY_STEAL_TECH_,
    0.8
    #   _HOID_SPY_MINISTER_ASSASSINATION_,
    2.0
    #   _HOID_SPY_SMEAR_CAMPAIGN_,
    1.6
    #   _HOID_SPY_COUP_,
    12.0
    #   _HOID_SPY_SABOTAGE_INDUSTRY_,
    0.8
    #   _HOID_SPY_NUCLEAR_SABOTAGE_,
    2.0
    #   _HOID_SPY_FOUND_PARTISANS_,
    0.8
    #   _HOID_SPY_MASSMEDIA_,
    1.2
    #   _HOID_SPY_DISRUPT_TECHTEAM_,
    0.8
    #   -Base Cost for Increasing Spy lvl.
    0.5
    #   -Base Cost for decreasing Spy lvl.
    0
    #   -Base Daily maintenance cost per Spy lvl for 1-10th lvl. 11-20th levels may cost more.
    0.001


    #   _HOID_SPY_STEAL_TECH_CHANCE,
    35
    #   _HOID_SPY_MINISTER_ASSASSINATION_CHANCE,
    10
    #   _HOID_SPY_SMEAR_CAMPAIGN_CHANCE,
    35
    #   _HOID_SPY_COUP_CHANCE,
    2
    #   _HOID_SPY_SABOTAGE_INDUSTRY_CHANCE,
    35
    #   _HOID_SPY_NUCLEAR_SABOTAGE_CHANCE,
    8
    #   _HOID_SPY_FOUND_PARTISANS_CHANCE,
    50
    #   _HOID_SPY_MASSMEDIA_CHANCE,
    40
    #   _HOID_SPY_DISRUPT_TECHTEAM_CHANCE,
    30
    #   NOT USED
    100
    #   NOT USED
    100
    #   -Dissent modifier on base coup chance: 0 = No dissent modifier; else: Higher value = Higher dissent needed in target country.
    5
    }

And here are the two screen-shots of this week.





We have also posted exclusive screen-shots on our Facebook page and I am pretty sure you would be very interested.
See you next week for a new development diary.
Take care. :)
 
Last edited by a moderator:
Looks great, customisable AI preferences! This should be more widespread, not just in intelligence. ;)
 
It may be the new forum glithes... but I can't see the screenies.

(you don't say I don't have to :D)
 
You can modify lots of things in DH mods.
There will be an entire DD about that. :)

Hehe, I doubt I'll be able to do what I have in mind here. Things like AI production control (strive for 10% ARM, 30% MOT etc) or Air/Naval control (cut off England/struggle for Air Superiority wherever we go etc). ;)

And no, HoI3 is not what I'm looking for here, there the AI was fully automatic, non-customisable (not in-game anyway).
 
Looks nice! :D
 
The new Intel system looks really nice.

Looking forward to play it!
 
Hehe, I doubt I'll be able to do what I have in mind here. Things like AI production control (strive for 10% ARM, 30% MOT etc) or Air/Naval control (cut off England/struggle for Air Superiority wherever we go etc). ;)

And no, HoI3 is not what I'm looking for here, there the AI was fully automatic, non-customisable (not in-game anyway).

You can do these things. :)
 
Perhaps it's time to get some bonus on detection (fog of war) related to intelligence relative level between two countries, modified by encryption/decryption. The way spionage it's actually working in HoI2s it's almost useless IMO (the only mission I use is steal of blueprints, and I don't know how it usually gets the worst one).