How to create new maps

From Running With Rifles Wiki
Jump to: navigation, search

This is heavily work in progress (tutorial seriously started, May, 27 2014)

If interested in the map format itself, take a look at this page

Motivation[edit | edit source]

Creating a map in RWR isn't really difficult but it takes some time as a common 3D editor doesn't exist and will never do. Everything will all be done inside Inkscape in a 2D-view. If you are used to Inkscape then it should be even easier for you. Just keep in mind that a map won't be finished in a couple of hours so you might think about it twice before you start working on a map.

What's needed:[edit | edit source]

  • Inkscape, version 0.92 or newer at http://inkscape.org/ (older versions work as well but there might be some compatibility issues)
  • RWR Inkscape extension: it's shipped with the game in installation_folder\tools\inkscape. After you installed Inkscape, put those 2 files (rwr.inx and rwr.py) in the Inkscape\share\extensions folder
  • a simple tutorial map to make it easier for you to start with something: RWR tutorial map template. Extract the content (the "tutorial map" folder) of the archive into [Running with Rifles]\media\packages\vanilla\maps. In the library layer inside the objects.svg file you have a lot of useful informations too.
  • convert.exe and composite.exe, which are the only 2 required files from Imagemagick, which is a command line image editor/composer. Put those 2 files in the folder of your actual map you are working on, i.e. "tutorial map". You can find those files HERE

Inkscape introduction:[edit | edit source]

Inkscape is a vector graphic tool which is used as Map editor in Running with Rifles. The extension of Inkscape files is ".svg". Most informations of a map are inside the file "objects.svg" located in each map directory. After installing Inkscape, just double click the objects.svg in your "tutorial map" directory.

IMPORTANT: the rendering library in Inkscape is not the fastest unfortunately, so avoid to zoom in too much unless you have the filters deactivated. You can toggle the filter visualization in edit mode by pressing ctrl+keypad5. For most parts of the mapmaking you won't need filters to be shown constantly, so if you experience some dropdowns in performance, just disable them.



Important shortkeys:[edit | edit source]



Inkscape button select.png (F1) Select an object on the map. Use to move them around. Pressing the object in select mode twice allows you to rotate the selected object(s) by dragging the arrows at the corners of the selection.
IMPORTANT: NEVER use the arrows of the selection to change the object(s) size, this will mess up the transformation matrix which will lead to having your object at a different location on the map as it's supposed to be. Use the "edit path" tool instead (see below).
Inkscape button edit path.png (F2) Edit pathes. Use to move nodes (wall/fence... elements or grass/sand... terrain splat) around or to resize an object.
Inkscape button zoom.png (F3) Zoom. Once you press it you have different zoom options shown on the top at the top of the Inkscape window. Ctrl+Mousewheel is usually prefered to zoom in/out.
Inkscape button rectangles.png (F4) draw Rectangles. Every logical object apart from wall/fence elements which are pathes (buildings/trees/rocks/vehicles/etc.) are made out of rectangles. If some of them appear to be circles on some existing maps, it's because the corners of the rectangles have been rounded up (see top of the inkscape window when having the rectangle tool selected)
Inkscape button bezier.png (Shift+F6) draw Bezier curves. Use to make wall elements or to draw a splat map (grass/sand/road, etc). Once you have drawn your wall elements, you can adjust the nodes with the "edit path" tool (F2) if required.

IMPORTANT: if you use it to make a wall element, keep in mind that all stroke between the nodes should be "straight" and not a curve else the game will convert the curve into a multitude of very tight wall elements. To remedy, you can select all the nodes with the edit path tool (F2) and select the option "make selected segments lines" on the top part of the screen.

Inkscape button layers.png (Shift+Ctrl+L) shows the Layers. You can create layers and sublayers there, making some layers (in)visible, locking them, etc.
Inkscape button group.png (Ctrl+G) group selected objects. Required to group 2 pathes together forming a platform/deck/cliff/tower, etc.
Inkscape button ungroup.png (Shift+Ctrl+G) ungroup selected objects. Required to ungroup 2 wall objects forming a platform/deck/cliff/tower, etc.

IMPORTANT: if you imported a group from another map to your own map or rotated a group, you need to ungroup it and regroup it to keep the transformation matrix behaving correctly.

Inkscape button edit objects.png (Shift+Ctrl+F) edit objects. With this tool you can set the fill/stroke color of an object and it's opacity and also add gradients. The color of the objects is irrelevant for RWR, it's mainly a visual thing to keep track of the different object types in the editor.
Inkscape button color pick.png (F7) color picker. With this tool you can set the fill color of your selected object to take the color of where you click with this tool activated. While keeping Shift pressed it will take the color for the stroke of the object you selected.



Very important tips[edit | edit source]

- ctrl+keypad5: toggles the filters visualization (makes the rendering a LOT faster)
- Middle mouse mutton: keeping it pressed pans the map
- ctrl+Leftclick on an object inside an object group (towers, bridges, decks, etc are made like this) will only select the single object you chose. This is important when you want to see the properties of either the start path or ending path of such a group. If you simply click on the group it will only show the group properties, which is pretty much no information at all
- choosing a copy of a template object (in the "materials" layer) needs to be put in a layer, layer1, layer2, etc (and their sub-layers) to be loaded. The "materials" layer can't contain any physical objects, just parameters, templates, texture atlases, etc. This is often a source of confusion when an object is missing on the map
-


