Mapping - First Map =================== Types of Maps ------------- There are three types of xonotic maps. - Indoor (stormkeep) - Outdoor (space elevator) - Mixture of the above (solarium) Regardless of the type, every map needs to be completely enclosed. No entity should be able to escape from your map. The map compiler will tell you if your map is *leaking*. Per-Map Setup ------------- To keep things organized, every map should be created in its own folder in your userdata folder (see [Setup](mapping-Setup)). This folder's name needs to end with `.pk3dir` for Xonotic to recognize it. The convention is to name this folder `map-_.pk3dir`. In this folder, you need to save your map in a `maps` subfolder. For example, on Linux it should go into `~/.xonotic/data/map-_.pk3dir/maps/_.map`. The `` should be alpha-numeric, lowercase with dashes. Keeping every map in its own folder also simplifies [Packaging and releasing](mapping-packaging). Building blocks --------------- There are three types of building blocks for every map: ### Brushes Brushes are the main building blocks for every map. They need to be [convex](https://en.wikipedia.org/wiki/Convex_polytope). If you need concave shapes in your map, either break them down into multiple convex brushes or use a model (see Entities). Brushes are defined by a number of faces. Brushes are used to create the layout of your map. To create a new brush, make sure that you don't have any object selected (`Esc`) and simply Click+Drag in any 2D pane. ![Create a brush](assets/images/radiant-create-brush.gif) To move a brush (or even multiple brushes), select it and drag it around in either a 2D or 3D view. If you initially click outside of any selected brush, dragging will resize these brushes. ![Move and resize a brush](assets/images/radiant-move-resize-brush.gif) ### Patch meshes Patch meshes (or curves) are one-sided surfaces. They are defined by two types of points (use `V` to activate vertex selection): - Green points: describe points that are on the surface - Pink points: Control points that describe how the surface curves between the green points ![Simple patch mesh](assets/images/radiant-patch-example.png) The detail/smoothness of patch meshes is controlled by the ingame settings. ### Entities Entities are used for everything that needs special handling ingame. This includes spawn points, game models, doors/moving brushes, control logic and more. Entities can be placed from the rightclick menu in 2D panes. First room ---------- First of all you should select a big grid size (Grid64 by pressing `7`). Leftclick and drag in a 2D view to create a reasonably sized brush (at least 128 Units high - player models are a bit more than 64 Units high). With this brush selected, select a smaller grid size (Grid16 - `5`) and use the `Make Room` tool. The selected grid size will determine the wall thickness. Only make thin walls if absolutely needed! If your NetRadiant build is too old to have the `Make Room` tool, you can use the `Make Hollow` tool and move all the resulting walls out a bit so that they no longer overlap. ![First Room](assets/images/radiant-first-room.png) Next, the room needs to be textured. For this, with your brushes selected, open the Texture browser (`T`) and select a Texture. Note that for optimized maps only faces that are visible should be textured, all non-visible faces should use the `caulk` shader. For more information, see [Optimizations](mapping-Optimizing). Every map needs at least one entity. To place one, a right-click in a 2D pane will make a menu appear. Player spawnpoints have names that start with `info-player-`. For now, choose `info-player-deathmatch`. Make sure you don't have anything selected as this will replace your selection. If the spawnpoint is not inside the room, move it just like you move a brush. Compiling and Testing --------------------- Before a map can be tested ingame, it first needs to be compiled to a `.bsp` file. There are several presets in the `Build` menu. To simply test the layout, `Single: -bsp` is a good choice. It will also not add any lighting information, making it possible to test the map without placing lights or light emiting shaders. The `Final` presets take much longer to compile and should only be used once you're confident in your layout and lighting. Once the build is finished without errors, you can start Xonotic. To test your map, type `chmap _` in the ingame console (`Shift+Esc`). **TIP**: You can use `Tab` to autocomplete commands and mapnames. The engine will automatically generate a `_.mapinfo` file in your userdata folder under `data/maps/autogenerated/`, e.g. under Linux `~/.xonotic/data/data/maps/autogenerated/` (yes, `data` **twice**). You should move this file next to your `.map` file and adapt it (- it's just a text file). Adding a second room -------------------- You can create a second room just like you did with the first one. To make a doorway, select a wall brush and use the `Clipper` tool (`X`). With the Clipper tool, you can define a plane that will cut the selected brushes. Define up to three points by leftclicking in any 2D pane. You can also move these points by dragging them around. Once you have at least two points defined NetRadiant will preview the cutted brush. The infinitely long line (red in 2D panes, white in the 3D view) show the cutting plane's normal. By pressing `Enter` the selected brushes will be cut, removing all the parts on the side of the normal. If you want to keep both sides, you can press `Shift+Enter` instead. ![Using the clipper tool](assets/images/radiant-second-room-clipper.png) Create new brushes to create a hallway connecting the two rooms. You can also use `Ctrl+C` and `Ctrl+V` to copy&paste brushes. The toolbar also has buttons to flip and rotate objects around the three major axes. Make sure that the map is completely enclosed and brushes are not overlapping, otherwise textures might flicker (so called *Z-fights*). \<\< [NetRadiant](mapping-NetRadiant) | [Map picture](mapping-MapPicture) \>\> … [Creating_Maps](Creating-Maps) …