• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Showing developer posts only. Show all posts in this thread.

Carlberg

Lead Environment Artist - CKIII
Paradox Staff
40 Badges
Oct 17, 2014
221
2.287
  • Crusader Kings II
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - After Dark
  • Paradox Order
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Magicka
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Cities in Motion 2
  • Dungeonland
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Europa Universalis IV: Art of War
  • Shadowrun: Dragonfall
  • Magicka 2: Ice, Death and Fury
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris Sign-up
  • Shadowrun Returns
  • Magicka 2
  • Shadowrun: Hong Kong
  • Prison Architect
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • War of the Roses
  • The Showdown Effect
  • Europa Universalis IV
Hello! Art Lead reporting in with some quick answers to the new Map Editor. We're looking into creating some more comprehensive guides in the future, but for starters I'm here to start off with a few instructions on how to start using the map editor for those of you starting out with map mods.

Known Issues
- Files in the common/defines folder cannot be modded right now, as they're overwritten by the game. (We're looking into enabling this in a future patch.)

Editor Basics

Starting the Map Editor
If in-game you can write the console command
Code:
map_editor

However we recommend starting the game straight into the editor, since this leads to less issues as less unused game components are loaded.
  • If running via Steam, start the game with -mapeditor as launch option.
  • Otherwise, create a shortcut to the .exe with -mapeditor added in the target. Rename the shortcut to Mapeditor for ease of use.

Editing map data outside the editor

  • \game\map_data contains most data maps, like heightmap.bmp.
    • heightmap.bmp - The file that is used by the editor, black and white height data
    • heightmap.heightmap - Data file for heightmap
    • indirection_heightmap.bmp - Optimized file created by the editor on export, do not edit this manually.
    • packed_heightmap.bmp - Same as indirection file above.
  • Note that the map can act weird at first when creating a new one from scratch. Put in your own heightmap in heightmap.bmp, then do an export, restart the editor, that should create a new set of files and align everything.
  • \game\gfx\map contains most texture and detail maps related to the map.
    • There are a lot of mask files that are used to tell textures and props where they are to exist. These files must have the same dimensions as the heightmap
    • If you're starting out from scratch I recommend you mod your masks to be entirely black, thus not giving any data to your blank map.

Clearing the height map data for a clean start
  1. Open game/map_data/heightmap.bmp
  2. Fill the bmp with a block of #292929 grey if you want it flat just above water level, #000000 if you want everything at the bottom of the ocean as a base.
  3. Start game with launch option -mapeditor, as the previous change might be too volatile to do from the games console.
  4. Things are probably looking really weird, go toheightmap resolution (shortcut 4) and then press the repack button on the top-bar. Choose your desired resolution tile size (33x33 is the standard)
  5. Done! Remember to press ctrl+s to save this blank state. Then press the export button to make it create the optimized files used by the game. (indirection and packed heightmap, game never uses the heightmap.bmp alone)
  6. As you work and give the world more geometry, or replace it with an external heightmap, remember to repack again to keep each square optimized for its amount of details.
You could load a pre-made heightmap right away, but it'll look chaotic until you do a repack.

How to change the location, width etc. of rivers.
A couple of rules about rivers.bmp:
  • White represents land, pink represents the ocean. Mostly a guide to allow ease of identifying coastlines and dont affect rivers themselves.
  • Rivers uses a gradient of blue and green colors to denote the width of the river. Green colors are wider, blue are thinner, brighter variants are wider, darker thinner out of those.
  • Use the only the width colors already in the river file.
  • Rivers start at a green dot (0, 255, 0)
  • Rivers connects to other rivers as a tributary at a red dot (255, 0, 0)
  • River can diverge at a yellow dot (255, 252, 0)
  • Diverged rivers cannot rejoin with red dot, this causes errors.
  • In a river system only the main unbroken river should have a green starting dot.
  • Every pixel in a river needs to connect to another to form an unbroken line.
  • No pixel can have more than 2 connecting pixels. Except when a river connects or diverges. Doing so will cause an error or crash.

