Democracy 3: Unofficial Modding Guide

Before you read this, read the official introduction at the Positech Games website.


The following information was gathered from the official modding tutorials as well as other websites, but mostly from studying the internal files, located under path\to\Democracy 3\data\.

Table of Contents:

Software

Democracy 3 is a wonderful game, not only because of its interesting gameplay, but also because it's very moddable. I do a lot of SQF scripting for Arma, but in Democracy 3 you need to use CSV files, the same file format normally used to create spreadsheets.

First off, if you have Microsoft Office and Excel, you need to make sure you don't live in Europe. If you do live there, like me, you have to change a few things. Per default, European PCs use comma as the decimal mark and semicolon as the list delimiter. This is a problem, because North America and Democracy 3 work the other way around. To solve this, head into the Control Panel and open the Region and Language window. From the Format tab, press Additional Settings… and change your decimal mark to . and list delimiter to ,.

If you live in America, you should be good to go. If you don't have Excel, though, I recommend CSVed.

Creating a Mod

The location of a mod is path\to\Democracy 3\ModName\, but first, a path\to\Democracy 3\data\mods\ModName.txt file must be created with the following text:

[config]
name = ModName  
path = "ModName"  
guiname = "In-game Mod Name"  
author = "Name"  
description = "Description."  

It's all pretty self-explanatory, but one needs to make sure that path matches the name of the mod's folder in the root directory of the game.

Policies

Policies are located in the ModName\data\simulation\policies.csv file and look like this:

#,PublicMedia,Public Media,publicmedia,,,16,22,7,7,PUBLICSERVICES,138,5524,,1,0,0,,#Effects,"Capitalist,0.1-(0.35*x),4",,,,,,

That is the source code of a CSV file. The commas are separators. In Excel, it will look like this:

What does it do? First, every row that starts with a cell that contains a single hash (#) will be interpreted by Democracy 3. As for the rest of the cells:

  1. # (leave out the hash to make row a comment)
  2. Internal name of policy
  3. Display name
  4. Internal name of slider, or default
  5. In-game description
  6. Flags (UNCANCELLABLE or MULTIPLYINCOME)
  7. Introduction cost
  8. Cancellation cost
  9. Raising cost
  10. Lowering cost
  11. Department (FOREIGNPOLICY, WELFARE, ECONOMY, TAX, PUBLICSERVICES, LAWANDORDER, or TRANSPORT)
  12. Minimum cost
  13. Maximum cost
  14. Cost multiplier (formatted as effects), read the official description
  15. Implementation delay
  16. Minimum income
  17. Maximum income
  18. Income multiplier (formatted as effects), read the official description
  19. #Effects
  20. Effects (following #Effects, one per cell) — see Effects

Effects

Effects are used all over Democracy 3, including policies, and formatted as follows:

[target],[value1][operator1]([value2][operator2][values3])[operator3][value4],[inertia]

The target can be either the influencer or the influencee. In the case of a policy, it's the influencee.

For example, Capitalist,0.1-(0.35*x),4 means that the policy will increase Capitalist (the happiness of capitalists) during 4 turns (inertia) until reaching a 0.1-(0.35*x) percent increase, where x is our policy's current value.

Allowed operators are *, /, +, -, and ^. Unfortunately, you are limited to the above structure, which means you're limited in what effects your policy can actually have. I recommend using the Desmos graphing calculator in combination with Wolfram Alpha to test your functions.

Furthermore, another limitation is that you cannot use x as [value1] (this is most probably a bug).

Sliders

A slider complements a policy. In policies.csv, it can be left to default, or refer to a slider defined in ModName\data\simulation\sliders.csv:

Remember our PublicMedia policy from earlier? In that policy, we referred to this publicmedia slider. Let's go through the different cells:

  1. #
  2. Internal name of slider
  3. Type (DISCRETE (options with labels) or PERCENTAGE)
  4. Number of options, or 0 (if zero, the user is allowed to pick values between the set points)
  5. Option labels (one per cell) or maximum percentage

In this case, the option NEWSPAPER will represent the value 0.333... (1 * 1.0/3, because there are three options), NEWS CHANNEL the value 0.666... (2 * 1.0/3), and TELEVISION NETWORK the value 1.0 (3 * 1.0/3).

So, if the user cranks public media (that is, drags the slider to TELEVISION NETWORK), capitalist happiness will eventually, after four turns, increase by 0.1-(0.35*1.0) = -0.25 (that is, a 25% decrease).

Icons

Like effects, icons are used for various things. A mod's icons must be located in ModName\data\bitmaps\ and have the .dss file extension.

Personally, I recommend editing the default icons (found in path\to\Democracy 3\data\bitmaps\) with the excellent GIMP editor, an open-source equivalent to Photoshop (and better in many respects). GIMP supports .dds natively.

To assign an icon to a policy, name it icon_policyname.dds.

Simulations

Simulations can have a variety of purposes, but in the graphical user interface, they show up as the blue icons with values that change over time — for example, Health, Education, Crime, and Environment — all are persistent. Some are even hidden, like Terrorism, Poor Earnings, Middle Earnings, and High Earnings. When you're creating a mod, simulations are put in the ModName\data\simulation\simulations.csv file.

Above is the entry for the built-in Technology simulation. Let's go through the cells:

  1. #
  2. Internal name of simulation
  3. Display name
  4. In-game description
  5. Department (FOREIGNPOLICY, WELFARE, ECONOMY, TAX, PUBLICSERVICES, LAWANDORDER, TRANSPORT, or HIDDEN)
  6. Default value
  7. Minimum value
  8. Maximum value
  9. Emotion (HIGHGOOD, HIGHBAD, or UNKNOWN)
  10. Icon (see Icons)
  11. #
  12. Causes (following #, one per cell) — formatted as effects
  13. #
  14. Effects (following #, one per cell) — formatted as effects

Alternative Uses

To create a hidden simulation, set its department (cell 5) to HIDDEN. The Disaster and Emergency Situations Pack by modder Elinor has a hidden simulation called GaussianDistibDESP that simulates normal distribution, which affects the simulation Known Terroristy Activity. (It isn't true normal distribution, and they factor in intelligence service.)

Situations

Situations are very similar to simulations but only have effects within a specific value range. For example, the Pollution situation is only activated when its value reaches 0.6 and deactivated when its value shrinks to 0.4. That is, more effort is required to deactivate a situation than to activate it.

The cells of a row have the following functions:

  1. #
  2. Internal name
  3. Display name
  4. In-game description
  5. Department (FOREIGNPOLICY, WELFARE, ECONOMY, TAX, PUBLICSERVICES, LAWANDORDER, or TRANSPORT)
  6. Icon (see Icons)
  7. Activation text
  8. Deactivation text
  9. Emotion (1, good, or 0, bad)
  10. Activation value
  11. Deactivation value
  12. Cost per turn (while activated)
  13. Income per turn (while activated)
  14. Causes (one per cell) — formatted as effects
  15. #
  16. Effects (following #, one per cell) — formatted as effects

Mod Submission

Mods can be distributed personally or through the Steam Workshop. A mod can be submitted in-game via ModsCreate Mod. To update an existing mod, use the Update Mod menu instead.

The mod's image on Steam Workshop must be located in the root Democracy 3 directory and be in the .jpg format.


This article is a work in progress. There's more to come.



John Ankarström

About John Ankarström

I'm interested in historical linguistics, technology, history, science, gaming, and a whole lot more. http://johnaj.tumblr.com/ →

comments powered by Disqus