HOW-TO: Generate minimaps

image-20240429-110515.png

Minimaps are made out of tile images with each image being a screenshot which represents a tile of the world from a bird's-eye view.

The whole process of making very detailed and accurate minimaps can be challenging. There is a lot of external adjustments you need to do with the raw generated images.

Minimaps are generally divided into:

  • exteriors (water, roads, terrain, forest)

  • interiors (buildings, caves).

Below you can find out how to work with both.


Minimap for exteriors

89cdc935-9b99-4372-8b1a-c45410b3e592.png
Exterior minimap.

Here’s how a minimap for exteriors would have been created usually:

  1. Take screenshots with specific rendering settings of the world map in the Editor, with everything streamed in for the given area and split out various layers of data (colour, normals, water mask, roads mask, buildings mask, etc.).

  2. Take these images and merge into big images of the entire world for each layer.

  3. Pass them through Photoshop saved actions batch that processes all layers and merges them into single final image, adding clouds.

  4. Split the final image into original chunks (size).

  5. Remove the chunks that were not used by game (the actual terrain is way bigger than the UI map that can be observed in the game).

  6. Generate lower LOD for each chunk (downscale).

  7. Save in the final destination in the W3 content folder.

So if you are someone who is familiar with using Photoshop, you could do some post edits as you see fit. If you are not, that’s also not a problem, we will only talk about the most necessary steps to add something visible on the minimaps and skip the fancy stuff for now.

You can find all the minimaps already generated for vanilla maps located in …\depot\gameplay\gui_new\minimaps\

Each folder is named after a world. In each folder you’ll see all the tile images that are used up for making a two dimensional grid using an X and Y coordinate.

Each image follows a naming convention as follows: <tile_name_prefix><X_coordinate>x<Y_coordinate>.<image_format> (e.g. tile12x13.jpg).


Search the code

If you want to learn more about the code side of where these tiles are taken from, you can check the actionscripts stored in the depot.

Navigate to \depot\gameplay\gui_new\actionscript\red\game\witcher3\hud\modules\minimap2\ and open the actionscript file called HubMapContainer.as.

There’s is a function called GetTileFilename at line 236. Here you can see how tiles are accessed.

return "img://minimaps/" + HudModuleMinimap2.m_worldName + "/tile" + tileX + "x" + tileY + "." + HudModuleMinimap2.m_tileExteriorTextureExtension;

Looking at the m_tileExteriorTextureExtension variable at the end can help us to see what is the format that the script accepts, so by searching for it’s definition we can see that it’s located in gui_new\actionscript\red\game\witcher3\hud\modules\HudModuleMinimap2.as at line 65.


Minimap for interiors

In the original making of interiors there was a separate level with all the buildings spawned in a grid and each building had a navmesh inside where each navmesh was covering a single floor in various sizes (depending on the building/interior). After that, a camera was capturing screenshots of these navemeshes for each floor.

So the Editor generates those navmesh-mask screenshots to represent the interiors maps of the buildings.

In the game once the player gets inside of a building, the minimap detects that the context changes from exterior maps to interior and the navmesh-mask would be soon visible dedicated to that building/cave.

As for caves, these were generated in world, similar to buildings, but the navmesh was taken directly from the world.

The runtime difference: buildings were rotating the minimap for their interior based on their transform (as we could have the same buildings copied around)
where on the other hand, caves having the minimap as it was generated, aligned to world axes.


Creating exterior minimaps

Before we start: since the minimap creates images based on the current state of the world, make sure you load every layer that is important to be seen on the map.

Now if we have a custom world created, populated with all of the content and ready for us to generate minimap for, we can use the tool called Minimap Generator.

You can find it in the main toolbar’s Tools menu.

Below you can see how the tool looks.

The first thing that we need is to set the output directory path, where the tool will generate the tile images to.

We advise against using \…\depot\gameplay\gui_new\minimaps\ as your output folder as you may have to do some edits before we can use the tiles. The generation will create its own directory structure for the images based on various filters that you set, placing them in folders where the Editor won’t be able to find them.

 

Next, you can choose how do you want to select the required tiles for the map. But now let’s just use all of them:

In the image options, you can select the file name prefix that all of the images will be saved as followed by the coordinates. Also you need to set the Base Image size. If you’re not sure about what value to use for the Base Image size, you can take a look in the Terrain Edit Tools what LOD config has been used to generate the world:

In the Exteriors tab, set the following options. If you want to edit the tiles later on with Photoshop then you can choose the For Photoshop option to create a more useable directory layout for it. Otherwise choose Default.

Finally, we can select the masks where we tell the generator what are the different layers that we want to generate tiles for. The tiles after that will be generated in different folders where each folder is dedicated for a mask we choose here.

