This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "BZW"

From BZFlagWiki
Jump to: navigation, search
m (Object Types)
(Map Editors: improved wiki link)
 
(15 intermediate revisions by 6 users not shown)
Line 3: Line 3:
 
==Basic Format==
 
==Basic Format==
 
All structures in the BZW format are contained in this basic block structure
 
All structures in the BZW format are contained in this basic block structure
 
+
{|
      OJBECT_TYPE #comment
+
|
        KEY  VALUE
+
OBJECT_TYPE #comment
        KEY  VALUE
+
  KEY  VALUE
      end
+
  KEY  VALUE
 +
end
 +
|}
 
The object names are special keywords that are recognized by the BZW parser, unknown names will produce a warning at run time. Each object type has it's own subset of recognizedly keys and associated values, depending on what it does. All blocks must have an END statement to be valid.
 
The object names are special keywords that are recognized by the BZW parser, unknown names will produce a warning at run time. Each object type has it's own subset of recognizedly keys and associated values, depending on what it does. All blocks must have an END statement to be valid.
  
Line 17: Line 19:
  
 
Here is small example world:
 
Here is small example world:
      world  # simple world containing a box, pyramid, and mesh
+
{|
        name Simple World
+
|
        size 100.0
+
world  # simple world containing a box, pyramid, and mesh
      end
+
  name Simple World
      box
+
  size 100.0
        position -20 -20 0
+
end
        size 10 20 10
+
box
      end
+
  position -20 -20 0
      pyramid
+
  size 10 20 10
        position 20 20 0
+
end
        size 10 10 20
+
pyramid
      end
+
  position 20 20 0
      mesh
+
  size 10 10 20
        vertex -10 0 0
+
end
        vertex 10 0 0
+
mesh
        vertex 0 10 0
+
  vertex -10 0 0
        face
+
  vertex 10 0 0
        vertices 0 1 2
+
  vertex 0 10 0
        endface
+
  face
      end
+
  vertices 0 1 2
 
+
  endface
 +
end
 +
|}
 
==Object Types==
 
==Object Types==
The format of this text file consists of any number of objects listed in any order (except that physics, textureMatrix, dynamicColor, and material must come before they are referenced) separated by newlines and grouped into blocks of types.  
+
The format of this text file consists of any number of objects listed in any order (except that physics, textureMatrix, dynamicColor, and material must come before they are referenced) separated by newlines and grouped into blocks of types, and it is conventional (but not mandatory) that world, options and waterLevel will go at the top of files.  
 +
 
 
The list of world types consists of:
 
The list of world types consists of:
 +
 +
Headers:
 
*[[world (object)|world]]
 
*[[world (object)|world]]
 
*[[options (object)|options]]
 
*[[options (object)|options]]
 
*[[waterLevel]]
 
*[[waterLevel]]
*[[dynamicbolor]]
+
 
*[[texturematrix]]
+
Must be defined before being referenced:
 +
*[[dynamicColor]]
 +
*[[TextureMatrix|textureMatrix]]
 
*[[material]]
 
*[[material]]
 
*[[physics]]
 
*[[physics]]
 +
 +
Others:
 +
*[[arc]]
 +
*[[base]]
 +
*[[box]]
 +
*[[cone]]
 
*[[define]]
 
*[[define]]
 
*[[group]]
 
*[[group]]
*[[box]]
 
*[[pyramid]]
 
*[[teleporter]]
 
*[[base]]
 
 
*[[link]]
 
*[[link]]
 
*[[mesh]]
 
*[[mesh]]
 
*[[meshbox]]
 
*[[meshbox]]
 
*[[meshpyr]]
 
*[[meshpyr]]
 +
*[[pyramid]]
 +
*[[sphere]]
 +
*[[teleporter]]
 +
*[[tetra]]
 +
*[[weapon (object)|weapon]]
 +
*[[zone]]
  
 
==Map Usage==
 
==Map Usage==
Line 64: Line 81:
 
==Map Editors==
 
==Map Editors==
 
Several map editor applications exist and are commonly used to make complex maps.
 
Several map editor applications exist and are commonly used to make complex maps.
They are listed in the [[:Category:Map_editors|Map Editor Category]].
+
They are listed in the [[Comparison of map editors|comparison of map editors]] page.
 +
 
 +
[[Category:Map Making]]
  
[[Category:Map_making]]
+
==Man BZW==
 +
More detailed information on the specifics of the bzw file format is available in the [http://linux.die.net/man/5/bzw manpage].

Latest revision as of 21:22, 23 November 2016

The BZW format is used by BZFS to define the game world, or "map". This file is a plain text file that is loaded by the server application at start up and sent to each client when it joins the game. The map file contains a list of 3d world objects that populate the world, as well as optionally settings and options for the server to use when running.

Basic Format[edit]

All structures in the BZW format are contained in this basic block structure

OBJECT_TYPE #comment
  KEY  VALUE
  KEY  VALUE
end

The object names are special keywords that are recognized by the BZW parser, unknown names will produce a warning at run time. Each object type has it's own subset of recognizedly keys and associated values, depending on what it does. All blocks must have an END statement to be valid.

Words are defined in lowercase. Comments can be added to the file by preceding them with a # character. The comment will be in effect until the end of the line.

There is no set limit to the number of times you may use any of the objects except for the world, options, and waterLevel objects, they can only be specified once.

All distances in a map file are in world units and all angular values in are degrees.

Here is small example world:

world  # simple world containing a box, pyramid, and mesh
 name Simple World
 size 100.0
end
box
 position -20 -20 0
 size 10 20 10
end
pyramid
 position 20 20 0
 size 10 10 20
end
mesh
 vertex -10 0 0
 vertex 10 0 0
 vertex 0 10 0
 face
  vertices 0 1 2
 endface
end

Object Types[edit]

The format of this text file consists of any number of objects listed in any order (except that physics, textureMatrix, dynamicColor, and material must come before they are referenced) separated by newlines and grouped into blocks of types, and it is conventional (but not mandatory) that world, options and waterLevel will go at the top of files.

The list of world types consists of:

Headers:

Must be defined before being referenced:

Others:

Map Usage[edit]

Maps are loaded by BZFS at runtime. The most common way to load a map is with the -world command line option. Other methods involve plug-ins or scripts to automatically change or load the map.

Map Editors[edit]

Several map editor applications exist and are commonly used to make complex maps. They are listed in the comparison of map editors page.

Man BZW[edit]

More detailed information on the specifics of the bzw file format is available in the manpage.