1. Espiocracy
  2. News

Espiocracy News

Dev Diary #37 - Behavior of Actors 🧠

What's happening / TLDR: Developer diaries introduce details of Espiocracy - Cold War strategy game in which you play as an intelligence agency. You can catch up with the most important dev diary (The Vision) and find out more on Steam page.

---

Actors - influential individuals and organizations, capable of changing history - are the main building block of historical simulation in Espiocracy. Today we'll explore their AI.

This is a fascinating engineering problem! We want:

  • Believable, interesting, sometimes cunning behavior
  • via ~50 adjustable and moddable actions
  • for 1500-2500 (!) actors active at any point
  • in the real-time-ish game with very limited computational budget per actor
  • without employing a team of AI programmers to craft and maintain large behavior trees or complex state machines

Playing to our strengths, we have:

  • Many historical samples. One of the best sources is CIA archive of Presidential Daily Briefs, counting thousands of reports on precisely described political activities.
  • Unlimited ability to run millions of simulations offline (= during development, before the release), to collect rich statistical data on the effects of any behavior in the game world.
  • Audience of players in 2023. Most of them do have not bad GPUs, 60% have 6+ CPU cores, 93% clock them at 2.3+ GHz, 69% use 16+ GB RAM.

If you've been anywhere near computer science in the last few years, you know where this leads to: machine learning. The game does not have computational budget for glamorous deep neural networks, but it has enough for two efficient models (regression & gradient boosting) at the heart of actor behavior, which do all the heavy lifting (training) before the game is installed on your computer and then use this compressed knowledge (inference) to control decisions of actors in gameplay.

Naturally, these models are embedded into a wider solution that starts off at an unusual place.

[h2]Motivation and Goals of Actors[/h2]

All living organisms have to maintain homeostasis, an internal balance of parameters such as temperature, otherwise, they will die. Peter Sterling and Joseph Eyer proposed that evolution invented brains to switch from reactive to predictive homeostasis (allostasis). After all, organisms cannot react to fatal disruptions - but they can try to predict them. This point of view was picked up in the last decade by the theory of constructed emotion in which Lisa Feldman Barrett posits that human emotions are predictions, not reactions. Instead of mere emotional response to external stimuli, our brains may build internal models of the future and give it a meaning that is perceived, i.a., as emotions. Returning to the example of temperature regulation, we evolved from cells that simply swim away from the cold, into cavemen who can be happy at the end of severe winter, while it's still cold, because we understand seasons and know that soon we'll be embraced by warm spring.

Remarkably, this approach to cognition is inversely mirrored by the critique of AI in games. AI is stupid when it can be easily duped (cheesed) with any ploy to which it will be too late to merely react, when it does not have a sense of self-preservation, cannot predict the consequences of its actions, remains predictable instead of predictive, or does not creatively prepare for the future.

Therefore, actors in Espiocracy are first and foremost allostatic forecasters.

(To be clear, we are not discussing AI of players competing with a human player, to be described in a different dev diary. This one is solely about actors, autonomous NPC-like entities.)

On the most basic level (lizard brain), actor behavior is guided by three needs and goals:

  • Survival - staying alive or not dissolved
  • Growth - increasing influence (which factors in wealth, number of members, etc.)
  • Impact - changing the world according to ideologies, views, traits, opportunities, etc.


These are precisely and consistently quantifiable parameters. For instance, the need for survival increases when an actor's life is threatened by enemies, diseases, or the possibility of imprisonment followed by execution. The three parameters together (squared and multiplied by personal weights) contribute to the overall level of motivation of the actor. High enough motivation pushes the actor to launch actions that will meet needs and goals which caused motivation to increase. If you see here remnants of a perceptron, you're dead right.

[h2]Predictive AI 1: Acting on Needs and Goals[/h2]

Actions available to actors range from universal (such as fleeing the country) to type-specific (e.g. armed organizations able to raid a place) or even role-specific (a member of government defined in the constitution able to propose launching a war). The first example, running away, is easy to understand in the context of motivation. An actor highly worried about survival may flee the country. Once the actor is away from the threat, the need for survival does indeed decrease. Note that actions do not directly satisfy needs or goals, fleeing didn't give straight +20 to own survival, and instead, it worked through decoupled mechanics that underly the calculation of survival. (This is the critical ingredient that allows the mechanisms described below to work.)

Many actions, however, are more complicated than fight-or-flight response.

