Free Hero Mesh

Artifact [cd5cc8bd52]
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Artifact cd5cc8bd5299d24fac4105a4b5bc6307d6aac7cc:

Wiki page [Level file format] by zzo38 on 2018-08-12 23:56:01.
D 2018-08-12T23:56:01.205
L Level\sfile\sformat
U zzo38
W 1547
This document describes the file format for level files. The .level file is a Hamster archive, containing lumps <tt>CLASS.DEF</tt>, <tt>*.LVL</tt>, and <tt>LEVEL.IDX</tt>. All numbers (except the lump sizes) are small-endian.

<h2>CLASS.DEF</h2>
This lump consists of two parts, which are the list of classes and list of user messages; two zero bytes come after the list of classes before the list of user messages.

Each part consists of zero or more records concatenated together. Each record consists of a 16-bit number and then a null-terminated string.

The class section has class numbers (minimum 1) and class names (without the <tt>$</tt> prefix). The user message section has user message numbers (minimum 256) and user message names (without the <tt>#</tt> prefix).

This data is used to determine what class/message the level data refers to, since reordering them in the class definition file may cause them to be internally renumbered, so in this way, first the CLASS.DEF lump is read in order to define the numbers before reading the class definition file, so only the class names that aren't mentioned in the level file will be auto-numbered, and then recorded in the CLASS.DEF lump once an object of that class is added to a level using the level editor.

<h2>*.LVL</h2>
The lump name starts with the zero-based ID number (instead of an asterisk), which must be from 0 to 65535.

(TODO)

<h2>LEVEL.IDX</h2>
This lump contains a series of 16-bit numbers, which are the ID numbers of the levels, in the display order.
Z 2d0eb2711507311bb05ae918797007bd