Initial parse of Sets/*.set

This commit is contained in:
2018-03-18 05:34:14 +00:00
parent 10e22d8428
commit f858c4ae2a
4 changed files with 214 additions and 1 deletions

77
doc/formats/sets.md Normal file
View File

@@ -0,0 +1,77 @@
# Set format information
`*.set` files seem to act as a palette of objects for a [`.map`](maps.md) file.
The map file loads a set, and can then reference objects by a small number.
Since a maximally-filled map file seems to be able to reference 91,000 * 4
objects, this is a necessary optimization for 1998-era hardware.
## Structure
These files are plain-text.
We handily have a `template.set`, which looks like:
```
set template
Defs
40 40 40 80
dirt
h_dirt
rocks
blank
blank
blank
blank
blank
blank
blank #
blank
blank
blank
blank
blank
blank
blank
blank
blank
# ...
```
The files are of varying lengths. `template.set` is 220 lines, `map10.set` only
83.
So it's a line-based format that goes:
* Set description
* Blank line (optional, missing in `GEN_JUN.set`, `GEN_WAS.set`, others)
* `Defs`
* Blank line
* 4 space-separated numbers, variable between sets
* At least one blank line, sometimes 2
* A list of object names, sometimes with # comments on the right hand side
* They all seem to end with a comment of some sort, e.g. `# meaningless comment`
Questions:
What are the `Defs` for? Is it `Defaults` or `Definitions`? The values are
quite variable between files.
Is whitespace significant in the list of objects? First assumption is no.
Is it a simple 0-indexed palette or do maps embed an absolute line number?
Do positions in the palette have special meaning? e.g. is a particular range
always reserved for walls?
Are there any special values that don't appear as files in the `Obj/` directory?
`blank.obj` exists, so I expect not.
Once the map format is fleshed out a little more, can investigate by creating a
map with a single object from the set in it and seeing what line that works out
to be.