In the real life, this is where we would do the thinking - use domain knowledge and an internal model of the world to predict what a particular action would achieve. Generally, AI programmers replicate this process in the code but Espiocracy approaches it already in reconciliation with Sutton's bitter lesson and throws a lot of cheap compute at the problem: data about consequences of actions are collected from many simulation runs (with actions or action combinations paired with corresponding changes of goals and context vector), then these are used to train simple regression models (one per action), which regularly infer predicted values of need-goal satisfaction for every available action.



For the simplest example of action, we're essentially gathering data on how often/much fleeing the country actually saves an actor's life. Things get interesting when we start to compare actions (as a kind of internal model of the world!), for instance in this case an actor fighting for survival may plead for help, attack head-on the perceived threat, or resign from the role. This choice is influenced by availability (closed and well-guarded borders make fleeing much harder), traits (some actors will never flee), personal weights of needs and goals, competence parameter (less competent actors make less optimal decisions), and a small injection of randomness.

Computationally, a lot depends on the context vector and frequency of inference. Currently, these are tied to a regional level (a few countries), which means that action-need predictions are recalculated when, i.a., a war erupts in the region. I would worry more about it (and massage features in the vector or build a tree of models tailored to actor types) if I wouldn't have two other major components of the predictive AI.

[h2]Predictive AI 2: Simulating the Future[/h2]

Our brains can play out not only the consequences of an action - we can also predict what will happen without our interventions. More than simple extrapolation, we can sense dramatic shifts such as the consequences of losing an election.

The game regularly prepares simplified simulations of the future at different levels of detail in four timescales: 2 weeks forward, 2 months, 2 years, and 2 decades. Simulations focus only on the most important events (such as political changes) and approximate their influence on actor goals. Then, individual actors, depending on their influence, competence, position, and access to knowledge can tap into the information about changes to their future needs and goals. This creates lovely emergent motivation, for instance, a political leader anticipating his future loss, and prompted to prioritize growth over impact or even survival before an election.