Map editing aspects:[edit | edit source]

RWR uses texture splatting for combining different terrain textures. Each layer has an opacity map which defines extent of texture presence on the terrain. The method works by applying an opacity map to the higher levels, revealing the layers underneath where the opacity map is partially or completely transparent.

  • dirt layer

The base terrain texture is the "dirt" layer and needs to be present for each map as fully opaque texture over the whole map size (it can be bigger as only the part inside the page boundaries will be takeb). The color doesn't mind, we use brown to make it visible as a dirt layer.

  • alpha_sand, alpha_grass, alpha_asphalt, alpha_road, (alpha_rocky_mountain)

Those are the alpha layers which will be mapped on top of the dirt layer. alpha_road is the highest layer, then asphalt, then grass, then sand. Of course also other alpha_layers could be used instead or some be left out (in the map rattlesnake crescent the alpha_sand has been left out and a alpha_rocky_mountain has been added). It is important though to have a MAXIMUM of 4 alpha splat layers + the dirt layer. There are also 4 layers for surface effects which are by default utilized by the dirt, blood, skidmarks and snow.

Texture splatting.png
texture splatting example


Just draw content on each layer in Inkscape in the according layer. Colors in these layers don't matter, what matters is where the content is and where it's not. Drawing a shape in Inkscape is usually done with the bezier tool (Shift+F6). To close the shape, just connect the starting and ending point. Afterwards just fill the shape with a color (using Shift+ctrl+F: edit Fill and Stroke)


  • Terrain heightmap

Like in most games, the terrain heigthmap is a grayscaled image
In Inkscape, the heightmap needs to be in the "height" layer, it's usual to use only shades of grey, each of which will be mapped to a certain height level in game. Completely black color i.e. 0 corresponds to 0 meter level, white i.e. 255 is 25 meters. The water level is at about 2m, i.e. shade of 20.

Heightmap.png

  • Not to do
  • closing your objects.svg while being zoomed in. If you have layers containing filters unhidden (usually grass, sand, height) it will load extremely slowly so that it feels like inkscape is hanging. Remember to zoom out when closing the document and to have those layers mentioned above hidden.
  • modifying the size of an object with F1 (selecting the object, then adjust the size while dragging the arrows shown on the edge and corners of the object). You should ONLY change the size with F2 and dragging the corners to match the size you want.


  • Game objects
    • Bases
    • Static soldier and vehicle spawn points
    • Crates
  • Procedurally generated objects
  • Mesh objects
    • Visuals
    • Collision models
    • Mesh sets
  • Templates
  • Road network
  • Decals
  • Avoidance regions
  • Mapview appearance
  • General settings


Basic workflow:

  • Editing methods
  • Exporting heightmap, terrain layers

"The RWR Inkscape extension is used for exporting the heightmap, terrain splat maps and map view related stuff primarily these days. It's shipped with the game in installation_folder\tools\inkscape.

The exporter picks up splat maps based on Inkscape layers named as alpha_*. Map view stuff gets currently picked up for exporting from layers named as map_view_decoration on root level, and woods*, objects*, walls* and rocks* inside each layer*."

  • Post processing exported resources

"Depending on which vanilla map you're using as basis and what kind of changes for the terrain layers you've made, or if you're creating a custom one from scratch, you may need to adjust process.bat to fit your terrain splat maps, mostly in naming files. Process.bat basically applies a bit of blurring for the splat maps (without having to have blurring enabled in Inkscape at all times) and converts the heightmap to Greyscale which is what RWR requires.

Process_post.bat is used to combine max 4 layers of splat maps into one image, using it allows terrain rendering to be done in one pass instead of many. The game always attempts to locate terrain5_combined_alpha.png first; if it's not found, the old rendering method is used. Also, if you have more than 5 layers (base layer + 4 terrain layers), the old rendering method is used.

Process_map_view.bat is used to ultimately create map.png from the map view related exported stuff and a bunch of helper images. This is what you see when you press TAB in game."


Advanced stuff:

  • terrain.cfg
  • partial live reload


Testing your map in Running with Rifles[edit | edit source]

Assuming that you have exported your textures from the objects.svg files within Inkscape and applied process,bat, process_post.bat and process_mapview.bat, then you should be ready to check your results ingame. You should run the game in debugmode and without AI (you wont need them to test at first). For that, create a shortcut to your map in the main game directory such as:
C:\Program Files (x86)\Steam\SteamApps\common\RunningWithRifles\rwr_game.exe no_ai debugmode verbose map=media\packages\vanilla\maps\map_tuto
In this case, the map folder is called "map_tuto". Of course you are free to name your map folder however you want to but you have to make sure the path is correct.

In-game, in debugmode, you can use the following shortkeys:

  • F4: free camera - with WASD you can fly around. SHIFT+WASD makes you fly around faster
  • F6: switch between day and night time
  • F9: different useful informations. Most of them are self-explanatory
  • CTRL+F9: wireframe mode
  • CTRL+F8 refreshes the area around your soldier. Useful when you make a change in your objects.svg file, like moving an object so that you don't have to restart the game everytime. Notice that only the objects around you will be refreshed, the rest of the map objects will be gone