Getting Started with Game Modding Europa Universalis 4 - Part One

Picture shows Jason A. Martin - Software Engineer, Indie Game Developer, Tech Evangelist, Entrepreneur.

Welcome to the first part of my series of tutorials on making game mods for Europa Universalis 4. In this series, I'm going to take you through the process of making a fairly simple mod, which will lay the foundation for more advanced mods. The goal is to cut through all the noise and extra data out there so you get a fairly right-to-the-point experience, which will get you game modding quickly.

I love, love, love Paradox Interactive games. And I love the company too. With their games, I usually pre-order them and all the DLC as it comes out. It's my way of supporting something I really enjoy.

Something else I enjoy is game modding (and slowly making my own games with Unity3D). But one of the hassles is often the outdated documentation or just lack of it.

While this series is focusing on Europa Universalis 4, the general ideas can be brought over to some of the other Paradox Interactive games, such as Crusader Kings 2 (another great game). In fact, I am going to do a mini series where I take what you learn here and show you how to modify it slightly for Crusader Kings 2, Hearts of Iron 4 and Stellaris.

Prep Work

Before we jump in, let's talk about what you need to make an EU4 game mod.

Editor: You will need some sort of text editor to create & modify files. You can use any simple editor (Notepad, Gedit, Sublime Text, etc). I am using Visual Studio Code, which is free (works on all OS). If you do use VSC, make sure you grab my Starter Bundle, which quickly gives you a great developing experience.

Europa Universalis 4: You'll need the base game. I'm not doing anything that requires DLC. If you don't have EU4 yet, it's often on sale for pretty cheap.

Some Understanding: I won't be explaining basics of logic or programming. I'm assuming you already have this or can figure it out. Modding for this game isn't programming heavy. You'll basically be doing some light scripting.

Also note that I'm writing this and playing off a Windows 10 system. EU4 works on Windows, Mac and Linux. Everything in this series will work on all of these systems. The only thing you'll need to do if you're on Mac or Linux machine is figure out where your game data resides. On Windows, it's in the /Documents folder by default.

REPO: Any code for this series will be in the EU4 Unicorn repo on GitHub in case you need it.

And with that, we're ready to begin.

Documentation

The offical starting point for EU4 modding is located in the EU4 wiki.

There are many, many pages in the wiki, but don't feel overwhelmed. As this series goes on, I'll link directly to anything that's relevant for the task.

Scaffolding

Locating EU4 Data

The first thing you need to do is go to your game folder for EU4. If you've never played the game, start it up now and click through until gameplay has actually started then exit. This will create the data you need.

On my machine, that path is: C:\Documents\Paradox Interactive\Europa Universalis IV

Once you navigate to this folder, create a new folder called "mod" if it isn't there already (final path example: \Documents\Paradox Interactive\Europa Universalis IV\mod).

Creating Mod Data File + Mod Folder Setup

Note: Since this mod is for us to learn, I'm keeping it basic for now. If you were going to distribute your mod, you'd package it up and add more information to the data file.

The first file we need to create is the data file that describes our mod. The file itself needs to end in the .mod file extension.

If you're using a file explorer to browse around, make sure you have set it up to view file extensions. If you're using VSC, you can just open up the EU4 data folder and proceed normally.

For our mod, we're going to create a file in the /mod directory named: unicorn.mod

In that file, put the following text and save:

name="Unicorn"
archive="mod/unicorn"

Next, we need to create a folder called unicorn in the mod directory (/mod/unicorn).

And finally, we need to make a couple folders inside the /unicorn folder: events and localisation.

Your final folder structure will look like this:

picture showing folder structure for EU4 game mod

If you're wondering why we just made these folders, navigate to your EU4 game folder itself. If you use Steam, it will be something like: SteamLibrary/steamapps/common/Europa Universalis IV/.

In that directory, you'll see events, localisation, gfx, and others.

To close out the first part of the series, let's make a blank event file.

In /mod/unicorn/events/ make the file unicorn.txt.


We're now ready to get into the meat of the mod.

In Getting Started with Game Modding Europa Universalis 4 - Part Two I'll go through creating the event file in detail. It's going to be fun!