Saving your map
There are two save commands in the editor, found in the top right.
The regular save button saves the editor changes to the data files and mesh object locations.
The export button pushes the changes to the more compressed data files that the game uses. A successful export means that this button will turn white and disable until new changes are made.

Sometimes a regular save will trigger an export too, we are maybe looking at merging the two into one in the future. If you cant export, try making a minor change in the world and try again.

Turning off the editor
There is no exit button, you're here forever!

Just kidding, on a serious note though we dont have an exit button, just press Alt+F4. But don't worry though, if you have unsaved changes it will tell you and give you an opportunity to save before losing the changes.

Edit: There is an exit button now.


Adding new content

I want to add my own texture materials
New terrain textures can be added in \game\gfx\map\terrain
We're using the Metalness-Roughness PBR workflow.
  • You will need 3 .DDS textures, a diffuse texture, a normal texture, a properties texture and a mask that you add to the above mentioned folder.
  • Material.settings is the file where you add new terrain layers with script, link in your new textures here.
  • Settings.terrain controls data for how all materials act globally, like how they blend, tile and such.
  • The mask.bmp file needs to be the same size as the heightmap.bmp
The texture files have some texture channels switched around, channels refering to Red, Green, Blue, Alpha.

Texture -> Data

Diffuse RGB - RGB
Diffuse A - Material heightmap, used for blending.

Normal R -> Normal R
Normal G -> Normal R
Normal B -> Emissive (fill black, unless you like self illumination)
Normal A -> Normal G

Properties R -> Unused
Properties G -> Specular intensity - Used sparingly on metallic surfaces.
Properties B -> Metalness
Properties A -> Roughness


Note! - After adding a new texture you will need to re-export the map for the optimized detail maps to be updated. Otherwise the games textures will offset and you'll get snow instead of grass or the like.


I want to change the dimensions of the map to another shape


Even though this doesnt work without changing the game defines manually, here's how to try it out:

00_defines.txt

Code:
NJominiMap = {
#Dimensions needs to be the chosen resolution, -1 unit
    WORLD_EXTENTS_X = 8191
    WORLD_EXTENTS_Y = 25.5
    WORLD_EXTENTS_Z = 4095
    WATERLEVEL = 3.9
}

00_graphics.txt

Code:
#The following data points control the extent of the surround map/clouds
    SURROUND_MAP_INNER_RECT = { 700.0 900.0 7700.0 3600.0 }             #x-start, y-start, x-end, y-end
    SURROUND_MAP_OUTER_RECT = { -10000.0 -10000.0 20000.0 20000.0 }        #x-start, y-start, x-end, y-end

I want to change the clouds surrounding the map
Open \game\gfx\map\surround_map
There will be a file there called surround_mask.dds
It controls the extent of the surround cloud and is rendered within a square, but has a central exclusion zone so it's not rendering for the whole center area at all times. Below there is a picture explaining the outer and inner squares.

Adjusting the size of these squares were handled in the post above on how to change the map dimensions.

index.php

I'll add more instructions here over time, but this should be the basics to map creation.

Also, if you have any specific actions you'd like more explanation on, quality of life improvements or feature suggestions, feel free to share those too. The Map editor will be evolving along with Imperator.
 
Last edited:
  • 3Like
  • 2
Reactions:
I'm thinking about editing the political map mode to be more EU4 alike. What I want to do is that the strategic map feels like a true map, I'm trying to replicate the same map and textures when it's zoom out to when it's zoomed in. Also altering the ocean texture to be more flat, again, in a similar way that appears when zoomed out and the mountain textures to be more Lord of the Rings(representing drawings).
Could I receive any guidance?
I'm just starting with modding paradox games so I appologise for being a bit boring with this questions.
Hmm, well I would need to make sure that I'm understanding everything correctly.
We usually refer to the zoomed out map as the strategic map or the 'flatmap' (named so in \game\gfx\map\textures) and it takes over when you zoom far out enough.
Are you referring to changing this texture into another? Or to keep the visual of the world even when you've zoomed out further?
 
