Deadly Dozen 2: Pacific Theater Map/Mission Editing

 

Overview

In Deadly Dozen 2, maps and missions are different things.  A map is the terrain, objects, and enemies.  A mission takes place on a map and contains the primary and secondary objectives that the player must complete to finish the mission.

To create maps you use the nWorld tool.  To create missions you use the MissionEd tool.  The player can play on a map with no mission, but it will never "end", since there will be no objectives to complete.

The basic steps to create a Mission (including a map) for Deadly Dozen 2 follows:

1) Create a map, either from scratch or by modifying one of the maps included with the game.  This is done by using the nWorld tool.  Make sure the map is placed in the Maps/ directory.

2) Place enemies on the map.  This is done within nWorld as well.

3) Place triggers on the map.  Triggers are usually mission objectives, although they can also be used to create simple scripted events.  Triggers are also placed within nWorld.

4) Create lightmaps for the map, this is done from within nWorld as well.

5) Generate waypoints, this is done with an external tool called wpgen.

6) Generate a weather surface file if the map has weather effects, this is done with wpgen.

7) Set up the mission using the MissionEd tool, save the mission (.mis file) in the Missions/ directory.

To play the mission simple select the "Single Mission" option from the main menu of the game, your mission will show up there.

 

nWorld

Creating a Map

nWorld is the tool used to create maps, place enemies and set up triggers.  Below is a short walkthrough on how to create a map from scratch.

1) Start nWorld.exe (located in the game directory).

2) Either the last map you were working on will load or it will give an error then create an empty world.

3) Go to the File menu then select New.

4) It will first ask you to specify a filename, it is suggested you put user created maps in the Maps/  directory, although you can create your own directory to put your maps in as well.  Lets make a map in Maps/test.mpb.

5) The next screen that comes up allows you to change all sorts of settings, including which art set this map will use (forest, desert, snow, etc.).  For now just hit OK.

5) Now you will see nothing but a blue sky, some clouds and a flat terrain underneath you.  The first thing you need to do is get some objects in here.  Go to the File menu and select Import, then select "DB from Map".  Navigate to the Maps/ directory and select area1.mpb.

6) Next, select the "Object" tab in the upper right.  Open the Group drop-down box that is right at the top, and select the ENEMY group (you may have to scroll down a bit).

7) Select Infantry-Arisaka in the list of objects down below, then bring your mouse back on top of the View window.  You should see what looks kind of like an enemy soldier but he is all blue.  This is an enemy icon.  Enemies show up as 3D icons in nWorld, while world objects are rendered like you see them in the game.  Click the mouse anywhere on the terrain to place the enemy.

8) Next we want to place a trigger on this guy so we can set a mission objective that is complete when he dies.  Right click on the Infantry-Arisaka object in the object list on the right, then select Edit Properties.  Click Add then type this in the box that comes up: TRIGGER 15 1.  Then click OK, then OK again.

9) Now we need to place the exit zone on the map.  The exit zone is a special object, when the player's squad gets inside of it the mission ends.  First go to the View option on the main menu, then select the Objects sub-group then click on "Show Invisible Objects".  Exit zones are invisible so that option needs to be checked to see them.  Next, select the "mission objectives" group from the Group drop down box.  Select the ExitZone object, and place it somewhere off in the distance just like you placed the enemy.  It should look like a big red dome sitting on the ground.

10) Save the map then exit out of nWorld.

Congratulations you just made your first map!  Yes it was just a single enemy on an open field but its a start right?

 

Multiplayer Start Locations

To make a map work in multiplayer you have to place MULTISTART objects on the map to indicate where the players start.  Each game mode requires different types of MULTISTART objects.  A MULTISTART object is just a waypoint object (located in Objects/Editor/) with a MULTISTART prop on it.  The parameters to the prop determine the game mode that object will be used for.  To see an example of how the MULTISTART properties are used you can load up one of the maps that are included with the game.  Each mode is described below:

Deathmatch:

To make a map work in deathmatch you simply have to place some MULTISTART objects on the map.  To do this follow these steps:

1) Create your deathmatch map

2) Import a waypoint object by selecting the Object tab, pressing Import Object, and importing Objects/Editor/waypoint.z3d and putting it in a group (or creating a new one)

3) Edit the properties for that object, then hit "Add" and for the name of the property type MULTISTART

4) Place a few of these objects on the map