Of course, the difference between natural prediction and clairvoyant cheating AI depends on the details of implementation. For this reason, simulations are generally about the overt world (e.g. no equivalent of intelligence mechanic from OpenXcom), and "tapping in" slowly grows into a complex algorithm (but it's more interesting to write code about access to information in an intelligence game than about directly scripted behavior!).

[h2]Predictive AI 3: Deeper Actions[/h2]

It's no coincidence that there are three goals and three predictive components. They were aligned in their developmental origin: survival-satisfaction, growth-simulation, and now it's time for impact - deep actions.

Actors intentionally change (impact) the history via actions-target pairs chosen by the second model, trained to spot changes in alternate history (instead of changes to needs and goals). Collected data about actions (enriched by flexible vectorized targets) is paired with influence on State Power Index, both short-term and long-term. In search for directional parameter that widely grasps all the significant events from writing influential books to winning the space race, it turned out that SPI is a robust-enough approximation, that also ties this more complex model (at the moment it's gradient boosting machine) to the logical attempt at making the actors try to improve the position of their country relative to other countries (it's not all roses, subverting another country also increases your SPI).



Not all actors will prioritize this kind of impact due to the weighted nature of needs and goals. Expanding on the tailored approach of all the other shallow actions (which takes into account traits or competence), here the model chooses actions from a list generated by the actor's ideologies, views, past experiences, or friendships and conflicts with other actors.

[h2]Final Remarks[/h2]

After staring into the abyss of predictive AI, in the next dev diary we'll look into other avenues of actor activity (such as reactions and storytelling features) on March 10th.

If you're not already wishlisting Espiocracy, consider doing it:

https://store.steampowered.com/app/1670650/Espiocracy/

There is also a small community around Espiocracy:



---
"Physical concepts are free creations of the human mind, and are not, however they may seem, uniquely determined by the external world. In our endeavor to understand reality we are somewhat like a man trying to understand the mechanism of a closed watch. He sees the face and the moving hands, even hears its ticking, but he has no way to open the case. If he is ingenious he may form some picture of a mechanism which could be responsible for all of the things he observes, but he may never be quite sure his picture is the only one which could explain his observations." - Albert Einstein & Leopold Infeld, 1938

Dev Diary #36 - Worldbuilding 🏗️

What's happening / TLDR: Developer diaries introduce details of Espiocracy - Cold War strategy game in which you play as an intelligence agency. You can catch up with the most important dev diary (The Vision) and find out more on Steam page.

---

Worldbuilding is commonly associated with largely fictional worlds (think: Tolkien, Pratchett, or George Lucas) rather than art rooted in historical accuracy. Even in deeper alternate-history scenarios, the world is more of an extrapolation than an invention. Espiocracy, however, walks the path much closer to worldbuilding due to the subject matter (many "alleged" and "classified"), sheer need for details, and requirements posed by the emergent nature of gameplay.

Today we'll explore the ontology of our game world.

As hinted in DD#24, the entire world is built out of entities (a conceptual element of the domain of discourse, or just a fancy word for a thing that is less material than "a thing" and less mathematical than "an element"). These are divided into two main categories: physical objects and mental concepts.

Subject to change and already slightly outdated.

In an implementation closer to colony builders rather than classic strategy games, all entities have parameters, belong to hierarchic categories, are dynamic, can be manipulated, and can interact with other things. Instead of designing strict rulesets with hardcoded units, the game bakes an inherently emergent simulation, where every cog in the machine - every country, player, ideology, city, and so on - can be potentially modified.

All mechanics described in the previous 35 dev diaries utilize this system to some extent. There are even mechanics mostly nailed by sheer relationships between these entities. For instance, an intelligence operation launched by the player exists in the game world as a mental concept, which means that it can be even a subject of a view (eg. guilt after assassinating X), which in turn is a thought that, unless recorded on a medium of thought such as documents, resides only in the mind of a human or a group of people and can perish with death of minds harboring this thought. This is not a special mechanic for generating and then killing guilty operatives, it's natural worldbuilding. The possibilities, also for modding, can be spectacular - technically, it is possible to develop a 1984-ish mod where players can erase entire mental concepts from existence, even countries (as an organization, as a mental concept from the minds of people, and from all the records). Likewise, on the physical side of the entity spectrum, any physical object can be destroyed, up to the hellish mod which can take an advantage of the fact the Moon is also a physical object in the game world. (Kōan: will biblically accurate angels be modded in as physical objects or mental concepts?)

[h2]Traits[/h2]

To illustrate the power of universal entities building the game world, let's take a look at an innocent feature: traits.

Game designers usually pick a single entity (or a few) to be fleshed out by traits. This is a result of their costly implementation and maintenance - that is, costly if you implement entities separately. In Espiocracy, all world entities can get traits and the same traits may be even applied to more than one type of entity because they are implemented on the level of hierarchic categories (and because the code doesn't shy away from the OOP beauty of C#). Here's an example of a city with a set of traits:



"Sea of Rubble" can be applied to any kind of infrastructure - for instance to the economy of a nuked country. To find another example, "Impulsive" can be a trait of any human - an operative, a president, or a witness. Beyond storytelling and modding possibilities, traits can also form the basis of universal decisions, such as rebuilding critical infrastructure or transport networks to remove its "Sea of Rubble" trait.

[h2]Gameplay[/h2]

The universality of entities is reflected by the user interface. Any entity can be selected. A click on a country on the map de facto selects it as an organization, one of the actual entities existing in the world:



After selecting an entity, you get not only details about it (either a standard rundown of details or a designed widget for more important categories such as above), but also hyperlinks to related entities (eg. local events listed above are links to relevant mental concepts), and possible interactions (buttons on the right).

Interactions follow the same principle of emergence. All items can be moved or stolen, all humans can be killed, all thoughts can be disseminated, and so on. Moreover, many of these interactions are enhanced by the rich toolbox of an intelligence agency, meaning that the player can for instance pull off ~20 types of intelligence operations against any human in the game world, from kidnapping all the way to expelling.

[h2]New Entities[/h2]

Entities in the world are initialized historically (more on that in the next section) and spawned during the campaign. At the moment, there are three methods of procedural generation:

  1. New entities are derived from existing entities. A population may create a new actor to act on popular views, sprawling economy may lead to the establishment of a new city, and so on. Entities can also undergo internal-external changes, such as organizations creating branch organizations, a new organization created in a merger, or splitting one entity into a few new entities.
  2. For most important categories, such as actors or countries, there are sublayers - they contain entities nominally belonging to a different category, but with a high potential to be promoted. For example, the "sublayer of actors" contains people and organizations who are not yet (or no longer) influential enough to be actors influencing the country and the world. Usually, when an existing actor is deposed, the vacuum is filled by promoting one of the leading subactors (which creates nice small gameplay around supporting/subverting them to reap benefits later).
  3. Inventing from zero is either achieved via simulation engines (eg. top intelligence operatives created by a separate full simulation or new witnesses spawned as side products of an operational simulation) or, in simpler cases (eg. spy gear), spawned by various mechanics.

[h2]Historicity[/h2]

It is said that a historical game becomes an alt-history game the second it is unpaused. Espiocracy, to pursue more interesting gameplay, takes it one step further and by default engages the engine of alternate history before the game is unpaused.

This is motivated mainly by the huge benefit of hindsight issues in the world of espionage. Take for instance very popular case of Kim Philby - at the start of the game, in 1946, he was a high-ranking member of MI6 and a Soviet spy. Featuring him precisely in this form creates an obvious degenerate strategy for at least two players, a move so obvious that it's a meaningless chore instead of genuine gameplay (British player should always chase Philby, Soviet player should always recall Philby before he's imprisoned).

The solution? Gradual randomization in the form of historicity setting.



10/10 corresponds to Philby in MI6 and all the other entities roughly the same as in history. It is still alternate history (some holes in historical records have to be filled) but players interested in historical accuracy will still be covered. While I believe that this type of gameplay has many disadvantages in the context of espionage, I'm a larger believer in giving players full customization of experience.

Every lower level gradually randomizes locations, dates, types, and entities themselves. This is implemented in a two-fold way - by actual randomization of the initial state and running a simulation of the game world before the start date, longer with a lower historicity level.

Default recommended level will be probably set to 8/10. This is where there is a high-ranking Soviet agent in the West but not Philby and not in MI6. It also corresponds to more scrambled plans of actors in the game world, slightly altered incoming political changes, or modified views, facilitated by approximately two months of pre-game simulation.

Lowering it further starts to build the world in a more verbatim sense - for instance, changing the position of fossil fuel deposits (to the point where Arabian oil ceases to be a hindsight). By elongating pre-start simulation and lifting limits on its course, it may even lead to slightly changed borders or different political processes in place, all while ensuring relative historical plausibility (eg. Germany may start as an already unified neutral state).

[h2]Final Remarks[/h2]

Next dev diary will be posted on February 24th.

If you're not already wishlisting Espiocracy, consider doing it:

https://store.steampowered.com/app/1670650/Espiocracy/

There is also a small community around Espiocracy:



---
"You had to start wondering how the fresh water got in and the sewage got out... World building from the bottom up, to use a happy phrase, is more fruitful than world building from top-down" - Terry Pratchett

Dev Diary #35 - The Map 🗺️

What's happening / TLDR: Developer diaries introduce details of Espiocracy - Cold War strategy game in which you play as an intelligence agency. You can catch up with the most important dev diary (The Vision) and find out more on Steam page.

---

Welcome back after holiday break! As the tradition (of 34 installments...) suggests, we'll start with a lighter dev diary: this time, about the map in the map game.

[h2]Background Map[/h2]



Espiocracy implements old school 2.5D approach - player moves the camera in 3D at an angle, but all elements are 2D. In a classic trick, detailed 3D model of Earth was rendered into 248 two-dimensional textures. Not only the computation is done once and for all of the terrain (= better performance, lower requirements, easier development), we also get rather unique relief map of the world at resolution of 43x21 thousand pixels.

From day one, CIA maps were primary inspiration, which contributed to the choice of Robinson projection for the map. In a very topical accident frozen in time, the game actually uses... a CIA variant of Robinson projection, used in The World Factbook, which means that it's probably literally unique game map.

A few examples of zoomed in camera, starting with Indonesian labyrinth:



Korean Peninsula:



The Great Lakes region:



Tasmania:



And here's practical demonstration of the resolution, max zoom into Galápagos Islands:



These are more of an unintended harvest. Relief map remains always in the background and players preferring calm screen can switch to even more old school paper background:



Ultimately, they all serve the king of map types...

[h2]Political Map[/h2]



(This is the political map for the start date of March 5th, 1946. Protectorates and colonies share color with controlling countries. Thin west-facing stripes denote occupation (stripes have color of occupying state or states). Thick east-facing stripes denote territory controlled by subnational militant organization.)

Political map features de facto states. Following statehood criteria of Montevideo Convention...

  1. Permanent population
  2. Defined territory
  3. Government
  4. Capacity to enter into relations with the other states

...and gameplay criteria (every independent state is a player, has its own intelligence community, set of actors, available international actions etc), enriched by historical foresight, I made the following decisions:

  • Occupation zones - were consolidated where possible (eg. Allied-occupied Austria) or featured as separate states when setting up a conflict (eg. West and East Germany)
  • Ephemeral states around 1946 which were protected by another country - featured (eg. Newfoundland and Labrador)
  • Ephemeral states abandoned by other countries - represented below state level (eg. Second East Turkestan Republic)
  • Participants of civil wars with fluid territory - represented below state level (eg. Viet Minh)
  • De facto states with defined territory, invaded soon after 1946 - featured (eg. Tibet, Oman separated from Muscat, India divided into British India, Travancore, Hyderabad, Bhopal, Jammu and Kashmir, other princely states)
  • Excessive number of small nearby states that acted or will soon act together - consolidated (eg. Trucial States, British West Indies, 500+ princely states except for the four above)

A few closer glances:







While inclusion of states is a careful process, the game includes as many territories, enclaves, and islands as possible in the limited development time. Currently, there are 193 islands in Espiocracy. These provide very palpable geographical approach to the Cold War, from SIGINT installations to Argentina invading the Falklands or USA invading Grenada.

[h2]Gameplay[/h2]

High resolution of the map is not really an aesthetic choice - it is motivated by the gameplay and simulation. Instead of provinces, the world in the game is represented as 5100x2650 grid (with higher precision when needed). Operatives and actors travel in this coordinate system, cities or battles have precise points, rebel or armed conflict territory expands point by point, and most importantly: borders can be drawn in myriad of ways.

To assist alternate history and avoid bordergore, determination of borders (eg. in peace treaty) is supported by database of historical and natural borders. Here's an example of multiple layers of suggested borders in Germany (work in progress):



You can see here Weimar Republic states, administrative units of Nazi Germany, forward positions on V-Day, Anglo-French-American division, mountains, and rivers. The database will slightly evolve over the course of a campaign (eg. less significant & older borders will be forgotten - who remembers V-Day positions in 1995? - while new conquest or rebellions will leave new traces), although lines with the highest weight will remain unchanged (natural borders).

[h2]Final Remarks[/h2]

That was brief, visual, and light as promised. We'll certainly return to the map in the future - perhaps even two times more, since there's a lot more to talk about, from map modes to special hover UI or keyboard-based map traversal.

If you're not already wishlisting Espiocracy, consider doing it:

https://store.steampowered.com/app/1670650/Espiocracy/

There is also a small community around Espiocracy:



---
"One Soviet general, looking at a map of the territory Russia had acquired on the Karelian Isthmus, is said to have remarked: we have won just about enough ground to bury our dead" - William R. Trotter

Dev Diary #34 - Operations 2.0 💥

What's happening / TLDR: Developer diaries introduce details of Espiocracy - Cold War strategy game in which you play as an intelligence agency. You can catch up with the most important dev diary (The Vision) and find out more on Steam page.

---

This is probably the most frequently asked question about Espiocracy: is the game more about espionage or more about the Cold War?

Although the or is not exclusive, this question often is asked in a less suggestive way, lined with the fear that it's "just a spy game" instead of a sufficiently complex Cold War grand strategy game. My answer - which did evolve over almost two years of development - is usually along the lines of: it's a game about the Cold War from the perspective of espionage. This point of view, instead of subverting gameplay, enriches it in many fantastic ways and is in my opinion critical step in actually capturing the essence of the Cold War ([1], [2], [3]...).

However, deep down in my heart, I'm fine with Espiocracy being (viewed as) just a spy game. The very best craftsmanship is dedicated to espionage mechanics - to make them stand out on their own, to provide strategic and immersive gameplay like no other game. In today's dev diary, we'll return to that part of the game, exploring the core mechanic of espionage: intelligence operations.

(As always, a "2.0" dev diary is not a patch note, you don't have to be familiar with the previous one. Enjoy!)

[h2]The Big Picture[/h2]

In the full UX flowchart of the game, operations occupy large and central area:



There are currently 8 (!) entry points leading into this world - eight distinct ways to launch an operation, from selecting actors to approving recommendations. By design, it follows a hierarchy of attention: the player can designate just a general operation category (eg. "eliminate X, I don't care how"), choose a particular operation type (eg. "murder would cause too much fuss, X should be expelled"), or go into nitty gritty of tactical approaches (eg. "burn agent Y to distance ourselves from the manufactured evidence").



In the spirit of Wittgenstein, operations in the game are defined by shared properties, not only inside categories but also in general. All operations have a target - influential actors, or any human, organization, or object (which means for instance that you can assassinate a witness, and then silence a witness of the previous witness' assassination). Among other universal properties of operations, all of them use prospective outcome which is a 0-10 score summarizing complex factors in one easily understood number. In the previous dev diary, it was tied to probabilities but this is no longer the case (more on that in the next section), as the current prospective outcome is more of a guidance that is both descriptive (takes into account factors that may become important in the simulation) and causal (influences paths taken by the simulation, especially the final attempt at achieving the objective). Here's the combination of targets, scores, categories, and types in the wild:



Once an operation is launched, it can be handled autonomously by operatives but it (again, by the same design principle) oozes with optional player agency. Available decisions include:

  • Meaningful temporal dynamics - operational pause means staying low for some time and losing the tail, whereas aborting the operation may require a daring escape
  • Reactions - operatives asking the player to choose one of the few approaches, options, spend resources, or resolve issues
  • Calls (example below, note that they aren't fixed and evolve during operations) - modifying the operation, covers, priorities, or choosing A over B in trade-offs


As Mark Rosewater, a veteran designer of Magic the Gathering said: "Be more afraid of boring your players than challenging them!".

[h2]Simulations Upon Simulations[/h2]

Hairy dev diary about simulations already spilled the beans about the new shape of operations. To recap in a more literate manner, every operation spawns its own simulation, characteristic for the category and type, which proceeds step-by-step towards the final attempt at achieving the objective, which is usually resolved by at least one other (sub-)simulation. For instance, a recruitment operation progresses day-by-day through preparation, intelligence gathering, preceding meetings, all the way to the final recruitment pitch which is simulated minute-by-minute (beware, radioactive work-in-progress interface):



Practically, the availability and quality of the operational culmination depend on parameters such as tactical intelligence or trust, so operatives increase them through continuous (eg. surveillance) and discrete (eg. breaking in) actions.

That's it. This simple idea, however, contains the entire universe of emergent simulations - hundreds of possible steps and events, actions depending on anything from operative's traits to carried gear, conversation simulation flowing into car chase simulation flowing into shootout simulation, operation A launching operation B, involvement and interactions between many types of participants (journalists, police officers, or even third-party actors)...

[h2]A Game of Information[/h2]

Espionage is about information - who's who, what's happening, why it happens. Espiocracy tries to capture this angle in many mechanics (such as secrets or coup plots) but one of the most, I have to use this word, brazen implementations lies at the heart of operations.

Sticking with the word "participant" introduced in the previous section (unofficial term, that's just how these variables are called in the code), classic operations have three participants: attacking intelligence agency, target, and defending (counterintelligence) agency. However, participants may not know about each other, identity, motivations, or even about particular actions!



Each participant has the parameter of situational intelligence, increased via actions much like other parameters. Zero means no knowledge of the operation - targets and counterintelligence start with 0. First suspicions or rumors slightly increase it, then passive and active probing, acquisition of evidence or even direct contacts raise it further. As with any other parameter, it can be also changed externally in both directions, for instance leaving a false trace may decrease the intelligence of other participants, whereas poor tradecraft or reckless behavior might up it for others.

The strength of the cover and analogous factors determine how much situational intelligence is required to uncover a particular participant's what, who, and how:

  • What - knowledge about the existence of a participant of a particular type
  • Who - identification of the participant
  • How - methods, objectives, and progress toward them

Furthermore, every action has an inherent requirement for situational intelligence, with half of this number required to see the existence of (blacked out) action at all, and values below that hiding completely the action.

Now, on to much-needed practical examples. Three primary perspectives:

  1. As an attacking agency (eg. you try to recruit the target), you start with minimal but steadily increasing situational intelligence. Logically, you don't need situational intelligence to know the details of your operation but it will be useful in spotting (and reacting to) the actions of the target. Moreover, as the counterintelligence service starts sniffing, the higher the situational intelligence, the faster you'll know they're on to you. Although the "who" level here is irrelevant (usually a country has a single CI agency), it's critical to get to the "how" level and get a look into their progress (race with time on many levels) and objectives (eg. huge difference between interception that may just lead to silent expulsion vs ambush with possible casualties, arrests, long-term loss of operatives, diplomatic scandal, etc). Moreover, the full what-who-how path applies to other participants, for instance, press or police forces getting involved.
  2. As a counterintelligence agency (eg. someone tries to recruit an actor in your country), you start with no knowledge of the operation. Usually, in the course of regular surveillance, you get a wind that something is brewing - an operation category, a target, or an agency, depending on calculated required levels of situational intelligence, which is communicated in appropriate notification. Then, counterintelligence operatives pursuing leads increase the situational intelligence to uncover any of the following: target's what (eg. a political leader), who (eg. actor X), and how (their stance and actions); attacking agency's what (eg. from country Y), who (eg. agency X; may be irrelevant), and how (their objectives, methods, progress, actions); other participants. All of these also directly contribute to available decisions and methods, sometimes like dominoes, for instance discovering the involvement of the press allows the player to pressure them into revealing situational intelligence collected by them which in turn reveals details on other participants.
  3. As a target (eg. someone tries to recruit your operative; the targeted player also controls counterintelligence so you can pull off an operational game with two entities simultaneously), you also start with no knowledge about the operation. Generally, targets remain more or less clueless until the final approach (or until a major slip-up of the attacking agency), during which situational intelligence is immediately boosted above what-who-how levels, with the exception of active covers.

For the sake of readability, I omitted active covers in the examples up to the last sentence. Active cover is false what-who-how which overrides required levels of situational intelligence. It's an expensive approach to an operation, where a participant (usually an attacking agency) can hide under the cover of another why, another who, or even another what such as the press, with the entourage of false actions, false objectives, and decisions (eg. change objective for a false-cover-agency while pursuing another real objective).

[h2]Behind The Scenes[/h2]

► At some point in development, operations were also launchable against any process in the game world but it was a tad too abstract, especially with the activity and what-who-how of participants. The UX option remains ("fund a coup") but mechanically it's always about entities engaged in the process, in this case, funding coup plotters.

► Among other tested & shelved ideas, I temporarily implemented the use of situational intelligence even for operations launched by the player. Instead of inherently knowing what our operatives did, they would first have to communicate that to the player - with the ability to manipulate the communication (a.k.a. lie). This was mainly tested in the context of conversations, where contents would be generally hidden from the player, except for the parts revealed by the operative during debriefing. It turned out to be too much of a balancing & debugging pain in comparison to gameplay gain, at least for now - and redundant to better mechanics that handle operatives going rogue.

► "Infiltration" is not the best word to describe break-ins or wiretaps but alternatives ("penetration", "intrusion") work even worse as nouns and verbs in the UI...

► Operations, in a way, are at the forefront of Espiocracy's game design. They are prone to difficult bugs, degenerate strategies, poor UX, or beautifully collapsing simulations. In some cases they resemble a Rubik's cube - the entire game has to be slightly shifted to solve operational issues. As an example of such a case, early prototypes evoked strong fear of missing out on opportunities to launch interesting operations. This was mitigated not only by the improvement of UX and introducing new features (such as, literally, "opportunity" mechanic) but also by shifting code architecture to allow efficient & automatic & regular calculations for all possible prospective outcomes, both for the human player and for the AI. This in turn, initially created an obvious degenerate strategy (regularly launch all the ops with top scores), so new features and shifts followed here. Then, this strategic complexity proved to be challenging for a standard approach to AI, so I started working on an unusual AI system that can handle such operations. Then... you get the picture.

[h2]Final Remarks[/h2]

Operations will definitely receive "3.0" DD in the future, not only because I'm constantly working on them but also because I still didn't mention quite a few interesting angles (such as operatives traveling on the map, operations with evolving objectives, or post-operational fallout).

If you're not already wishlisting Espiocracy, consider doing it:

https://store.steampowered.com/app/1670650/Espiocracy/

There is also a small community around Espiocracy:



---
"Challenge between intelligent people on both sides" - Aleksander Makowski, a spy who tracked UBL, on what makes intelligence operations thrilling

Dev Diary #33 - National Assets 🏭

What's happening / TLDR: Developer diaries introduce details of Espiocracy - Cold War strategy game in which you play as an intelligence agency. You can catch up with the most important dev diary (The Vision) and find out more on Steam page.

---

"Elephant in the room" is one of my favorite English idioms. Game development seems to be filled to the brink with such elephants - important features that should be addressed but were pushed to the side. I've been using this phrase frequently enough to coin the abbreviation "EITR" in the design notes.

After addressing significant EITR two weeks ago (precise gameplay progression), it's time to meet its sister EITR: the economy. This dev diary, however, is not titled The Economy because the system developed to flexibly represent economic factors turned out to be a fantastic framework for a much wider game world. Now, the economy is just one of the 8 sectors of national assets.

Assets in Espiocracy represent infrastructure and objects of national importance. They are passive (non-actors!), exist on the map, provide local effects, can be developed or destroyed, sometimes even stolen. The player, an intelligence agency, has a few modes of interaction with them, but assets primarily are an orchestra in the background, playing a symphony of differences between countries.

Let's jump straight into examples to get the gist of the system.

[h2]Examples of Assets[/h2]

Deposits are the prime type of national asset. There are three types of deposits: fossil fuel, strategic minerals, and uranium ore. Originally (unless the 1946 situation was different), these assets are dormant, located in predetermined areas on the map, and have defined depth/size of 1 to X, relative to other deposits around the world. A state or private entities can invest into upgrading them to extraction facilities, which then enable internal effects such as driving the expansion of civilian infrastructure, and international tools such as an ability to sign trade agreements or enact embargoes.

As a part of mentioned civilian infrastructure, we can look into electricity. It's an asset measured in national coverage from 0% to 100%+, representing popular access to the electric grid (with a surplus over 100 generating international income). Its effects are a not-yet-refined web of influences on other assets and aspects of the game world, including for instance changing the spread of dissent, following the example of North Korea literally keeping people in the dark.

For a more unusual national asset, let's discuss significant works of art. The game features internationally known pieces as physical objects, which are protected, can change hands, or be destroyed. Some of them can be even a matter of diplomatic dispute - for instance, collections of the British Museum. These assets are represented both as concrete named entities (eg. the bust of Nefertiti in Berlin) and in abstract numbers (eg. 2,000 historical paintings). Instead of passive effects, they have intrinsic value (can be stolen by actors, including the player, and sold on the black market), also in terms of the status quo (eg. loss of a significant piece after a break-in can lead to changes in police forces).

[h2]Full Landscape[/h2]

Current full landscape of assets, subject to change:



This system combines in a simple leap quite a few interesting contexts:

  • Postwar damage and theft (eg. many European countries start with severely damaged cities, airports, etc)
  • International control (eg. Czechoslovak and East German uranium deposits are de facto controlled by the USSR)
  • Economic ownership (a subtle attempt at modeling differences between a command economy and capitalism, we'll see how detailed it will be)
  • Development over the course of the 20th century and beyond (eg. electrification)
  • True motivation for destruction (eg. terrorists targeting concrete significant buildings)
  • Famines, shortages, and other crises
  • War targets and spoils of war
  • Counterintelligence of critical infrastructure
  • Actors originating from non-acting sectors (eg. an inventor from strong academia or a political leader from local government structures)
  • Pretty wide modding opportunities

Development of some assets is driven by the population (eg. changes in the city size). Others need a direct investment of the government (eg. new seaport) which is handled by a mass negotiation mechanic: government members, including the player, propose upgrades, developments, rebuilding, and establishment. These propositions make it to a single list, where they are backed by the influence of proposing actors divided by the magnitude of expenses. In alignment with interests and other views, some actors may vouch for expanding housing whereas others may push for funding economic incentives. Top propositions inside the spending scope are then implemented.

[h2]Behind The Scenes[/h2]

► The sheet with asset types includes only somewhat tested and implemented ones. I'm experiment with a few other interesting types such as average kcal intake, riverine transport, or currency strength.

► Technically, national assets evolved from actors. For a long time, I struggled with representing anything close to an economic system based on the very limited number of actors (eg. two top companies in the country). What's worse, these actors didn't meaningfully act, taking the place of more interesting actors. That doesn't mean however that economic entities are completely inactive - they are now represented by more personal actors, such as business leaders, who have more logical & interesting actions, and even expand decision space (eg. business leaders may be subverted by affecting their economic assets).

► The system, in its simplicity, explores an interesting gamedev riddle. Where should we place the boundary between hardcoding and flexibility? The former is much faster to develop (at least in a complex strategy game) but it's not only a matter of making mechanics as flexible as time allows - as I've seen in a few iterations, mechanics can be too flexible, become bland, interchangeable, throw the player into the Euro-gaming pit of the same ten games with slightly different themes. At the moment, national assets are implemented by highly flexible code (modders can basically replace all data points, including all sectors) but for the purposes of interconnected gameplay, it slowly contracts into less flexible form (eg. requiring the transport sector to build transport graph). It's like a live experiment in approximating the most optimal position of hardcoded-flexible boundary.

► Some features were directly inspired by high-quality discussions on our discord server. Thanks, folks!

[h2]Final Remarks[/h2]

Naturally, all national assets can be targeted in intelligence operations such as infiltration, subversion, sabotage, or even cooperation (for instance with foreign underworld!). Moreover, they create a very palpable environment for all indirect actions, where for instance operatives land in a newly built airport, use a reconstructed seaport in a smuggling network, or utilize a denser road network to exfiltrate an agent by car. This will be the topic of the next dev diary - Operations 2.0 on December 9th.

If you're not already wishlisting Espiocracy, consider doing it:

https://store.steampowered.com/app/1670650/Espiocracy/

There is also a small community around Espiocracy:



---
"Germany's war potential should be reduced by elimination and removal of her war industries and the reduction and removal of heavy industrial plants. (...) The plants so to be removed were to be delivered as reparations to the Allies" - J.F. Byrnes, US Secretary of State, 1946