I'm thinking about adding the 'flatmap' texture when you also zoomed in (to the point where you can see the armies).
What I pretty much want to do is to simplify the map texture to be a bit less demanding when you're zoomed in.
In this link :
https://forum.paradoxplaza.com/forum/index.php?threads/perfomance-map-mode.1170592/
there's a post with a screenshot, for example you can notice that the ocean texture is not so detailed (when zoomed out) as it is when it's zoomed in with all the animation etc...
That's what I wish to make a better representation of a physical map when it's zoomed in
We'll continue this specific discussion in your thread :)
 
Does this mean that the 00_defines.txt isn't read at all in mods? Testing to mod the START_DATE, fails (bug report).


Is it possible to not have any outer rectangle? For example if one want to create a round earth map, i.e where x-start is adjacent to x-end (like in eu4, vic2..), one would not like a surrounding rectangle.
Indeed, 00_defines.txt isn't read at all right now, we've got a ticket at fixing that, but currently our tech people are hard at work on release support. The surround map is also handled inside a define file, but i dont think you cannot leave the inner rectangle out. Currently we cannot have a world that connects east and west at the date-line, as that's a functionality we're currently missing in the Jomini part of clausewitz. Sadly not something we can flick on with a switch right now, but might come in the future (no promises on my end since it's another dept. working on things like that).

To just give a quick visualization to show how the cloud rectangles and mask works right now
upload_2019-4-26_17-23-52.png
 
Only issue now is that it saves over the original game files rather than files in the mod. In this example I had black masks for all terrain textures in my mod folder. In the editor I painted the entire map with European Mountains texture. Once I saved, exported and quit, all the mask files in my mod folder were unchanged (including the mountain one), yet all the masks in my vanilla game folder were now black except the mountain one being completely white.

My next question is how do I force the editor to save over the mod rather than vanilla files?


EDIT 2:
One more problem to add to the list. After the vanilla game got all the changes to the map files that I wanted, I coped them to my mod and redownloaded the game to get it back to vanilla. When I try playing my mod the world shape is there but all of the vanilla texture masks are active. If I go into the editor though, it uses the modded files and the texture masks are how they should be.

So last question for now, is how do I get the actual game to read the modded texture masks and not just the editor?

1. We're currently testing a way for the editor to export to the mod folders instead of the base game. It will probably come with a patch in the future once our tools programmers have finished it. For now the workaround is moving the created data from the game to the mod.
2. Did you also move the detail_index and detail_intensity to the mod folder?

so, what the map projection of IR map? It is obviously a conic map projection, while I wish to know more about it so I can make a good addition on this map....
The base is a mercator projected heightmap from Nasa, but it's been stretched and curved on it's eastern half to make Arabia, Persia and India less squished. Thusly, india points a but more eastward on the actual heightmap.
 
Wait!!!!! soooo, IR doesnt have used a conic map projection like Lambert or Albers or an Equidistant ones, but just curves the Mercator ones....
I am going to mad, to be honest.

So, whether there could be any parameters about IR map that can be shown to us?

Wait ,if whether the height map is found from there? https://visibleearth.nasa.gov/view.php?id=73934.
This is not a map of mercartor map projection.

If that's not mercator i'm calling it the wrong thing, my bad :)
But yeah, that's the height data from Nasa that we've been working with.

And @Talvos , @shadowofneptune , that looks like the right data to change, do note however that they are Defines files, which means they currently cant be changed by mods.
It's possible to force test it by editing the game files, but like mentioned earlier we need to enable defines modding before regular mods can do it. (I am prodding coders about this whenever I have the chance).
 
@Carlberg

We're still tinkering with terrain in the LOTR mod, but we have a crash on trying to load the map_editor. I was just wondering if you'd ever seen this in the crash log?

Unhandled Exception C0000005 (EXCEPTION_ACCESS_VIOLATION) at address 0x00007FF7B9F4EA29

Stack Trace:
1 imperator.exe CFortMapObject::UpdateSiegeEntity (fort_map_object.cpp: 124)
2 imperator.exe CProvinceMapObjects::UpdateFortInProvince (province_map_objects.cpp: 198)
3 imperator.exe CProvinceMapObjects::Update (province_map_objects.cpp: 96)

