Home
Screenshots
Downloads
Forums
Docs
Servers
Stats
IRC Chat
Mods

Special Special    Search Search    Login/Logout Login

Main Page » Definition Files
The defnmapname.xml file

Contents

Description

This is the file that defines the map, specifying the size, layout, starting positions of tanks, etc. Similar to the map's Texture File, you can optionally reference Ambient_Sound_Files, Boid_Files, Event_Files, Object_Placement_Files and Ship_Files through a defn file. Also, as of v41, you can reference the new Include_Files as well.

One of the best ways to understand this file is to refer to the exisiting ones in your scorched3d installation directory, and they can be found under data/landscapes/. They are generally named defnmapname.xml.


File Layout

The definition files should typically be located under your game installation's (or mod's) /data/landscapes folder, although you can put them anywhere you wish. They are usually named defnmapname.xml, where mapname is the name of the the map you're using it on, but again, its at your discretion whether or not to follow convention.

Here's an outline for what each defn file will look like:

<defn> This is the main node for a defn file. Every defn file must have this.

  ... Landscape size, roof/surround type, etc
  <tankstart type='...'>
     ... Player starting area defined here
  </tankstart>
  <heightmap type='...'> A heightmap type
     ... The heightmap's definitions
  </heightmap>
  
  Optional assets go here

</defn>


Example

Here's a detailed breakdown of all the stuff that can be found in a definition file.
Tag descriptions are in YELLOW.

<defn> This is the main node for a defn file. Every defn file must have this.

   <minplayers>#</minplayers>
           This is the minimum number of players allowed for this map.
           If there are fewer players than this value, the map will be skipped
   <maxplayers>#</maxplayers>
      This is the maximum number of players allowed for the map
   <landscapewidth>#</landscapewidth>
           This is the width of the map, ie: How large it will be in the game.
           Normal size is 256.
           Value must be divisible by 32.
           Keep in mind that 512x512 = 4x data sent to clients
   <landscapeheight>#</landscapeheight>
      * see landscapewidth above
   <surround type="generate">
           This is the type of surroundings around the map (Outside of the playing area).
           Can be none, generate, or heightmap. 
           See the Heightmaps section below for randomly generated maps, or Making a custom map
           for heightmaps for detailed descriptions
       <mask>data/landscapes/surround-mask.bmp</mask>
          A .bmp file showing where the level surround landscape should be
   </surround>
   <roof type="sky">
           Describes the roof of the map, giving the ability to make a cavern
           Can be sky, generate, or heightmap.
           See the Heightmaps section for detailed description about using heightmaps.
   </roof>

Tankstart

Required in every definition file, the tankstart section is where you define the area where tanks are allowed to spawn.

   <tankstart type="height">
       Describes the starting positions of the player tanks.
       <startcloseness>20</startcloseness>
          The minimum distance between tanks        
       <height><min>10</min><max>80</max></height>
          The minimum and maximum height that tanks will be placed at.
       <startmask>data/landscapes/startmask.bmp</startmask>
                 A .bmp file showing where tanks can and cannot be placed.
                 Black areas show where no tanks can start, white areas are places
                 that any tank can start, and red, blue, green, and yellow define where
                 teams of that colour can start.
   </tankstart>

Heightmaps

A heightmap describes the shape of the landscape, from its mountain peaks to it's craggy pools. There are currently two methods of defining a heightmap, generate and file.

Generate

The "generate" heightmap type is used to randomly create a new heightmap every time this landscape is loaded.

  <heightmap type="generate">
     <mask></mask>
               A .bmp file showing where Scorched3d should generate landscape. 
               White denotes areas that it should place landscape, black where it shouldn't.
               Leave the text blank to use the entire landscape
     <landhills>
        <min>120</min><max>180</max>
                  The number of hills to create.
                  The more hills the less space there will be between the mountains.
                  e.g. it will eventualy turn into a plateau.
     </landhills>
     <landheight>
        <min>30</min><max>40</max>
                  The height of the landscape.
                  The landscape will be scaled so the height is between these values.
     </landheight>
     <landpeakwidthx>
        <min>10</min><max>50</max>
           The width (from west to east) of each added hill
     </landpeakwidthx> 
     <landpeakwidthy>
        <min>-10</min><max>10</max>
           The height (from north to south) of each added hill
     </landpeakwidthy> 
     <landpeakheight>
        <min>0.5</min><max>1.5</max>
                  The height of each added hill.
                  Hills are added on top of each other so the overall landscape height
                  will get built up from this.
     </landpeakheight>
     <landsmoothing>0.04</landsmoothing>
             The amount of smoothing added to the landscape after all
             of the hills have been added. Larger numbers = smoother land.
     <levelsurround>true</levelsurround>
        Make sure the landscape surround (edges) are level with the water/surround map.
  </heightmap>

File

The "file" heightmap type is used to explicity describe the shape of the landscape using your own custom heightmap in the form of a Bitmap file. See Making a custom map for detailed help on file based maps.

  <heightmap type="file">
     <file>data/landscapes/apoccity.bmp</file>
        This is your heightmap file
     <levelsurround>true</levelsurround>
        Make sure the landscape surround (edges) are level with the water/surround map.
  </heightmap>

Optional Assets

Like a Texture File, you can reference any number of optional landscape files as you see fit. Being able to supply these in both the texture and the definition files allows for greater flexibility in constructing maps and reusing common landscape assets. Just make sure you don't accidentally reference the same thing in both places and wind up with twice as much of the stuff as you intended.

To reference any of the other types of landscape files, you will need to add includes.

   <includes> (Optional)
       <include>data/landscapes/myinclude-1.xml</include>
       Used to include any type of asset file.
       ...
       <include>data/landscapes/myinclude-n.xml</include>
   </includes>

Include files may be used to:-

</defn> Final, closing node for the defn file. Every defn file must have this.


More Info

Further information for defining maps can be found in the other landscape files. Happy modding!




Edit this pagePage historyWhat links hereRelated changes
Donate to Scorched3D Visit Scorched3D at SourceForge.net Get it from CNET Download.com! 5 Stars
© Copyright 2008 Gavin Camp. All Rights reserved.