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