I tried removing both the forts from the locations file and the setup.txt file, but that wasn't it - if you haven't seen this issue before, no worries, we'll probably figure it out eventually via good old trial & error, but I'm just hoping that you might have encountered this issue yoursel at some point and remember the solution.

I'm afraid that's a new one to me, sounds like something isnt right under the hood, codewise. Might be that some fort data is trying to (re)generate but failing to.
 
Haha thanks, I'm not planning on doing anything more, I'm just an artist who happens to love LOTR so I tend to test things out when modding by making quick LOTR locations :p Perhaps if a LOTR mod is started I'll help out with art though.

On the topic of art, what's your workflow with spec maps. I'm used to either old school diff/spec/norm or PBR with base color/metal/rough but not sure where the spec fits in for PBR. I heard in the 24 hours livestream that you use substance painter. At the moment I have painter set up to export according to how you do your maps and it works well but for spec I wasn't sure if you use 'specular', 'specular level' or something entirely different? Or do you just do it manually? I noticed that even with roughness down quite a bit, there's not much shine, but it could be because my specular map is almost blank.

There isnt a 100% conversion between substance painter and the game, generally though the roughness and metalness should be the same. I.e. Metal should either be very strong or off entirely if the material is metallic. Specular is holding a bit of a complicated position, we generally give a material 50% grey tops if it's an object with more fresnel and reflectivity to it. But it's very strong.

My recommendation is to start the game and spawn the material test object in a flat ocean somewhere, it's good for getting a hang of material values and how they affect the shading.
Writing the following in console will spawn it at the mouse cursor:
Code:
spawnentity shader_test_all_test_objects

upload_2019-4-27_23-23-53.png
 
Could anyone tell me how I make rivers work on a custom map? I tried changing the rivers.bmp file but it wouldn't start the game anymore when I did. Am I missing something?

Examine the rivers, and the error log under documents/paradoxinteractive/imperator.

A couple of rules about rivers.bmp:
  • White represents land, pink represents the ocean. Mostly a guide to allow ease of identifying coastlines and dont affect rivers themselves.
  • Rivers uses a gradient of blue and green colors to denote the width of the river. Green colors are wider, blue are thinner, brighter variants are wider, darker thinner out of those.
  • Use the only the width colors already in the river file.
  • Rivers start at a green dot (0, 255, 0)
  • Rivers connects to other rivers as a tributary at a red dot (255, 0, 0)
  • River can diverge at a yellow dot (255, 252, 0)
  • Diverged rivers cannot rejoin with red dot, this causes errors.
  • In a river system only the main unbroken river should have a green starting dot.
  • Every pixel in a river needs to connect to another to form an unbroken line.
  • No pixel can have more than 2 connecting pixels. Except when a river connects or diverges. Doing so will cause an error or crash.
Adding to original post
 
Is there any chance this will change? While the map maker(s?) did their best, it still looks quite ugly in the areas that contain big river islands like the Low Countries and the Middle/Lower Danube.

Not in the foreseeable future, we'd need to do some major changes to the river system (which also comes with the risk of breaking things). It's something we want to improve upon, but for now the system will work as it does.
 
Theoretically, could you use this to make a more informed map and drag it into other pdx games? (if it exports the same base heightmap.bmp and rivers.bmp ?)
And vice versa? Could you upload an existing custom map with all the files onto this?

Short Answer: Theoretically yes

The way texture masks work may differ, but for the heightmap.bmp you certainly should be able to. Map polygon resolution may differ though.

Will you add city making into map editor. It gets tedious trying to line up cities with the shore or certain terrain types

It should be handled by the game itself, uncolonized provinces you need to rightclick to show all locators in map object mode.

If you changed the province layout you need to reset those instances.
  • Go to game/gfx/map/mapobjects/city_locators.txt and remove the relevant instances from the document. Leave any code not related to the instances be.
  • On next start the game will generate new ones in the provinces that are missing city instances.
  • Go to documents/paradoxinteractive/imperator/generated
  • In that folder there should be a new file containing the new regenerated data, with cities in the center of their provinces.
 
