]> icculus.org git repositories - divverent/nexuiz.git/blob - Docs/mapping.txt
do not REQUIRE spaces before and after =
[divverent/nexuiz.git] / Docs / mapping.txt
1 ==============\r
2 =Mapping Help=\r
3 ==============\r
4 \r
5 While I can't help you make a map, I can help you get it listed in the menu and\r
6 working in the maplist. :p  The central object is the .mapinfo file, but\r
7 there's much more available.\r
8 \r
9 Table of Contents\r
10 -----------------\r
11 I        Map Lists & Scripts\r
12          (get your map listed and working)\r
13   i.     mapinfo\r
14   ii.    mapname.cfg\r
15 \r
16 II       Map Image\r
17 \r
18 III      Domination\r
19 \r
20 IV       CTF\r
21 \r
22 V        Rune Match\r
23 \r
24 VI       Assault\r
25 \r
26 VII      Onslaught\r
27 \r
28 Appendix A - Advanced mapinfo\r
29 \r
30 Appendix B - Helpful extras\r
31   i.     Team Colors\r
32   ii.    Text Colors\r
33 \r
34 Appendix C - Advanced Darkplaces shaders\r
35 \r
36 ========================\r
37 =I. Map Lists & Scripts=\r
38 ========================\r
39 \r
40 There now is just a single script/cfg file available to you, containing all map\r
41 specific settings:\r
42 \r
43 mapname.mapinfo\r
44 \r
45 The mapinfo is actually required - however, the game is so nice that it\r
46 automatically generates a draft of it for you.\r
47 \r
48 ------------------\r
49 -The mapinfo file-\r
50 ------------------\r
51 \r
52 *cue even more scary music*\r
53 \r
54 The mapinfo file is basically what gets your map listed in the menu, and sets\r
55 up the options needed to change to it. If no mapinfo file exists, the menu\r
56 will automatically generate a rough draft for you on game startup. It will get\r
57 stored into data/data/mapname.mapinfo.\r
58 \r
59 As an example, let's say I make a map called "wazat1.bsp". As long as I'm\r
60 fantasizing, I might as well say this map is so well done I'm actually willing\r
61 to release it for friends, neighbors, fellow forum visitors and other people\r
62 who like me to judge me by. Let's also assume that I want domination,\r
63 deathmatch/team deathmatch and runematch to all be playable on my map.\r
64 \r
65 This is very easy. First, I start the game and exit it again so the game writes\r
66 data/data/wazat1.mapinfo for me. The file may look like:\r
67 \r
68     title Wazat's Great Map\r
69     description Bleh.\r
70     author Unknown\r
71     _diameter 1966.839355\r
72     _spawnpoints 5\r
73     has weapons\r
74         cdtrack 5\r
75     type dm 30 20\r
76     type dom 200 20\r
77     type rune 200 20\r
78     type lms 9 20\r
79     type arena 10 20\r
80 \r
81 As I see, the menu autodetected that my map may be suitable for deathmatch,\r
82 domination, runematch, last man standing and arena. But I want the map to be\r
83 played in domination, deathmatch, team deathmatch, runematch only, and I also\r
84 want different timelimits/fraglimits, so I will change the "type" lines to:\r
85 \r
86     type dom 100 15\r
87     type rune 1000 25\r
88     type dm 40 15\r
89     type tdm 50 0 2\r
90 \r
91 Also, while I am at it, I should fix the placeholders in the map description lines:\r
92 \r
93     title Wibble\r
94     description A large multi level arena map\r
95     author Wazat\r
96 \r
97 Although not entirely necessary, I will now move the .mapinfo file from\r
98 data/data/maps/wazat1.mapinfo to data/maps/wazat1.mapinfo, so it is at the same\r
99 place as my map. Next time I start the game, my map will be shown supporting\r
100 the right game modes and with the right description in the menu.\r
101 \r
102 Also, note the "has weapons" line. If this line is not there (which happens if\r
103 the map contains no weapon entities other than the Nex), the map will run in\r
104 MinstaGib only and not be shown in the menu normally. So if you look for your\r
105 map and don't find it, add "has weapons" to the mapinfo file, and make sure you\r
106 have weapon entities placed.\r
107 \r
108 There's much more power in a mapinfo file. See Appendix A for more details.\r
109 \r
110 By the way: the Domination and Keyhunt types allow a third number to specify\r
111 the number of teams; the CTF type allows a third number to specify a capture\r
112 limit (if g_ctf_win_mode is 0 or 1).\r
113 \r
114 \r
115 ===============\r
116 =II. Map Image=\r
117 ===============\r
118 \r
119 So, you've got your map listed in the menu and it plays properly, but the menu\r
120 isn't showing your picture! Or the picture is scaled badly! What manner of man\r
121 would create such an accursed abomination?!\r
122 \r
123 Well... That sounds like something I'd do. :D\r
124 \r
125 And it is really easy: just make a screenshot of the map in action (preferably\r
126 with crosshair and HUD switched off), and place it next to the map as\r
127 mapname.jpg. For best rendering and file size, make the image in 4:3 aspect\r
128 ratio, but scale it to the resolution 256x256 or possibly 512x512. It will look\r
129 skewed in your image editing app, but the menu will show it right, and your\r
130 graphics card LOVES images of such dimension.\r
131 \r
132 \r
133 =================\r
134 =III. Domination=\r
135 =================\r
136 \r
137 In order to get Domination working well in your map, you need to place dom_team\r
138 and dom_controlpoint entites. You *must* have at least 3 dom_team entities - 2\r
139 minimum teams and one blank one (empty netname and no team). You can have up\r
140 to 4 teams (5 dom_team entities).\r
141 \r
142 Dom Team\r
143 --------\r
144 classname  dom_team\r
145 netname    name of team (Red Team). Set to "" or don't define for the required\r
146            blank team.\r
147 cnt        color of the team. See the "Helpful Extras" section for info.\r
148 model      When this team captures control points, the points turn to this\r
149            model. If this is the neutral team, points start out as this model.\r
150 noise      Sound to be played on the control point when it's captured. Only\r
151            players nearby will hear it.\r
152 noise1     Sound to be played to all players when the control point is\r
153            captured. Also good for an annoncer voice ("Red Team has captured a\r
154            control point")\r
155 \r
156 Control Points\r
157 --------------\r
158 classname  dom_controlpoint\r
159 message    message to be displayed to all players when this point is captured,\r
160            preceded by the team's name. This defaults to " has captured a control point".\r
161            You can specify different names for each point, for example " has captured the\r
162            Lava Room".\r
163 origin     where in the map this point is\r
164 wait       How often this point gives its controlling team frags.\r
165 frags      How many frags this point gives each wait cycle.\r
166 \r
167 Here is an example entry in a .ent file that includes colored text and 3 teams:\r
168 \r
169 {\r
170 "classname" "dom_team"\r
171 "netname" ""\r
172 "model" "models/domination/dom_unclaimed.md3"\r
173 }\r
174 {\r
175 "classname" "dom_team"\r
176 "netname" "^4Blue Team"\r
177 "cnt" "13"\r
178 "noise" ""\r
179 "noise1" "domination/claim.wav"\r
180 "model" "models/domination/dom_blue.md3"\r
181 }\r
182 {\r
183 "classname" "dom_team"\r
184 "netname" "^1Red Team"\r
185 "cnt" "4"\r
186 "noise" ""\r
187 "noise1" "domination/claim.wav"\r
188 "model" "models/domination/dom_red.md3"\r
189 }\r
190 {\r
191 "classname" "dom_team"\r
192 "netname" "^6Pink Team"\r
193 "cnt" "9"\r
194 "noise" ""\r
195 "noise1" "domination/claim.wav"\r
196 "model" "models/domination/dom_pink.md3"\r
197 }\r
198 {\r
199 "classname" "dom_team"\r
200 "netname" "^3Yellow Team"\r
201 "cnt" "12"\r
202 "noise" ""\r
203 "noise1" "domination/claim.wav"\r
204 "model" "models/domination/dom_yellow.md3"\r
205 }\r
206 {\r
207 "classname" "dom_controlpoint"\r
208 "message" " ^3has captured the ^1Hallways"\r
209 "origin" "-206.0 -488.8 -150.0"\r
210 "frags" "3"\r
211 "wait" "5"\r
212 "scale" "1.3"\r
213 }\r
214 {\r
215 "classname" "dom_controlpoint"\r
216 "message" " ^3has captured the ^1Lavaroom"\r
217 "origin" "1457.1  19.9 -110.0"\r
218 "frags" "1"\r
219 "wait" "5"\r
220 }\r
221 {\r
222 "classname" "dom_controlpoint"\r
223 "message" " ^3controls the ^1Nex & Strength"\r
224 "origin" "-259.8 299.3  5"\r
225 "frags" "1"\r
226 "wait" "5"\r
227 }\r
228 {\r
229 "classname" "dom_controlpoint"\r
230 "message" " ^3has captured the ^1Upper Platform"\r
231 "origin" "539.7 1206.0 182.0"\r
232 "frags" "1"\r
233 "wait" "5"\r
234 }\r
235 {\r
236 "classname" "dom_controlpoint"\r
237 "message" " ^3has captured the ^1Teleport Room"\r
238 "origin" "-1000.0 636.2 -16.0"\r
239 "frags" "1"\r
240 "wait" "5"\r
241 }\r
242 \r
243 \r
244 As you can see in the example, there are 5 dom_team ents: one blank, Red, Blue,\r
245 Pink and Yellow. Each control point has a different message (giving it a\r
246 special name), and the one in the hallways gives 3 frags every 5 seconds\r
247 instead of just one, making it more valuable.\r
248 \r
249 If your map contains the required entities for Domination, the menu will\r
250 automatically detect it for supporting Domination. To force the map to get\r
251 re-detected after you add such entities, delete the data/data/mapname.mapinfo\r
252 file - or simply edit it to add the "type dom" line.\r
253 \r
254 \r
255 =========\r
256 =IV. CTF=\r
257 =========\r
258 \r
259 Capture the flag needs at least 1 CTF flag per team, and can also make use of\r
260 team spawnpoints.\r
261 \r
262 CTF Flags\r
263 ---------\r
264 classname  item_flag_team1 or item_flag_team2\r
265 angle      direction the flag will point\r
266 model      model of the flag (default: models/ctf/flag_red.md3 or\r
267            models/ctf/flag_blue.md3)\r
268 noise      sound played when flag is stolen (default: "ctf/take.wav")\r
269 noise1     sound played when flag is returned by a teammate (default:\r
270            "ctf/return.wav")\r
271 noise2     sound played when flag is captured (default: "ctf/capture.wav")\r
272 noise3     sound played when flag returns itself (default: "ctf/respawn.wav")\r
273 \r
274 Team Spawnpoints\r
275 ----------------\r
276 classname  info_player_team1 or info_player_team2\r
277 *note: These function just like info_player_deathmatch, but for one team only.\r
278 If you don't make team spawnpoints, info_player_deathmatch is used instead.\r
279 \r
280 If your map contains the required entities for CTF, the menu will automatically\r
281 detect it for supporting CTF. To force the map to get re-detected after you add\r
282 such entities, delete the data/data/mapname.mapinfo file - or simply edit it to\r
283 add the "type ctf" line.\r
284 \r
285 ==============\r
286 =V. Runematch=\r
287 ==============\r
288 \r
289 Runematch needs only one type of entity to work: rune spawn points. You will\r
290 need at least one for each rune (5 minimum at the time of this writing), though\r
291 you should probably have more than that in the map. Just give the points a\r
292 classname and origin.\r
293 \r
294 Rune Spawnpoints\r
295 ----------------\r
296 classname  runematch_spawn_point\r
297 \r
298 If your map contains the required entities for Runematch, the menu will automatically\r
299 detect it for supporting Runematch. To force the map to get re-detected after you add\r
300 such entities, delete the data/data/mapname.mapinfo file - or simply edit it to\r
301 add the "type rune" line.\r
302 \r
303 ==========\r
304 =VI. Race=\r
305 ==========\r
306 \r
307 Making a race map is not hard: you need some special spawnpoints, and some checkpoints.\r
308 \r
309 Spawnpoints\r
310 -----------\r
311 classname  info_player_race\r
312 target     targetname of the controlpoint\r
313 race_place for finish line control points, the place of the point\r
314 \r
315 Checkpoints\r
316 -----------\r
317 classname  trigger_race_checkpoint\r
318 targetname some name to target the checkpoint with\r
319 cnt        number of the checkpoint (or 0 for finish line)\r
320 \r
321 Note that checkpoints are brush entities, and they should be somewhat thick and\r
322 cover the full volume the player could use to get past them.\r
323 \r
324 Example of entity placement:\r
325 \r
326                          ###\r
327     ---------------------###---\r
328    /    >>>>  7  5  3  1 ###   \\r
329   /     >>>> 8  6  4  2  ###    \\r
330  |     ------------------###     |\r
331 %%%%%%%%                 ###|    |\r
332 %%%%%%%%                 $$$|    |\r
333  | ^ ^ ------------------$$$     |\r
334  \                       $$$ <  /\r
335   \                      $$$ < /\r
336    ----------------------$$$---\r
337                          $$$\r
338 \r
339 ###:  classname = trigger_race_checkpoint, cnt = 0, targetname = finish\r
340 $$$:  classname = trigger_race_checkpoint, cnt = 1, targetname = cp1\r
341 %%%:  classname = trigger_race_checkpoint, cnt = 2, targetname = cp2\r
342 >:    classname = info_player_race,                 target = finish, angle = 0\r
343 1:    classname = info_player_race,                 target = finish, angle = 0, race_place = 1\r
344 2:    classname = info_player_race,                 target = finish, angle = 0, race_place = 2\r
345 ....\r
346 8:    classname = info_player_race,                 target = finish, angle = 0, race_place = 8\r
347 <:    classname = info_player_race,                 target = cp1,    angle = 180\r
348 ^:    classname = info_player_race,                 target = cp2,    angle = 90\r
349 \r
350 If your map contains the required entities for Race, the menu will automatically\r
351 detect it for supporting Race. To force the map to get re-detected after you add\r
352 such entities, delete the data/data/mapname.mapinfo file - or simply edit it to\r
353 add the "type race" line.\r
354 \r
355 \r
356 ===============================\r
357 =Appendix A - Advanced mapinfo=\r
358 ===============================\r
359 \r
360 You now know how to make a basic, bare-bones mapinfo to set up a couple options\r
361 and load your map. However, there's much more you can do!  Consider these\r
362 senarios:\r
363 \r
364 1. The laser has too high of a force for laser jumps and ruins CTF\r
365 2. I don't want players to start out with the shotgun, but with the machinegun\r
366    instead\r
367 3. The map takes so much server CPU performance that the anti-wallhack can't be\r
368    made active\r
369 \r
370 Each of these situations can be resolved with ease with a little work in the\r
371 mapinfo file.\r
372 \r
373 To do this, I can add the following lines to my mapinfo file:\r
374 \r
375     settemp_for_type ctf g_balance_laser_primary_force 200\r
376     settemp_for_type all g_start_weapon_shotgun 0\r
377     settemp_for_type all g_start_weapon_uzi 1\r
378     settemp_for_type all sv_cullentities_trace 0\r
379 \r
380 These "settemp" settings are automatically removed when the map is left and\r
381 another is loaded. As you can see, it is possible to make per-mode temporary\r
382 settings, and global ones.\r
383 \r
384 Similar settings are also possible for the client:\r
385 \r
386     clientsettemp_for_type all r_shadow_glossexponent 96\r
387 \r
388 Another possibility is to specify fog settings in the mapinfo, for convenience\r
389 in case you set sv_foginterval by it too (to force the fog on the clients):\r
390 \r
391     fog 0.2 0.25 0.3 0.3 1 1500\r
392     settemp_for_type all sv_foginterval 5\r
393 \r
394 \r
395 =============================\r
396 =Appendix B - Helpful Extras=\r
397 =============================\r
398 \r
399 ----------------\r
400 -i. Team Colors-\r
401 ----------------\r
402 When you need to set an entity's color or team, use these values:\r
403 \r
404 Red\r
405 ---\r
406 Team:      5\r
407 Color:     4\r
408 \r
409 Blue\r
410 ----\r
411 Team:      14\r
412 Color:     13\r
413 \r
414 Yellow\r
415 ------\r
416 Team:      13\r
417 Color:     12\r
418 \r
419 Pink\r
420 -----\r
421 Team:      10\r
422 Color:     9\r
423 \r
424 \r
425 ----------------\r
426 -i. Text Colors-\r
427 ----------------\r
428 Occasionally you may want to print text in color, such as team names. Here are your options:\r
429 \r
430 1  Red\r
431 2  Green\r
432 3  Yellow\r
433 4  Blue\r
434 5  Cyan\r
435 6  Magenta\r
436 7  White\r
437 8  Grey (transparent)\r
438 9  Grey (solid)\r
439 0  Black\r
440 \r
441 ==========================================\r
442 =Appendix C - Advanced Darkplaces shaders=\r
443 ==========================================\r
444 \r
445 Shader parameters for DP's own features:\r
446 - dp_reflect <distort> <r> <g> <b> <a>\r
447   Makes surfaces of this shader reflective with r_water. The reflection is\r
448   alpha blended on the texture with the given alpha, and modulated by the given\r
449   color. distort is used in conjunction with the normalmap to simulate a\r
450   nonplanar water surface.\r
451 - dp_refract <distort> <r> <g> <b>\r
452   Makes surfaces of this shader refractive with r_water. The refraction\r
453   replaces the transparency of the texture. distort is used in conjunction with\r
454   the normalmap to simulate a nonplanar water surface.\r
455 - dp_water <reflectmin> <reflectmax> <refractdistort> <reflectdistort> <refractr> <refractg> <refractb> <reflectr> <reflectg> <reflectb> <alpha>\r
456   This combines the effects of dp_reflect and dp_refract to simulate a water\r
457   surface. However, the refraction and the reflection are mixed using a Fresnel\r
458   equation that makes the amount of reflection slide from reflectmin when\r
459   looking parallel to the water to reflectmax when looking directly into the\r
460   water. The result of this reflection/refraction mix is then layered BELOW the\r
461   texture of the shader, so basically, it "fills up" the alpha values of the\r
462   water. The alpha value is a multiplicator for the alpha value on the texture\r
463   - set this to a small value like 0.1 to emphasize the reflection and make\r
464   the water transparent; but if r_water is 0, alpha isn't used, so the water can\r
465   be very visible then too.\r
466 \r