Mapping 102: Creating your first map

## First Task - Box Map

After you have poked around a bit in the program, it's now time to make a small map out of basic rectangular brushes.

#### What is required?

1. For JKA:
	* info\_player\_start, info\_player\_deathmatch or info\_player\_duel
2. For MBII:
	* info\_player\_siegeteam1, info\_player\_siegeteam2 entities (16 each, but one of each will suffice for this test)
	* info\_player\_start (this is for where your camera spawns in the map)
	* a .siege file (located within the maps directory, for testing efficiency you can use base/maps similar to your map file)
3. An enclosed area made up of structural brushes (by default, any brush you put into the world are structural) which does not have access to the void. You cannot properly compile a map if the void (outside of the map) leaks in. *More on Structural vs. Detail brushes later.*

Make your first box room (closed-up from the void) with structural brushes. Try to practice good form by mitering your brushes. The more you mitre, the more you save on brush faces. Mitre as much as you can and always try to think of ways to diagonally connect your brushes instead of 'minecraft-style' Ok, let's begin.

* Set your netradiant to a high grid size so the brushes you place are nice and easy to work with. We suggest Grid16, the hotkey is 5 on your keyboard.
* Add a 64-unit-tall brush. This is the size of a regular model in MBII. This will give you a sense of scale to what you are building.
* Leave the roof until last. Make some basic walls, floor and obstacles
* Use a combination of the 3D and 2D views. Each is easier and better to use for different tasks

##### Add Lighting and Entities

1. Lighting is just as complex a topic as the rest of mapping. This power is flexible: from mild decoration to completely controlling how a map plays and feels. Mappers develop their own style of lighting and use it in different ways. Lighting can also come from shader properties (especially the Skybox). But for now we are keeping simple. To add a light, right click on your orthographic view (or double right click in your camera view) and click the 'light' entity. Basic lights with an intensity between 300-1000 are enough for now: you will need to trial and experiment to see their effects. You can click and drag outside of the light to scale the power of the light.
	1. Optional: If you want to make the light more diffuse, you would open up your Entity Inspector with the light selected, and check the 'No Incidence' flag.
2. Do the same process again but this time adding info\_player\_siegeteam1/2 and info\_player\_deathmatch entities. Open up your Entity Inspector (N) again if you want to change the angle of the info\_player\_deathmatch (spectator) camera.
3. Make sure all your entities are within your box and make sure your box is properly sealed from the void... otherwise it will cause a leak and not compile!
4. Your box should be made of caulk, with the inside areas covered in a shader of your choosing. Use the middle mouse button / shift middle mouse button to copy/paste textures onto brushes.
5. Your last step here is to make sure your map has a connected siege file. Siege files are just .txt files renamed to .siege with information on how the map is to be run for MBII.
	* *If you are lazy, just grab a .siege file from one of the working maps and use that for a while. All text assets are found within the assets3.pk3 of whatever map pack you are looking for (mbassets3, cmpassets3, etc).*
	* *Within the /maps directory of that .pk3. Eventually you will learn how to make your own, but it's not too important initially.*
		+ *I suggest using a .siege like Pool Party or a duel map which has nothing complex added to it like objective stuff or minimap stuff it as your starting .siege.*
		+ The .siege file needs to share the same name as your map, (ie: myfirstmap.bsp / myfirstmap.siege) and also be in the /maps directory of your gamedata/base (or .pk3).
	* *Rename the .siege to have the exact name of the map you are compiling otherwise it won't work. Put this .siege in your base/maps folder where you should also be saving/compiling your maps to. After you compile, you should now be able to devmap to your map any time, even without exiting MBII itself. You are now all set up with the basics to map!*
6. Time to compile. Go to Build and click one of these builds (test or final). You want a build which goes through the 3 processes of compiling, BSP, VIS and LIGHT. Results vary a lot with the light stage, but that's for a later tutorial.
	1. This will run a compile and build from your .map a .bsp in the same folder where you have saved your current .map

*If your .siege file and newly created .bsp are in the gamedata/base/maps directory, you can open up MBII, open up the console and /devmap to your map!*

#### Useful In-Game commands

Remember to precede all commands with a slash, otherwise the game assumes they are chat messages.

* You have two options to load your map:
	+ /mbmode *<mapname> <0-4> - loads the map and switches to whichever mode you wish*
		- 0 = Open mode, 1 = Semi-Authentic, 2 = Full-Authentic, 3 = Duel, 4 = Legends
	+ /devmap *<mapname* noclip — puts you into a 'ghost mode' where you can fly through your map
	+ r\_clear 1 — blanks the screen between frames: useful when flying outside of a map
	+ bind p noclip — binds the 'noclip' command to your **P** key on your keyboard, for example
* give
	+ give health
	+ give ammo
	+ give bp
	+ give force
	+ give lives
	+ give all
* newround — starts a new round
* kill — commit suicide
* /r\_showtris 1 (with devmap only) helps you see what is being rendered by outlining all triangles being rendered (useful for optimization purposes)
* /r\_lightmap 1 (with devmap only) How lighting looks on your textures (must have cheats enabled to use these cvars)
* /r\_speeds 1 will show several pieces of information about the current area being rendered by the engine, by enabling the /developer cvar at the same time it shows the text on screen instead of just in the console window.
* /timescale # - speeds round time up (default is 1) - bind 0 timescale 10 and bind 9 timescale 1 might help speed past round timer.
* /npc spawn nameofnpc

### Building and Testing

First off, when you run MBII for testing, it is recommended to use the OpenJK engine as Netradiant uses jamp.exe (the default engine used by MBII Launcher). This way you can have Netradiant running while OpenJK (MBII Engine) is running. To do this, go to the MBII Launcher settings and switch the client. Save your .map in Netradiant-custom within your Gamedata/base/maps folder, this will make things a lot easier for when you are testing your map after compile. If your .bsp and .siege are located within the /maps directory, you do not need to restart your game every time to test your map. Simply /devmap to your map after your map has been compiled.

You can now decorate your room a bit. Take a look at Step 2 of the same youtube tutorial series after you have built your first map!

Step 2

Step 3

After you have done this, it's time to move to the next chapter: Mapping 103: Brushwork

Author's note: Once this youtube series gets to 3, it lacks valuable information for MBII or JKA related entities *but* there are a few good little nuggets in there. If you want to learn more about how entities work, be sure to read the entity definitions of each entity you are working with (selecting an entity and pressing N). If you want to learn more about JKA-specific stuff, it is strongly suggested to follow this tutorial by Rich Diesel. It is by far the most in-depth tutorial on JKA mapping. Do not skip this tutorial as it will give you most important fundamentals you will need going forward. The reason I set you off into the Netradiant tutorial first is because that tutorial best shows you the basics of Netradiant. For Rich Diesel's tutorial, k*eep in mind, it is quite old and uses GTKRadiant, not Netradiant-custom so you there may be some parts which you will need to do a little manual conversion and exploration to figure out how a certain function may work in Netradiant as the controls are definitely different.*