Gravity Beam Level Introduction Documentation

24th July 2012

Introducing your levels into Gravity Beam is super easy.


level_manufact

The purpose of the level_manufact directory is to convert the level 'source' files into the binary files directly usable by Gravity Beam.

The batch file makelevels.bat is provided to automate this process. If it is opened in a text editor, it shows how to convert the nine original November 2012 release Gravity Beam levels from their source forms to their final forms as they are found on the disk.

Source Files

The 'source' files are the more user-friendly .asm and .bin intermediate files produced in the previous stage. Each level has three 'source' files:

*_levelproperties.asm

This contains the level properties, such as name and time targets as a vasm-compatible data declaration block.

You're supposed to edit this file manually in a text editor.

The resulting data block is exactly 32 bytes long.

*_levelmap.asm

This contains the physical layout of the level as a vasm-compatible data declaration block, preceded by the starting position of the player, the box and the box destination.

You're supposed to copy this file from the output of json_to_ascii.htm.

The resulting data block is exactly 10024 bytes long.

*_polygonbinary_v2.bin

This contains the polygon binary data v2, as produced by polygoncollisionpreparer_v2.exe.

You're supposed to create this file by coping the ASCII polygon list output of json_to_ascii.htm into a text file, then use polygoncollisionpreparer_v2.exe to preprocess it and turn it into a binary block.

Final Form Level

The final form level files can be loaded directly by Gravity Beam. They should be placed in the levels/n/ folders relative to the game executable where n is a single digit level number from 1 to 9. A Gravity Beam compatible final form level has three parts:

levelproperties.bin

This is a binary-only version of the *_levelproperties.asm file. It is prepared by compiling *_levelproperties.asm with vasm using format flag -Fbin.

This file contains the level name and time targets only, allowing it to be loaded once at game start and used to display the statistics on the level select screen.

levelbinary.bin

This contains the physical layout of the level and the polygon binary data combined into one. It is produced by compiling *_levelmap.asm with -Fbin as above, and then appending the *_polygonbinary_v2.bin to the end.

This file contains information only needed when playing the level. It is loaded during the transition from level select to ingame, but only if you've selected a different level.

levelhighscore.bin

This contains the current high-scorer's name as a null terminated string within 16-bytes, followed by the best times of the 1st, 2nd, 3rd and 4th place players. levelhighscore_default.bin is included in this folder as an example of the highscore format.

This file is not optional; makelevels.bat copies levelhighscore_default.bin to all of the levels/n/ directories.

The default high-scorer's name is 'Hotshot', the closest thing to a callsign the overlynx player character from the game Interpose by Twilight Zone Software. Yeah, I said Gravity Beam was set in the 33rd century and 'humanity' is colonising Mars. WHAT A CONUNDRUM. It's a convenient name and it has an odd number of characters, so there. In-game, the default highscore pilot name is 'Jameson', from Elite.

Introducing levels to Gravity Beam

The entire contents of the levels/ directory represents the closest thing to a 'level pack' that Gravity Beam has. It stores the level layouts, time targets and highscores for a complete group of exactly nine levels. To play a different level pack, rename the levels directory to a temporary name and rename your new level pack directory as levels.