Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#24 Grouped map parser

Dave Rodgers

This is a C parser for BZFlag maps that enables
grouping. The parser is backwards compatible with
the map format used in 1.7g0, but adds a couple of
new keywords and some different link definition

Here are some of its capabilities:

1. Grouping
You can group a bunch of objects together, and then
instantiate any number of times in different positions,
sizes, and rotations. You can also flip groups along
any axis.

2. Nestled Grouping
Groups can contain other groups. This makes it really
easy to build relatively complicated patterns.

3. Easier Linking
Teleporters can now be called by name, rather then
counting the number of teleporters to find the right link
number. Teleporters within groups can also be accessed
from outside their group. Teleporters can automatically
be linked to other teleporters within their own group
during a group instantiation.

4. Team Colors
Team color names can be used with the base keyword.

Some example maps are included in the ZIP file.

I was thinking that this could be placed in the
bzflag/misc/ directory. Eventually, it would be nice
to incorporate this program (or something better), into
the bzfs front end.

Happy mappin',
Dave R (trepan).


  • Dave Rodgers
    Dave Rodgers

    • assigned_to: davidtrowbridge --> nobody
  • Dave Rodgers
    Dave Rodgers

    Logged In: YES

    Some small fixes

  • Dave Rodgers
    Dave Rodgers

    Logged In: YES

    This one is much better... :o)

    1. Arcs
    Added an ARC type, that creates arcs from boxes.
    With this, you can create squares, pentagons,
    hexagons, cogs, hockey rinks, etc...

    2. Variables
    Added variables, so that you can define your favorite
    building height once, and then use it through out the
    rest of the file

    3. Expressions
    Added expressions like (a+b*c+e) so that the variables
    can be better used. You can use this to increment and
    variable, etc...

    4. Trig functions
    For those fancy mappers, the basic trig functions have
    been implemented. They all work in degrees.

    5. Modularity
    Broke the main functions out of bzmapper.c so they it could
    be easily used as a front-end for other programs.

    6. Cleaned up some of the nastier code.

    Daver (trepan)

  • Dave Rodgers
    Dave Rodgers

    Logged In: YES

    Change is good...

    1. Include
    Added the "include" keyword. Files are directly loaded
    into the current working file, and so all variable changes
    they make or definitions that they create are applicable.
    A recursion check is performed before the file is loaded.

    2. Parser
    Fixed my stupid infix expression parser.

    3. Shortcuts
    Added some shorthand for the longer command names, ex:
    teleporter -> tele, position -> pos, etc... The long names still
    work just fine. I don't need the typing practice.

    4. Default Values
    Use the "global.h" file from the bzflag dist. to get the right
    default sizes for boxes, pyramids, etc...

    5. Statistics
    Count the objects, and report on each type.

    6. Default group names
    Changed the default group naming scheme to a little more
    useful. Now, they are named after the group definition, and
    a seperate count is kept for each type of group type.

    7. Sqrt
    (2^0.5) just looks silly, so sqrt() was added

    A couple of more touchups, and this thing is done like dinner.

    Daver. (trepan)

  • Dave Rodgers
    Dave Rodgers

    Logged In: YES

    Some more features:

    1. Holes
    I've wanted this one since my first try at mapping. You now
    cut several
    box shapes out a box object to make rooms, tunnels,
    dropshafts, etc...

    2. Repeat
    Added the repeat command once I realized how much fun the rand()
    function can be. It is also useful for making patterned
    shapes, when you
    use incrementing variables and the such.

    3. BZFS
    Attached a patch against bzfs to make it use the bzmapper
    functions. All
    you have to do is drop the bzmapper.cxx, parser.cxx,
    utils.cxx, and all of
    the *.h files into the bzfs directory, and apply the patch.

    The source and a win32 binary are available at:

    The source now contains a MS C++ project directory. You can
    just open
    the *.dsw file, and compile.


  • Dave Rodgers
    Dave Rodgers

    Logged In: YES

    forgot the return code part...

  • Dave Rodgers
    Dave Rodgers

    Logged In: YES

    This version (1.5) is very close to final. The files
    have been modified such that the load_map()
    function may be called any number of times.
    A few serious memory leaks were also fixed.
    Here are the notable additions:

    1. Error Reporting
    The error reporting is much better. The included
    list of filenames is dumped out for errors, even if
    the program has entered the post-parsing phase
    (source file and line is stored for each object).

    2. File Header
    Change it such that the program copies the header
    from the source world file instead of sticking its own
    into the output.

    3. %base
    Added an auto-increment variable for bases.

    4. Seed command
    Allow the user to set the seed for the ran() function.

    5. Functions
    Added the abs() and floor() functions.

    6. Constants
    Instead of using the "variable" keyword, you
    can now use "const". If you try to modify a
    const later in the file, bzmapper will notify you
    and end with an error message.

    Dave R.

    P.S. An updated *.exe file is available at:

  • Dave Rodgers
    Dave Rodgers

    Logged In: YES

    Version 1.6

    1. Text
    Added text objects. You can load your own font
    from a PSF file (a few are provided in the zip file).
    Text can either be layed flat on the ground, or
    tilted upright. A box minimization routine is run on
    the font to decrease the number of objects in the
    resulting map.

    2. Windows Compatibility
    Change the front-end of the program so that it
    accepts a single file name. If the filename ends
    with ".bzg", then that extension is replaced with
    ".bzw" for the output. If the filename doesn't end
    with ".bzg", ".bzw" is simply appended. If a
    second filename is given, that name is used for
    the output filename. This is good for single-click
    usage from a file browser.

    3. Cleanup
    Did some more code cleanup. Fixed the missing
    "return -1" code in the generate_object() function.
    Touched-up the example.bzg file.


    • labels: 371934 -->
  • Dave Rodgers
    Dave Rodgers

    Logged In: YES

    Version 1.8

    Here are some of the new features:

    1. BZFS 1.9 compatibility
    2. Mitered Paths and Steps
    3. 3D intersection detection functions/objects
    4. Automatic height sorting
    5. Improved flow control (while/repeat/if/else)
    6. Escape codes and sub-expression parsing
    7. Modification of existing objects
    8. Delete/Undelete of existing objects
    9. BZEdit32 compatible name comments
    10. Better debugging facilities (print command)


  • Dave Rodgers
    Dave Rodgers

    • status: open --> closed
  • Jeff Myers
    Jeff Myers

    • status: closed --> open
  • Jeff Myers
    Jeff Myers

    • status: open --> closed-rejected