Below is first a list of the currently available tags (some
familiarity with XML helps), then parts of a sample map, and finally
notes about planned features missing from the format.
(rest of file)
The map file should be inside this tag.
(all defined options here)
This tag should be the next after XPilotMap, and all option
definitions (see next tag) must be inside it.
Each defined option looks like this. See above.
Edgestyle defines a way for the client to draw lines.
id is the name used to refer to this style later when it's used (this
tag must appear before uses referring to it).
width is in pixels. 0 means the thinnest line the client can draw.
-1 means the polygon is normally filled and edges aren't drawn
separately, but if filling is turned off in the client it works like
width 0. Color is RGB in hex, 2 digits per component. Style allows
dashed etc lines (currently a number, probably will be changed to
symbolic later. 0 is normal line).
In addition to the styles defined with this tag, there's always a
special style with id "internal". This is used for edges where two
polygons or ends of one polygon join (for example, you can't construct
an 'O' shape with empty inside using polygons without joining them),
and such edges are considered "nonexistent" in some contexts. They are
not drawn by the client.
Bmpstyle defines a bitmap that can be used to fill polygons.
id like in edgestyle
filename is the client-side filename to get the picture from. There
is a mechanism that allows the client to download additional graphics
from the given URL.
scalable tells whether the bitmap changes size with scaleFactor.
Polystyle defines a way for the client to draw polygons.
id like in edgestyle.
color tells the inside color of the polygon.
defedge is the default style used for edges of a polygon using this
style, unless otherwise specified.
bmpstyle (optional) tells the texture used to fill this polygon.
flags tell whether the polygon is textured (if enabled in client), or
filled. Currently numeric, symbolic names later.
(edges)
Polygon with the first vertex at (x, y), with given Polystyle.
Complete shape is given by enclosed Offset tags (below).
What this polygon "means" (wall / ball target / etc) is determined by
enclosing tags.
Appears inside a Polygon tag. (x, y) gives offset from the PREVIOUS
point in the polygon. The last offset inside a polygon tag must return
to the starting point so that the polygon is closed.
style (optional) tells the edgestyle used from this edge ONWARDS. The
first edge (and onwards) is drawn with polygon->style->defedge-style
unless this attribute specifies otherwise.
(polygon(s))
The polygons inside this tag are sent to clients, but otherwise
ignored by the server.
(polygon(s))
The polygons inside this tag define an area where only balls can move.
All other objects and players crash into it like treasure boxes on
old-style maps. Has no effect whatsoever on balls. See Ball tag for
how to convert old-style treasure boxes.
(polygon(s))
The polygons inside this tag define an area where players of the given
team try to bring balls from opposing teams.
If a ball connected to or thrown by a player of the given team touches
this, the effects are like the treasure box on old-style maps. If the
ball was from the same team, it is "replaced" and returns to its
original position (NOTE: this can be far away). If the ball was from
an opposing team, it is destroyed.
This area has no effect whatsoever on players or objects other than
balls, or balls that were not last handled by the given team (this is
different from old-style servers, where throwing your ball into the
opponent's box makes it reappear at its initial position). See Ball
tag for how to convert old-style treasure boxes.
Starting position for a ball.
Ball appears here at the start of a round or when it is recreated
(like after crashing into a wall or player). This place must not be
on top of walls, but otherwise there are no limitations. However,
just placing it in an empty place can create weird effects since it
can reappear on top of a ship (and explode and then reappear again the
next frame if such collisions destroy balls). Placing the ball inside
a BallArea avoids such problems.
Several tags must be used together to create a treasure box similar to
old-style maps (a block where the ball is initially, which destroys
other objects and where enemy balls must be brought). Creating a
BallArea in the shape of the box creates the "destroy other things"
property. The ball can be placed in the box with a Ball tag. Finally,
creating a small BallTarget on top of the center of the box for the
same team that owns the ball allows cashing enemy balls and returning
their own ball. The target must be small because balls now hit things
with their edge instead of center; a target the size of the whole box
would be easier to hit than before.
Checkpoints for race mode. The route must be flown in the order they
appear in the file.
Refuel station.
The station does not affect things flying through it. If you want to
disallow that, create a wall and place the station on top of that.
If team (optional) is given, only players from that team can refuel
here.
Starting position for a player.
(x, y) are the coordinates of the ship's center.
team must be specified if team play is on.
dir is the initial direction of the ship, from 0 to 127. 0 is right,
32 up, 64 left, 96 down (intermediate values are legal).
Sample map:
Parts of a polygonized version of teamcup.xp2. Comments starting with
// have been added, and lines have been removed where mentioned.
// More options snipped
// the "xpbluehidden" style is used for normal walls. Because the
// walls have been defined as filled, we use width -1 here and
// the color parameter doesn't matter unless polygon filling has
// been turned off in the client.
// These yellow edges are thick (and would be drawn even around a
// possibly filled polygon).
// flags="1" means filled here... symbolic names later.
// This polygon is part of the normal walls.
// Just simple horizontal/vertical/diagonal edges in this polygon, since
// this map looks just like old bloods. Also, it doesn't have any
// specially marked edges with a different edgestyle.
// This last offset returns to the starting position of the polygon.
//More polygons representing normal walls snipped
// The polygon forming this BallTarget is placed inside the
// previous BallArea.
// Similar Ball/BallTarget/BallArea for team 2 snipped
// All bases face exactly upwards.
//More fuels snipped
// Last thing in the map.
This map is very close to the original teamcup.map. The biggest
mapformat-related difference is that throwing your ball into the
opponent's box doesn't reset it (it just goes through). Other
differences that are probably more important but aren't directly
caused by the map format change:
- The ball bounces from the edge instead of going partially on top of
walls and then bouncing from the center (this has been deliberately
changed in the collision code for polygons).
- Collision detection between bullets and ships doesn't become less
accurate when the ship has a wall behind it. (This change is mostly
unrelated to the change to polygons.)
Things planned but currently missing from the map format:
- Ability to customize more things locally. Things like bouncing
properties don't need to be identical for every edge in the map.
BallAreas could also have a choice between bouncing things and
destroying them.
- Maybe support more features from old-style maps. Item concentrators
would be trivial to add. Targets (with arbitrary shape) would take a
bit extra work, but they generally don't work too well from a
level-design standpoint on old levels - are they really wanted?
Implementing wormholes compatibly with old maps would be quite
difficult, but some kind of "teleporter" feature looks like a good
idea.
- Some more things, maybe added here later.