Stridor's Map Making Tutorial Part #3

Please post here for questions and discussion about unit modeling and general game modding. You can also post your new units and modifications here.

Moderator: EagleMountainDK

Post Reply
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

Stridor's Map Making Tutorial Part #3

Post by Stridor »

EDIT: THE WHOLE MAP MAKING PROCESS HAS BEEN REVAMPED BY THE NEW MAP MAKER TOOL WHICH IS CURRENTLY IN OPEN BETA!
THIS THREAD NO LONGER APPLIES


Continued from here http://www.matrixgames.com/forums/tm.asp?m=1788372

Now it is time to start using the supplied scenedit program to allow us to start placing objects on the map. Before we do that we first need to talk about how graphics assets are identified and located. In PCK any map related graphic asset is identified in the code by an *id* and *not* by a *filename*. These links are kept inside the actual code library of PCK. It is possible to add your own new assets however, but first we must define the links between the id and the filename. We do this with a file called media.xml which resides in the map directory.

Consider this snippet of a media.xml file which comes from the Kharkov_L1A map

Code: Select all

 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE resources [
 <!ELEMENT resources ANY> 
 <!ELEMENT resource ANY> 
 <!ATTLIST resource id ID #REQUIRED>
 ]>
 <resources path="Media/"> 
 	<resource id="D_T34_1941_tank"  filename="kharkov_L1A/Extras/T34_1941_tank_destroyed.x" />
 	<resource id="T34_1941_body_destroyed.dds"  filename="kharkov_L1A/Extras/T34_1941_body_destroyed_summer.dds" />
 	<resource id="T34_1941_tread_destroyed.dds"  filename="kharkov_L1A/Extras/T34_1941_tread_destroyed_summer.dds" />
 </resources>
 

The first bit is the xml schema for integrity purposes. You could leave this out if you wanted.

<resources path="Media/"> tells us where the root path of the asests are
<resource id ="..." filename="..."> define the link between the in-game id and the actual location of that asset.

Notice how you need to define both the mesh (.X) elements and the texture (.DDS) elements

So we need to write our own custom media.xml for the Colo_River map referencing our new work. To do this it should look like this

Code: Select all

 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE resources [
 <!ELEMENT resources ANY> 
 <!ELEMENT resource ANY> 
 <!ATTLIST resource id ID #REQUIRED>
 ]>
 <resources path="Media/">
   <resource id="colo_terrain" filename="Colo_River/colo_terrain.x" />
   <resource id="colo_wall" filename="Colo_River/colo_wall.x" />
   <resource id="colo_water" filename="Colo_River/colo_water.x" />
   <resource id="colo_bridge" filename="Colo_River/colo_bridge.x" />
 </resources>
 

As I will be using texture defines which I will include in the main map scene file and I will be using pre-existing textures which have already been defined by the internal game library "media.xml" I won't need to include the texture links here.
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Stridor's Map Making Tutorial Part #3

Post by Stridor »

Now we need to write the map scene xml file itself. There is a special naming convention which must be followed for it to work. The name of a scene file must be of the form

"Map Directory"+"Scene.xml"

So for our example it will need to be: "Colo_RiverScene.xml"

Here is a beginning of the Scene.xml which you can use in your project (cut and paste into your scene xml file). This only includes the base textures, lighting and skyboxes. It doesn't have any placeables defined yet.

