Victoria 3

Victoria 3

57 ratings
How to make a new state (without the in-game editor)
By Savs
This guide will go through the steps needed to make a new state and give it settlements, a name, resources, and more, all without using the in-game editor if you don't want to use it.
3
2
   
Award
Favorite
Favorited
Unfavorite
Introduction


This guide relies heavily on skills for map modding covered in Cynic's guide on mass moving provinces between states, so if you don't already have some way of doing that, you should check it out. I will cover it only very briefly.

Tools used in this guide:
  • Notepad++ and Sublime (you can use your favourite text editor, but more basic ones like Notepad won't cut it)
  • GIMP (you can use Photoshop, too, of course)
  • Victoria 3's in-game map editor
  • Experience, which you will need to build up over time

NOTE: Much of this is an alternative to the in-game map editor, so if you've tried that out and it's not your cup of tea, this is for you.
Step 1 - Location and Provinces
First, choose what state you want to split. Fundamentally you can think about this process as splitting your new state off from a single state, then transferring provinces from other states to the new one (if necessary). See Cynic's guide mentioned in the Intro for how to do that.

What follows is a brief summary walk-through.

To start with, you'll need to get the IDs of the provinces you want to put in the new state. This can be done by selecting them in the provinces map file. In the image below, I am using my own file where I've drawn the states as a layer, so it's easier to know what provinces to select.

I want to split Savonia off from the state of Southern Finland, and so it will have the above provinces (at least to start with). I've selected all of them, and I'll copy them into a new file and then change the image mode to indexed:

Now that they're indexed (as hex colour codes), we'll export them to a text file. Make sure that text file is somewhere easy for you to find.

I've done that and now when I open my file I see this:


These are the hex values of the provinces I selected. I need to make them usable, and so I've got some macros set up:

Definitely check out Cynic's guide for instructions if you know nothing about macros, and especially these. I will only vaguely describe my macros here, but I more or less got them directly from Cynic. They save time. I made most of the macros here and for this particular task I used my "Make province colours usable", which adds an x to the start of each ID, and some other stuff (again, see Cynic's guide). Now that I've made my IDs usable, it's time to start editing my mod's files. The following steps can be done in any order, just make sure you do them all.
Step 2 - Editing files
1) common/history/states/(relevant file)
Remove the provinces in your list from their original state like this:



Success! The 26 state IDs were found and removed.

1a) Create a new entry for the new state and copy the provinces from your list into it


2) map_data/state_regions/(relevant file)
Remove the provinces in your list from their original state like this:


You will need to deal with the quotes - so either add them to the list with a macro (this is what I do) or find some other way to quickly delete them.

Sidenote: I'm told that the quotes don't matter that much, but I find it easiest to keep the map_data province IDs in quotes and the others not. Feel free to experiment and see if this file actually needs quotes.

2b) Create a new entry for the new state and copy the provinces from your list into it, remembering the quotes. The highest ID for a state at the time of writing is 600, so you can choose something above that for your state's ID. I expect that lots of states will be added in the future, but not more than 200, so I've chosen 800 for my state. If you want to check the IDs for yourself, or make sure that there aren't any with the ID you've chosen, just search the files for id = 800


I copied the above state and just split it roughly. It will need balancing and refinement.


Also, the old state and the new still will need to have their settlement province IDs in this file modified, but I haven't found much use for this feature yet. It certainly doesn't have anything to do with affecting the placement of the settlements on the map (it's the other way around, in fact). More on this in the next section of the guide.

3) localization/english/(relevant file)

This state will be called STATE_SAVONIA in game until I tell the game how to write that in English, so in a localization file I'll put the following:


About localization files, they can have any name so long as four conditions are fulfilled:
  • The file name must end in _l_english (or whatever language you're using)
  • The file must be in the .yml format
  • The file must have UTF8-BOM format
  • The first line in the file must be l_english

Additionally, you will get errors if you're trying to change basegame localizations, so any of those you want to change must be in a folder called replace inside the localization folder.

4) history/buildings/(relevant file)

Add an entry for your state. It's probably easiest to split the buildings from the original state. That's what I did here. Also, obviously, if it isn't coastal it can't have fishing or ports.


5) history/pops/(relevant file)

Add an entry for your state. It's probably easiest to split the population from the original state. That's what I did here. The balance is quite rough and will need work.


5) common/strategic_regions/(relevant file)

Add your state into the relevant strategic region.

And with all of that done, the state works! But we're not totally finished yet!

Step 3 - Settlements
Now is the map editing part of the guide. My guide on moving settlements has more in-depth info for some of the skills needed here, so if you're confused about something here, head over there.

As you may know, every state has 4 or 5 settlements: city, farm, wood, port and mine. Obviously, non-coastal states don't have ports. These are the only settlements that can exist, and there can only be one of each per state. The settlements appear on the map when a relevant building has been built on the state.