Oops. I meant provinces and editing province.bmp. I used the term city cause that's what they're called in IR.
Ah, mixed them together myself there, yes sadly we dont have that functionality yet. But rest assured as someone whos using the tool for work, i want it and am pushing for it too.
 
Last edited:
What ever happened to the Nudge tool in HoI IV that made province and state creation much easier?
The nudge tool wasnt directly portable to jomini, but I believe we have been working on another tool that can be used for setting province data akin to tradegoods, cultures, religion and so on. you can reach it by inputing:
Code:
setup_editor
You may need to be in -develop mode for it to initialize.
 
I've been trying to create a mod to change some camera settings, like edge scrolling and FOV. I found "00_graphics.txt" in common\defines\graphic, and I've tried changing several variables under NCamera, but nothing seems to work. If I edit 00_graphics.txt in the game files, everything works as I would expect. What am I doing wrong? Mod mod looks like this:
NCamera = {
EDGE_SCROLLING_PIXELS = 0
}
It's in (modname)\defines\graphic\(modname).txt
Why does it do nothing
Defines are currently un-moddable, due to being loaded after the mods, they overwrite your changes.

We're working on a future fix for this, it'll be coming in 1.1 Pompey most probably.
 
I've only dabbled with small personal mods before, and never map modded before. How technical is it to simply add Scandinavia to the game, and put some tribes up there? Is it a ton of work, or is it fairly simple?
It'd be out of bounds for the base texture, if you aim to still keep the rest of the map it'd be hard.
You could increase the height but then you'd need to:

a. Wait for us to fix the defines so you can increase the size of the map.
b. Go over the size we support (we're not going to support going over 8x4k maps, it's at your own risk)
c. Probably need to re-adjust every single map object in the world since the coordinates would be a bit off.

It wouldn't be impossible, just a lot more work than one could expect at a glance. Adding the actual tribes would probably be the speediest bit.
 
Hey, been trying to make a clear slate for a map including the provinces, countries etc and getting stuck at loading on MapPostRead. Can't find any information on what MapPostRead is and no error message gets produced (doesn't crash just stuck). Just loading the map with new heightmap, province.bmp is fine. It's when i replace all the other files, definitions, province_names, setup etc that i get stuck on loading. Been trying to find a fix for a while now.

I guess it helps if I list all the files I've swapped in case I've just forgot one:
adjacencies, areas, climate, default.map, definition, heightmap, heightmap.heightmap, indirection_heightmap, packed_heightmap, ports, provinces.bmp, regions, rivers.bmp, terrain.bmp, (localization) province_names_l_english, (common) character_setup, post_character_setup, province_setup, setup, (province_terrain) 00_province_terrain, in province_names folder i added all the groups but emptied them except for roman which I kept province 1, rome.

For most of the files I've just cleared them out of the old data but kept some stuff where it made sense, for example "countries = { } ".

Thanks for the help!

Edit: Changed the map objects tied to provinces in gfx/map aswell, still MapPostRead though.
That sounds odd, not entirely sure what might be causing that. I'd suggest troubleshooting the individual changes, removing the ones that arent dependent on eachother and eliminating what might be causing it. Any of those files that are within the common/defines are however currently not working for mods, as they're being overwritten. We're working on a fix for that in the future.
 
I've edited the surround mask but it appears cutoff ingame/editor. Any ideas as to why?View attachment 477486
Added instructions about this to the bottom of the original post. Essentially there's a square in the center of the map which prevents the cloud rendering, since it was only meant to be at the edges this exclusion zone means it doesnt have to render at all times across the map.

Changing this requires a change to the graphic defines, which currently isn't possible since it will be overwritten by the game, we're working on a fix for this. For testing purposes until fixed though, it's possible to force it by editing the game files.

What file defines the texture of the paper map for the farthest zoom distances?
When I edit gfx/map/textures/flatmap.dds at the transition point to the paper map the edits start off partly faded out and original map will fade in as I continue to zoom out.
That sounds quite odd, did you save a new .dds file of the same format? Did you make sure it created a new mip-map set?