Exporting components
and arenas for Robot Arena 2 (Design & Destroy).
This is the unofficial,
barebones, nitty-gritty, brass tacks of exporting stuff for Robot Arena 2. It's
completely unsupported, enter at your own risk, batteries not included, your
parents put it together, and good luck--cause it ain't easy.
Requirements:
You must have the following
in order for exporting to work:
- If you pirated the game,
go buy it.
- 3D Studio Max version
4.2
- Havok plugins for Max
(we used version 1.5.008, not sure if any others will or will not work)
- Our gmf exporter plugin
for Max. Download.
Optional are the
following:
- GMF Viewer. Download.
- MaxScript component helper
plugin. Download.
- Sample pack with some
existing components and an arena. Download.
Some documentation
we used internally that will help:
Tips, basic knowledge,
and random musings:
- I suggest you download
the sample pack and just try exporting one of the existing components or arenas.
Then slowly try tweaking various things to get an understanding of how it
works. Try moving the start points around, try changing the collision geometry,
etc. It's much easier to modify an existing file than it
is to create a new one from scratch.
- The GMF viewer must be
in a simple path, such as C:\gmfviewer. The gmf file you are viewing must
be in that same folder. Drag the gmf file onto the viewer exe. There must
be a folder called maps, where the textures can be found. This version of
the viewer does not work properly with lighting. If your scene has lights,
they will appear too bright in the scene. Best option is to export without
lights for this preview tool.
- Most objects have two
sets of geometry: one is the display mesh, which can be fairly high-poly and
has textures, etc; the other is the collision geometry, which is invisible
and should be low-poly since Havok uses this for detecting when objects collide
with one another. So, for example, a weapon might look very detailed with
intricate parts and pieces, but that's just the display mesh; the collision
mesh could be a simple box. Display and collision meshes must align properly,
so when they have the same transform (position, rotation, never use scale)
they appear in the same location and orientation. Set their pivot points to
be identical.
- The GMF exporter is a
max plugin found in the utility panel, not on the file-export menu. Only export
what is needed for the component or arena. The easiest way to do this is to
create selection-sets in Max, then use the "Export Selected" button.
- If a component appears
at an unexpected orientation, you probably forgot to reset it's transformation.
There's a handy max utility called "Reset XForm" which adds a modifier
to the stack that will reset the transform. I personally prefer to explicitly
manage pivot point positions and rotations rather than use modifiers.
- Textures must always
be square, in powers of 2 (64x64, 128x128, 256x256, etc). 3D Studio Max has
a million great features, most of which have nothing to do with a realtime
game and will never work. Don't get excited about a cool Max effect. You can
assign colors to objects, or solid textures (.bmp file) or alpha textures
(.tga file with alpha channel, put it in both diffuse and opacity maps). You
can also use reflection maps for special effects, but it's a bit tricky. Alpha
can be additive effect instead of normal alpha by checking the additive blending
radio button in the material editor.
- Arenas use Python to
script hazards and other events. With a little work, you could script some
really neat stuff.
- Remember that Havok is
a rigid body simulation and the geometry of objects never changes. You cannot
"crush" an object, for example in a giant hydraulic press. When
the chassis of the robot gets battered and bashed, this is a visual effect
that we did to fool you into thinking the bot is getting dented. The collision
geometry never changes, only the display mesh changes in response to physics
events.
- The AI bots need A* pathfinding
maps to find their way around the arenas. This is the .map file in the arena
folders. That's a discussion for another day.
- Cameras don't export
from the scene. In my example arena, I create them simply to get their positions
and orientation. They are written into the arena script.
- Shadow planes require
explicit scripting. Another discussion for another day.
Well, that's about all the
time I have for today. Sorry folks. Hope to add more later. Until then, you
clever hackers will probably figure out more about this stuff than I know.
Latest addition: An
open source project called PyRA2
has been started by a gaming community member, Martijn Pieters, to parse .bot
and .gmf files. It can export to VRML2 for viewing 3D files in a browser. It
also extracts the bitmap preview from .bot files. It's not been tested or supported
by our own development team, but it's worth checking out if you are interested
in other applications.
Perry Board
RA2 Game Designer