5) Save, then in the game when you add a map in deathmatch mode your map should show up in the list (make sure you spelled MULTISTART right!)

Team Deathmatch:

Team deathmatch is like normal Deathmatch except you have to place specific MULTISTART objects for each team.  Import several waypoint objects like for Deathmatch, and name them all something like team1, team2, etc.  Instead of just putting MULTISTART on each object, put MULTISTART team1 or MULTISTART team2, etc., up to team8.  Then place team start locations all over the map and players on that team will start in those locations.

Cooperative:

For a map to work in cooperative mode it has to have a valid mission (.mis) file.  No MULTISTART objects need to be on the map for it to work in cooperative mode, it will use the single player start locations.

Mission Mode:

Mission mode requires that a valid mission (.mis) file exists as well as MULTISTART objects.  Mission mode always has 2 teams, so you need to place MULTISTART objects for both sides.  You need to import 2 waypoint objects, name one of them ATTACKER and one of them DEFENDER.  The prop on ATTACKER should read MULTISTART mis2 and the prop on DEFENDER should read MULTISTART mis1.  Place some ATTACKER objects near the start location of the map and sprinkle some DEFENDER objects near the mission objectives.

Capture the Flag:

Capture the Flag works exactly like Team Deathmatch, except you also need to place a flag or multiple flags on the map.  To place a flag import a waypoint object and put a FLAGSPAWN prop on it.  If you want just one flag on a map don't put any parameters on the FLAGSPAWN prop.  If you want the flag to be for a specific team simply put the number of the team it is for.  So if you want to place a flag for team 1 and team 2, import 2 waypoint objects, name one flag1 and one flag2, then add a FLAGSPAWN prop to flag1 that says this: FLAGSPAWN 1 and add a prop to flag2 that says this: FLAGSPAWN 2.

 

The nWorld Screen Layout

nWorld has several windows and toolbars you need to know about to use it effectively.  In the upper left is the View window.  This shows you the world, using the same engine the game uses.  So what you see in that window is what it will look like in the game.  Going from the top to the bottom of the nWorld window along the right side is the control bar.  This is where all the controls for manipulating the world will appear.  There are four tabs across the top of the control bar, each one is described below.  In the bottom left is the Info window, this shows you info about the map and your current view.  In the bottom right is the overhead view of the map's terrain and shows the water level.

 

The Control Bar

On the right side of the nWorld window is the control bar.  It has four tabs on it, each corresponding to an editing mode.

Move

This is movement mode.  You don't actually do any editing in this mode, it is for getting around your map easily.

Object

Object mode is for adding, deleting, moving, scaling, rotating, or importing objects on your map.

Tiles

Tile mode is for modifying the textures on the terrain.  This includes adding roads, making an area dirt instead of grass, or painting rock on a mountain for example.

Terrain 

Terrain mode is for modifying the terrain itself.  You can create mountains by "pulling" up the terrain, or you can create valleys by "pushing" the terrain down.  You also set the water level in Terrain Mode.  It is best to use an external 2D paint program like Paint Shop Pro or Photoshop to create the actual terrain, then use Terrain mode to just tweak it.  Creating an entire terrain by hand using Terrain mode would take forever.

 

Importing Terrain Bitmaps

The best way to create the rolling hills or sharp cliffs you see in Deadly Dozen 2 isn't with the Terrain editing tools in nWorld, it is with a 2D paint program such as Photoshop.  Make a 24bit image, and only use grays to generate your terrain bitmap.  White is "high" and black is "low".  For example if you make an all black image with a white point in the middle, that white point will be an extremely tall mountain.  Save the image as a 24bit TGA uncompressed TGA file.  To import it into nWorld go to the File menu, then Import then Terrain TGA.  Pick the TGA you created and your overhead map will update to look just like your image, and the terrain in the View window will match it.

 

Generating Shadows

Say you make a beautiful map full of trees, bushes, houses, fences and everything else that makes a map look cool.  Still doesn't look as good as the ones in the game?  Probably missing shadows.  To generate shadows, just load your map into nWorld and go to the Tools menu and select Generate Shadows.  The default options are generally good for any map, unless you want to achieve a specific effect.  Note that generating shadows can take several hours, depending on the complexity and size of your map.  As an example, most of the maps in the game took about 1 hour on a P4-2Ghz computer.

 

Properties