Code: Select all

 <?xml version="1.0"?>
 <scene xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <xFileNode isFacingCamera="false" clampingEnabled="false" isMapNode="true" cullingEnabled="true" zBufferEnabled="true" mediaId="colo_terrain" hasHeight="true" hasAlpha="false" referenceAlpha="1" buildingType="None" shadowType="ShadowMap" nodeId="1">
     <vector x="0" y="0" z="0" />
     <orientation yaw="0" pitch="0" roll="0" />
     <textures>
       <texture type="Diffuse" layer="0" mediaId="tiled_grass02.dds" tileX="48" tileY="48" rotationZ="-21" />
       <texture type="Mask" layer="1" mediaId="L1B_terrainFOREST.png" tileX="1" tileY="1" rotationZ="0" />
       <texture type="Diffuse" layer="2" mediaId="tiled_forest04.dds" tileX="84" tileY="84" rotationZ="21" />
     </textures>
     <children>
       <xFileNode isFacingCamera="false" clampingEnabled="false" isMapNode="true" cullingEnabled="true" zBufferEnabled="true" mediaId="colo_terrain" hasHeight="true" hasAlpha="false" referenceAlpha="1" buildingType="None" shadowType="None" nodeId="1">
         <vector x="0" y="0" z="0" />
         <orientation yaw="0" pitch="0" roll="0" />
         <textures>
 	<texture type="Diffuse" layer="0" mediaId="kharkov_road01.dds" tileX="48" tileY="48" rotationZ="-20" />
         <texture type="Mask" layer="1" mediaId="L1B_terrainROAD.png" tileX="1" tileY="1" rotationZ="0" />
         </textures>
       </xFileNode>
       <xFileNode isFacingCamera="false" clampingEnabled="false" isMapNode="false" cullingEnabled="true" zBufferEnabled="true" mediaId="colo_wall" hasHeight="false" hasAlpha="false" referenceAlpha="1" buildingType="None" shadowType="None" nodeId="1">
         <vector x="0" y="0" z="0" />
         <orientation yaw="0" pitch="0" roll="0" />
         <textures>
           <texture type="Diffuse" layer="0" mediaId="kharkov_road01.dds" tileX="50" tileY="5" rotationZ="-21" />
         </textures>
       </xFileNode>
       <xFileNode isFacingCamera="false" clampingEnabled="false" isMapNode="false" cullingEnabled="true" zBufferEnabled="true" mediaId="colo_water" hasHeight="false" hasAlpha="false" referenceAlpha="1" buildingType="None" shadowType="None" nodeId="1">
         <vector x="0" y="0" z="0" />
         <orientation yaw="0" pitch="0" roll="0" />
         <textures>
           <texture type="Diffuse" layer="0" mediaId="kharkov_stream01.dds" tileX="24" tileY="240" rotationZ="1" />
         </textures>
       </xFileNode>
       <xFileNode isFacingCamera="false" clampingEnabled="false" isMapNode="false" cullingEnabled="true" zBufferEnabled="true" mediaId="colo_bridge" hasHeight="true" hasAlpha="false" referenceAlpha="1" buildingType="None" shadowType="ShadowMap" nodeId="1">
         <vector x="0" y="0" z="0" />
         <orientation yaw="0" pitch="0" roll="0" />
         <textures />
       </xFileNode>
     </children>
   </xFileNode>
   <light globalAmbient="128" zFar="750" type="Directional">
     <vector x="-15" y="-15" z="0" />
     <diffuse a="255" r="255" g="255" b="255" />
     <ambient a="255" r="255" g="255" b="255" />
   </light>
   <skyBox>
     <north>kharkov_skybox2-north.dds</north>
     <east>kharkov_skybox2-east.dds</east>
     <south>kharkov_skybox2-south.dds</south>
     <west>kharkov_skybox2-west.dds</west>
     <top>kharkov_skybox2-south.dds</top>
     <bottom>kharkov_skybox2-south.dds</bottom>
   </skyBox>
 </scene>
 

I will go over what this all means in time. Now you have a base scene xml to work with you can start using the sceneedit program to see what your map looks like and start placing objects on it.

I "borrowed" some of the base textures and masks from another map so they are not final, they are just here to allow me to debug any mesh issues prior to moving on to the placeables.
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Stridor's Map Making Tutorial Part #3

Post by Stridor »

Ok now it is time to try out our new map in the game for the first time! To do this you will have to make a test scenario which uses your new map. The details on how to do this can be found in the game manual. It is a good idea to make a test scenario with some vehicles and infantry as you want to test out how they interact with the mesh. So that your scenario doesn't end too early, it is worthwhile placing a high value enemy victory flag with a weak infantry team off in one corner. This will allow you to move your forces around on the map without getting shot at! Don't kill that lone team protecting the flag or else your ride will be over real quick [:D]

So now load up your scenario in the game and admire your hard work [;)]

You need to test the interaction of the game units against the map. Things to look out for are:

1. Sharp elevation changes (drive your tanks over them, do they look natural)
2. Bridges (do your units move correctly over them)
3. River ford points (do your units go "under" water, check infantry mostly here)

In particular reference to point 1, there is a physic engine in PCK which handles how vehicles respond to terrain changes, so try driving them over bumps at rush speeds as this will best highlight any problems. In general the physics system works pretty well, but if you really make savage elevation changes then it can break the engine and you will get "floating" tanks. With a bit of experience you will know what constitutes a problem area and so can basically skip this section. In reality the elevation changes which press the engine to the limit are *not* areas which you would be moving tanks through anyway realistically. If you want to have really exotic elevation you can still have it, you will just need to use the correct color coding on the map.bmp to prevent tanks from entering. Infantry is not normally a problem, but you may also want to limit them from entering some more "challenging" terrain.

Bridges work ok:




Image
Attachments
ss34.jpg
ss34.jpg (119.25 KiB) Viewed 430 times
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Stridor's Map Making Tutorial Part #3

Post by Stridor »

River fording looks good:



Image
Attachments
ss35.jpg
ss35.jpg (94.19 KiB) Viewed 430 times
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Stridor's Map Making Tutorial Part #3

Post by Stridor »

I do intend to continue this tutorial at some point. Most of the map guys have already raced ahead and frankly if you are at this stage all you need do now is master the scenedit program the documentation for which can be found in your manuals folder in pdf format.
User avatar
Agrippa
Posts: 121
Joined: Fri Jan 20, 2006 12:26 am

RE: Stridor's Map Making Tutorial Part #3

Post by Agrippa »

I don't have the time currently to dable in the map editing, but I am impressed with what you are doing and look forward to giving it a try some time.&nbsp; Thanks[&o]
Salute,

Agrippa
Post Reply

Return to “Maps, Models and Mods”