So let’s select the components we want to present on our minimap:

Click on the Generate exteriors button to begin the minimap generation and wait for it to finish, this may take some time depending on the number of tiles you have selected:

After it has finished generating, in the output folder you can see the following structure based on the Directories layout that you have specified earlier. If you chose the “Photoshop” option, then every tile will have a dedicated folder for each mask:

Here’s what you can find in the tile0x 0 folder:

If you went with the “Default” option, then each mask will have a dedicated folder generated, and inside all of the tiles in a two dimensional naming convention:

Now create new DLC data for the project. In the Asset Browser locate the …\depot\dlc\ folder and create a new directory with a name representing your project.

In this directory create the same folder structure as the one in \depot\gameplay\…\minimaps\ (your dlc > data > gameplay > gui_new > minimaps).

In the minimaps folder create a sub-folder only dedicated for our custom world. Name it the same as the directory name.

Now in the file explorer, you need to copy and paste all the generated minimap tiles from the Full folder into the dlc\<your_dlc_name>\data\gameplay\gui_new\minimaps\<your_world_name>\ folder.

Next, create a DLC definition file in \depot\dlc\<your_dlc_name>\ and give it a name.

Open the new file. You need to set some properties so that the Editor can treat it as a valid DLC.

First let’s give an id value for the DLC. It can be anything but we tend to use this format <dlc_name>_000_000

Now let’s add some mounters. First add a CR4WorldDLCMounter (use the Class selector search bar at the bottom) to the mounters array:

And add the reference to the custom world in the worlds array:

In CR4WorldDescriptionDLC properties for the file we need to go on the route of defining a custom enum and definition for our world file.

Head over to the main Editor window, and open Tools > Script Studio.

In the Script Studio expand the Depot group on the left. Locate the areaTypes.ws script file in \Depot\game\.

Make sure to select the areaTypes file, right click on it and select Check Out.

All your checked out scripts will be located in your Workspace, and these are all separated into the Workspace group.

Expand the workspace group. Again locate the areaTypes.ws file and open it.

At the top, add a new ENUM value to the enum EAreaName that will be used for your world. This way we can reference it in many tools like the DLC definition editor.

After you’re done editing the enum, make sure that you save the file ( ) and press the Reload scripts button.


Now go back to our DLC Definition editor and set the worldEnumAreaName with our newly defined enum from the script.

Also there, set the worldName and worldMapPath:

Make sure the name of the world matches the values you enter here. Also make sure that the folder name of the world inside dlc\<dlc_name>\data\gameplay\gui_new\minimaps\ also matches.

Now create the main strings which will represent and name our world inside the game.

To do this, open the Localized Strings Editor in the main window’s Tools toolbar menu:

Here create two strings for the name and description for our world. Press the plus sign on the top left to add a new row to the list:

Enter these values (mariska is the name we are using, yours can of course be different):

  • Key: map_location_mariska

  • Category: Maps

  • Value: My custom world map

Create another row and put in the following values:

  • Key: map_description_mariska

  • Category: Maps

  • Value: My custom world description

Save your work. You can close the Localised Strings Editor

Now use the keys of the newly saved strings in our DLC definition’s worldMapLocationNameStringKey and worldMapLocationDescriptionStringKey fields:

Now set the following parameters according the configurations and dimensions that your world is defined. In this example the worldMinimapTileCount is 256, since in my Full output folder I have 256 tile images generated.

 

Not sure which parameters to use? You can test out parameters defined in other DLC definitions - like that ones located in:

  • dlc\bob\activation_bob.reddlc

Another mounter that you need to add is a Scaleform content definition. This is where you add the reference to our dlc minimap which the Editor can use while using our custom world.

For the scaleformDirectoryPath give the path to the minimaps folder that’s located in our newly made dlc structure:

Now go ahead and close the DLC definition editor and make sure you click on “YES” and save it after closing!

Now the minimap should be visible once you start playing inside the custom world.

Once you have your world loaded, press the joystick button to Play on current layers only, to test out the minimap in gameplay.

Now that you can see the minimap, you can go back to your DLC definition file, and fine tune the parameters if you notice mistakes in placement, zoom, coordinates, size and so on.

 

______________________________________
The Witcher 3: Wild Hunt Complete Edition © 2024 CD PROJEKT S.A. Published by CD PROJEKT S.A. Developed by CD PROJEKT RED. CD PROJEKT®, The Witcher®, REDengine® are registered trademarks of CD PROJEKT Capital Group. All rights reserved. The Witcher game is set in the universe created by Andrzej Sapkowski in his series of books. All rights reserved.