nWorld works off of an object-based level design model.  You don't craft levels polygon-by-polygon, but rather you place objects on the map.  This means that objects can have properties associated with them, so whenever you place an object it automatically has those properties.  If you right click on an object in the control bar and select Edit Properties you may notice some properties on it.  You can have up to five properties on an object.  You can edit the current ones, remove them or add your own.  For a list of properties and their syntax see props.txt.

 

Importing Objects

nWorld has a database of objects known as the object DB.  The DB is split into groups, like you may have a group called Trees that has all the trees in it.  When you import a DB from another map like we did above, all of that map's groups and objects are imported.  You can then remove objects as you see fit.  Sometimes it is necessary to import objects from the hard disk into the DB.  Like if you want to define a new type of enemy or particle system, you will need to import a new enemy icon and give it a unique name and set of properties.  To import an object simply click on Import Object when in Object mode.  Navigate to the Objects directory, inside there are many objects you can use.  Like if you want to create a new type of enemy that has a Type 99, you would import an enemy icon from Objects/Editor, like say enemy03.z3d.  Then you need to put the ENEMY property on it (you can copy the prop from another enemy or try to get the syntax right yourself using props.txt).

 

Triggers

The mission system in Deadly Dozen works by setting triggers on certain things in nWorld.  When these triggers are triggered, that objective is complete.  Triggers include things like killing a particular enemy, destroying a particular item in the world, getting near an area, and a few other things.  Each trigger has a unique ID.  If you have more than one trigger with the same ID in the world the map won't load (and you will see an error in z3d.log).

We added a trigger in the short map tutorial above.  Note that when you import the DB from another map like we did, there will be a bunch of triggers on stuff already.  It maybe be best to set your own trigger IDs starting at 10, instead of 0, to avoid conflicts with the triggers that are already on the maps.  Triggers on the maps that aren't referenced in the mission file will usually be harmless.

Note that because triggers must be unique that means you can't put a trigger prop on an enemy and place two of him on the map.  You have to import more enemies into the DB and give them unique names if you want them all to have different IDs.

The trigger prop is fairly complex, for a full description of it see the props.txt file. 

 

External Utilities

Generating Waypoints

In order for the enemies to know where to go, you need to generate waypoints on your maps.  If you don't generate waypoints all enemies will be stationary and will never move.  To generate waypoints you need to run wpgen.exe.  Make sure no other program is running then run wpgen like this:

wpgen <mapname>

For example, to generate waypoints on the test map created above you would type:

wpgen maps/test.mpb

The map will load.  Then simply hit "G" to generate waypoints.  This operation can take many many hours, depending on the size and complexity of the map.  As an example, most of the maps in the game took 8-10 hours to generate on a P4-2Ghz computer.  Some missions take several days to generate, so beware.

 

Weather Effects

To create those cool weather effects you need to add two files into the same directory your map resides in.  One is a .wfx file, the other is a .sgd file.  The .wfx is a text file describing the weather effect you want, such as rain or snow.  The format of this file is pretty simple, you should look at the .wfx files included with the game for examples.  If you want to use the same sort of rain that is in level one on our test map, simply copy area1.wfx and name it test.wfx.

The .sgd file is the surface definition file.  This file is needed to tell the game where rain can't fall, such as indoors or under overhangs.  To generate a .sgd file run wpgen and use the "Q" key to generate surface data for your map.

 

Missions

You can play on a map without a mission, it will just never end and there will be no objectives.  As long as waypoints have been generated for the map the enemies will act normally and try to kill the player's squad.

Things get a lot more interesting when you have some objectives though.  To create a mission you can use the MissionEd program.  It will generate a .mis file that you must place in the Missions directory.  Mission files use .mpb files, so make sure you have created test.mpb already.

To create a mission just load up MissionEd.exe.  You will see 3 tabs across the top.  Fill in as much as you can (or want) right now.  The first tab is the most important.  First give your mission a name, anything is fine.  Then click on the little folder icon to the right of the "Map (.mpb)" box.  Select the map you created above, Maps/test.mpb.

Next, click on the Objectives tab.  Click the "Add Objective" button at the bottom of the dialog.  You will see one of the slots gets filled with temp info.  Just give your objective a description, and set the trigger to 15 (remember giving the enemy on your map the trigger 15?).  Click on "Save" then save your mission to Missions/test.mis.

Now exit from MissionEd and load up Deadly Dozen 2.  Choose the "Single Mission" option on the main menu.  Your mission should show up as "Test".  Load it up and play!  Just kill the enemy then run to the exit zone to complete the mission.