As you may also know, settlements are composed of a locator, which is the visual graphic that makes the settlement visible, and an anchor hub (which I will call just a "hub"). These are what we will be dealing with here.

An important note about saving: Whenever you save, which you should do frequently, make sure all files which you have changed are saving to your mod. It's enough that you just use the path of your mod, which is probably something like C:\Users\your name\Documents\Paradox Interactive\Victoria 3\mod\your mod. If you accidentally overwrite the base game files, it's probably gonna be necessary to verify your game cache, which is annoying. And NEVER use "Save all". Trust me.

1 - Open the map editor

I do this by opening the console with the key above Tab (you may need to have debug mode enabled) and typing map_editor.


Then when it's gotten set up, turn on autorefresh and draw city spheres. These will allow you to manipulate the locators.


This is what the map looks like now. Mikkeli is no longer in the Southern Finland state, so it needs to be moved into it. In the below pictures I have the Spline Network Strip Tool selected - you can find it on the vertical bar at the left of the screen.



2 - Add the new state's hubs

Then I need to add hubs for Savonia. Choose the Spline Network Strip Tool (shortcut key: 9). When you choose it, the top bar will change a little bit: you'll see a menu called the Spline Strip Tool appear. The default tool is the one to move anchors (hubs) around. The second tool (called Create new anchors) is used to add hubs, and that's what you need here. Place up to 4 hubs (you can have fewer if you want, and a coastal state must have the extra port hub) somewhere within your state. Then you need to select each one with the first tool and set its ID on the right side of the screen. Since the state ID is 800, the hub IDs will be 80000, 80001, 80002 and 80004 (80003 would be a port). I'll just put them wherever for now:

NB - for ports you must place the 80003 hub and also one which will connect to the sea. That hub must be a Type 1 (the default is Type 0). To make these, select the Create new anchors tool and click on the Spline Type button to its right. From that menu choose either "naval_route" or "coastal_naval_route", then place the hub near your other port hub. The ID for this hub will be 80000 (that is, the state's ID + 00).

Important tangent:

Hubs have an ID associated to them, which when you select a hub you can see in the top right of the map editor. The ID is always of the format [State ID #][settlement type]. State IDs are perhaps most easily found in the map_data/state_regions folder. Settlement types are as follows:
00 - city
01 - farm
02 - mine
03 - port
04 - wood

Thus, the ID of the city for Lombardy (id 76) is 7600. The mine for Hedjaz (id 402) is 40202. The port for Guangdong (id 497) is 49703.

With ports you might notice that it in fact has TWO hubs! This second hub always has the ID [State ID#]00, and is different to the city because it's a Type 1 hub (which tells the game that it's a sea hub). Thus, although Guangdong's sea-facing hub's ID is 49700, because it's Type 1 instead of the normal Type 0, the game doesn't confuse it with the city in Guangdong (which is 49700 Type 0).

To create a type 1 hub, select one of the two naval splines (to set it as active) and then place the hub.

3 - Use the generated locators

Save as (I strongly recommend against ever using "Save all"), and exit. In the error log you'll see something like the following:

[19:35:54][game_object_locators.cpp:442]: map object locator "city" is incomplete. A new file with locator data has been generated ( C:/blahblah/Paradox Interactive/Victoria 3//generated/generated_map_object_locators_city.txt ). Copy that file (or its contents) to game/gfx/map_object_data to fix the error logs. [19:35:54][game_object_locators.cpp:442]: map object locator "farm" is incomplete. A new file with locator data has been generated ( C:/blahblah/Paradox Interactive/Victoria 3//generated/generated_map_object_locators_farm.txt ). Copy that file (or its contents) to game/gfx/map_object_data to fix the error logs. [19:35:54][game_object_locators.cpp:442]: map object locator "mine" is incomplete. A new file with locator data has been generated ( C:/blahblah/Paradox Interactive/Victoria 3//generated/generated_map_object_locators_mine.txt ). Copy that file (or its contents) to game/gfx/map_object_data to fix the error logs. [19:35:54][game_object_locators.cpp:442]: map object locator "wood" is incomplete. A new file with locator data has been generated ( C:/blahblah/Paradox Interactive/Victoria 3//generated/generated_map_object_locators_wood.txt ). Copy that file (or its contents) to game/gfx/map_object_data to fix the error logs.

Navigate to that path:


And copy those four files to yourmod/gfx/map/map_object_data. When you start up the map editor, your locators will now be on the map. Move them to be where you want them to be in the following way. Choose the Map Content Editor tool from the left - shortcut 7. Then remember the mantra Q-click-W-drag-Q-click: Press Q to choose the selection tool, click on the locator, press W to choose the manipulation tool, drag the locator to where you want it, press Q to go back to the selection tool, click away from the locator. These last two bits are important so you don't accidentally move the locator around, because it will stay selected unless you click away. I've moved my locators like so:



4 - Add new splines

It's a nice idea to add splines at this stage. Choose the Spline Network Strip Tool from the left and up top choose the fourth tool: Create a strip between two anchors. From the right you can choose what kind you want - a road, railroad, etc. Click and drag from one strip to another.


If you want to adjust where the road goes, choose the Spline Network Adjustment tool from the left and click and drag the individual parts of the strip. Don't forget to save frequently!

5 - Add localization for the hubs

As before with the state localization, add some for your new state's hubs.


As you can see, the format is HUB_NAME_STATE_(statename)_(hub_type): "Hub name".

With that all done, things look like this.


And we are all finished adding our new state!

At this stage it may be a good idea to go back to your map_data/state_region entry for the state and find what provinces you've put your settlements in in this section and write those IDs there.
Alternative method for defining the state
Some people aren't comfortable with using GIMP / Photoshop or else don't want to do it the way I've described, so you could instead do the following:

  • Create the state entry in map_data/state_regions without putting any states in (just leave provinces in your entry empty so it will only read provinces = { }
  • Open the map editor and select the Map Content Editor from the left vertical toolbar
  • Switch to the state focus (the province view is the default and not useful here) and find your new state from the list
  • Start using the map editor to remove provinces from states to add to your new one

If you choose to do it this way, remember to Apply Changes and save frequently!

As you might be able to tell from what's missing on the list, you'll still need to follow parts of this guide to get the state fully working.
TL;DR - Summary
  • Choose the provinces you want in your new state
  • Add an entry in map_data/state_regions
  • Add an entry in common/history/states
  • Add an entry in common/history/buildings
  • Add an entry in common/history/pops
  • Add it to a strategic region in common/strategic_regions
  • Give it localization
  • Place hubs in the map editor (remember the correct IDs!)
  • Get the auto-generated locators for your hubs into your files
  • Give the hubs localization
Closing remarks


I hope this was useful! Let me know if you have suggestions about (relevant) things to add to this guide!

If you are having some problems following this guide, join the Victoria 3 Modding Coop Discord server and ping me - Savs: https://discord.gg/UZkHqyq5vj
Make sure you provide plenty of information to make it easier to answer your question!

Check out my guide on how to mod in a new country:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2881355788

Happy modding!
24 Comments
Postboy1234 29 Jul @ 7:21am 
Quite helpful, thank you!
Savs  [author] 24 Nov, 2024 @ 6:43am 
Sadly, I don't know anything about how to create a new locator and whatnot. I was given to understand from my interactions with devs that such a thing is not possible, but that was some time ago so it might not be valid anymore.
Mia 22 Nov, 2024 @ 8:50pm 
I wasnt able to contact you any way but these comments, as a heads up.

Are the generated_map_object_locator files generated based on the ID given to the locators(00-04), or is there a way to define what kind of locator one is? If I manually create a new kind of locator it shows up in the map editor but I am unable to create locators of that new kind. If I manually create a locator in said new kind's file it shows as existing in the map editor but it seems to not exist on the map despite being "selectable".

Basically my goal is to make a separate map object locator kind in order to generate a standalone file outside of the existing 5 locator types that would still be usable as the 5 locators. Alternatively a way to merge locator files with the same kind would be great but it doesnt seem thats possible.
anonymous O-O 2 Nov, 2024 @ 1:03pm 
i figured it out soon after, its because i only had 1 province for all cities, i created more and it fixed it
Savs  [author] 2 Nov, 2024 @ 9:54am 
You might try to edit their coordinates manually in that case, but I haven't run into that problem before.
anonymous O-O 1 Nov, 2024 @ 5:49am 
hello, i have a problem again where i will generate the hubs but they will generate outside the map and when i manage to move them they will be under the map and there will be white lines coming from other cities to the generated hubs, is there a fix?
anonymous O-O 2 Aug, 2024 @ 5:13am 
Cheers
Savs  [author] 2 Aug, 2024 @ 3:57am 
The error log might give some hints about your success in modding things. In general, though, it's such a specific situation that it might be best to contact me on the Discord server noted at the end of the guide.
anonymous O-O 2 Aug, 2024 @ 1:12am 
hello, your guide is very good however, in my mod i have already generated the cities in two of my new states. however, when i am doing the third, i put the hubs in and click save as but the options are not preselected as they were whilst modding the first 2 states. so i select only the spline network and the map objects for every type of city. when i attempt this. these files dont appear in the generated folder, instead they appear in the gfx folder of Victoria 3, so i copy them into the mod folder (map_object_data) and when i re-load map editor, the cities arent changed. please help, am in pain.
Savs  [author] 29 Jun, 2024 @ 2:33am 
But the city graphics themselves are in the right place? Strange, unless something has recently changed, the localization key is attached to the hub.