• Register

By fans, for the fans, Developed by a team of experienced modders from the Paradox Interactive forums, Darkest Hour is a stand-alone Hearts of Iron game featuring a mixture of short and in-depth campaigns set across the darkest chapters of the 20th century, from the outbreak of the Great War up to the onset of the Cold War. Darkest Hour will introduce a new artificial intelligence that is now able to react to hundreds of different situations simultaneously, along with a dynamic diplomatic system that will allow the player to have a real impact on the course of history.

Post feature Report RSS Darkest Hour - Dev Diary #3 - Spying System

This developer diary deals with Darkest Hour's improved spying system.

Posted by on

Darkest Hour - Dev Diary #3 - Spying System

Follow us on:

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

Darkest Hour Screenshot
Darkest Hour Screenshot

Post comment Comments
AirborneSn1p3r
AirborneSn1p3r - - 3,137 comments

great job guys

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: