|Table of Contents|
|A brief introduction.|
|Pages you can print to help with making designs.|
|Description and links to the interactive editor BZEdit.|
|My code, if you know Microsoft's Visual Basic.|
|Trepan's code, similar in spirit to mine.|
|A brief note on world weapons (weapons as parts of the map.)|
|Discussion on the new features in BZFlag V.2.|
|Links to objects you may download and use in Version 2.|
It's a lot of fun to create maps after you've played awhile and you know what kinds of maps you enjoy. Here are a few tools and resources to help if you'd like to do it. Of course you don't really need any of these - just a simple text editor will do (at least before the complexity in Version 2). I'd suggest saving some of the maps you play on (while playing you hit Escape, Options, and the last choice is "Save World"), and you can see from the map files how things are done.
On the page with my maps I have a brief
section on what I think are good design principles; these are more things
that I've noticed on other peoples' maps that I like, rather than things that I
do all the time, but they might be worth a glance. One point to keep
firmly in mind: it's better to keep the block count down. In my experience
maps with 200 or so objects play very well, those with 400 or so play
reasonably, and at 600 or so I definitely notice some lag issues. Of
course this is highly subjective, and is dependent on my computer configuration,
network bandwidth, etc.; but it will affect how people view your map. To
give you a sense of what you can do, the turkey.moongroup MadCity (one of my
favorite maps) had something like 168 blocks: 88 boxes, 68 pyramids, and 12
Something pretty trivial, but still quite useful, is a simple map template: a paper grid on which you can draw the main features of a map, and figure out overall spacing issues and rough coordinates. You may download my template, either by clicking here for the .gif file, here for the .jpg file, or here for the .pdf file (the .pdf file is probably the cleanest; I did the original in Visio, using VBA to automate the creation of the template).
At the bottom of the sheet are a number of facts important to a designer,
such as the tank dimensions, barrel height, range of various weapons, etc.
Beware that a number of these things can be changed (overridden) by any
particular server, so at best these are guidelines.
I'd highly recommend that you get BZEdit for Windows, which is a very nice 3D editor for BZFlag worlds. You can get it from the sourceforge download page for BZFlag, http://sourceforge.net/project/showfiles.php?group_id=3248.
I almost always use it in conjunction with the code described below - I'll use the code to create a map, use BZEdit to look at it, and use the BZEdit tools to figure out how much I might have to move things to get them to be right; I then go back and change the code to be the way I want it.
It may seem like an odd style, but it works very well. Having all of
the changes I want made through the code makes the entire process more robust
- and later on I can move these blocks of code to other maps, or re-arrange
them inside one map, very easily.
I've written some code to help with map creation - for example, to construct towers with crenellations, or put an NCC 1701 starship in the sky. This is always under construction, but I thought I'd post a .zip file containing the Visual Basic (version 6) project and associated files. This should run under pretty much any modern version of Windows; I use it on Windows 2000.
The best way to try to use this is to open it up and look at the Script_<mapname> modules, each of which shows the calls used to create the relevant map. There is one form with a button for each map, which basically just calls the code in the Script_<mapname> module. When a map is created, two files show up: the map file (something.map), and a batch file to run it locally for testing (something.bat). I'd suggest glancing at this code, as you might want to change the bzfs defaults.
(The toolkit also has a parser, which will take a BZFlag map file and produce the code which may be used to write that file - a good way to get a handle on spatial idioms you might want to re-use, or to be able to extend an existing map).
I haven't spent time trying to document it, but it really isn't all that complicated (particularly if you've worked with Microsoft's Visual Basic). One thing I did after using it for a bit is to "queue" the object creation, and then spit it out later. I did this so that I could have code like:
box 0, 0, 0, ...
pyramid 10, 10, ...
place_component "Stonehenge", 100, 200, 45
the last statement putting an instance of Stonehenge at X=100, Y=200, Rotation=45 degrees. This is really useful when you want somewhat complicated structures, but don't want to have to figure out the angles and offsets of each substructure. The system works by saving away the queue of the objects in the component, and re-running this queue through the appropriate coordinate transformation when place_component is called.
Other minor notes: I run this from the directory C:\AA\BZFlag, so there
might be some dependencies on this (probably not, unless VB did it behind the
scenes). The files are here: MapGen Project
Another tool, quite excellent in my opinion, is BZMapper by Trepan (in
C++). It is in some ways oddly similar to my Visual Basic toolkit, but I
think it's more robust around the edges, and has some very nice additional
objects. You can get to it from his page at http://members.rogers.com/trepan/.
Every time I turn around it seems there is something new in the map format which may be used; for instance, World Weapons - these are weapons which basically the map fires at intervals. Take a look at trepan's page on them here: http://members.rogers.com/trepan/weapons.html
Trepan sent me some example map file text illustrating the creation of world weapons:
# Note that the SB will first shoot 2 seconds
# after you start BZFS, and that the SW will
# first shoot 1 second after that.
position 0 0 0
rotation 45 # direction to shoot
type SB # Super Bullet
initdelay 2 # delay before the first shot
delay 1 2 # list of delays to cycle through
position 100 0 0
rotation 45 # doesn't matter for shock wave
type SW # Shock Wave
initdelay 3 # delay before the first shot
delay 2 6 # list of delays to cycle through
Version 2 has introduced many new features for the mapmaker. I've started a Wiki page on Version 2 Mapmaking, which you may find at http://bzflag.org/wiki/MapMaking. Please feel free to augment it as you figure things out - the idea is for it to be a collaborative page that gradually accumulates the collective wisdom of map designers.
I've personally found that the Version 2 features may be used to make more visually appealing maps, but there isn't much in Version 2 that really changes play style or tactics. Objects (blocks, etc.) may have attached physics drivers, so when you touch them something happens, but that's probably the biggest substantive change.
In my Visual Basic project, I have functions that write out some of the Version 2 objects; I can set a flag to generate a Version 1 map, and these functions will put out some simple approximation of the Version 2 items (that is, something of roughly the same size in the same place). The reason for this is that I can then use BZEdit to work on the relative positioning of objects; unfortunately BZEdit doesn't work directly on the Version 2 objects.
To really take advantage of the mesh possibilities, you either have to write code to produce meshes, or use a 3D modeling tool to create them. The http://my.bzflag.org/bb/ bulletin board has a number of articles on this topic.
Here is the Greek temple from my first V2 map, "Ionian Pathways": temple.bzw.