How to create a GLtron level

Note: This is a preliminary draft and is subject to changes

The level format

A GLtron level consists of two mandatory files and an optional one:

Note: There are no restrictions for filenames of the 3d files, but in order to avoid name collisions, I strongly suggest you follow the level_name-floor/arena.obj naming convention.

How to create a 3d mesh for the floor in Blender

Note: This tutorial is based on the Windows Version of Blender 2.34, but other versions and platforms are *very* similiar (obvious difference: on OSX or Linux there's no c: drive).

Blender is a free and powerful 3d modelling package. Its user interface takes a bit to get used to, but if you pay attention to the many available tutorials at the Blender site, you'll find it actually very easy to use after a while.

You can create a very simple floor mesh using the following steps:

  1. Download and install Blender.
  2. Download this Wavefront OBJ export script and remember where you saved it.
  3. Start Blender. Blender will automatically create a simple scene which already contains a single quad.
  4. You can delete this quad by pressing 'x' and then enter.
  5. Add a new quad by pressing the space bar, and then choosing Add->Mesh->Plane from the popup menu.
  6. Since GLtron only accepts triangles, press 'ctrl-t' to convert the mesh into triangles.
  7. Press 'tab' to get back into blenders 'object mode'. The plane will turn purple.
  8. Press 'shift-F11' to call up blenders text window.
  9. Press 'alt-o' to call up blenders file browser and load the script you downloaded earlier.
  10. Press 'alt-p' to execute the export script.
  11. Change the filename from g:\tmp\test.obj to c:\test-floor.obj
  12. Click on 'export'.

Congratulations, you successfully built your first GLtron floor mesh. Open the file with e.g. Wordpad, it should look like this:

# Wavefront OBJ (1.0) exported by lynx's OBJ import/export script

# Meshname:	Plane
# Total number of Faces:	1
# Total number of Vertices:	4

o Plane

g Plane

v 1.0 0.999999940395 0.0
v 1.0 -1.0 0.0
v -1.00000011921 -0.999999821186 0.0
v -0.999999642372 1.00000035763 0.0
vn 0.0 0.0 1.0
vn 0.0 0.0 1.0
vn 0.0 0.0 1.0
vn 0.0 0.0 1.0
f 1//1 4//4 3//3 2//2 

That's it for the moment. I suggest you start learning Blender (or any other 3d modelling package that can (perhaps with the help of a plugin or external converter) write Wavefront .obj files, and go crazy! In the meantime, I'll try to finish this document.