-
Notifications
You must be signed in to change notification settings - Fork 21
Simulation Data Format
This document describes the world simulation data formats used in the original Vangers game.
Parser
class constructor defined in src/3d/3dgraph.cpp is responsible for opening all .prm/.lst files.
If first byte of a file is NULL, the file will be parsed as compressed and encrypted one.
There are 2 parsing methods which are used to process .prm/.lst.
Member functions of Parser
class defined in src/3d/3dgraph.cpp and src/3d/parser.h are responsible for this parsing.
Object::save_parameters()
and Object::global_save_parameter()
functions in src/3d/dynamics.cpp are responsible for editing values in common.prm and .prm files in resource/m3d/mechous.
Comments are not supported.
A file consists of keys and values.
The game searches for a key, processes one or more values after the key, then searches for the next key. Everything that doesn't match the next key is ignored.
The game accesses each key one by one. Order is important.
There are 3 value types: integer(get_int()
), double(get_double()
) and string(get_name()
). They are parsed differently.
Integer and double values must be separated from other elements by any whitespace characters as determined by isspace()
, string — by iswspace()
.
If string value contains spaces or tabs, it must be enclosed in double quotes.
Files parsed:
- jungle.lst
- device.lst
- game.lst
- common.prm
- .prm files in resource/m3d/mechous folder
- .lst files in thechain folder
PrmFile::init()
and PrmFile::getAtom()
functions defined in src/uvs/univang.cpp are responsible for this parsing.
Supports comments starting with /* and ending with */.
Set of any characters (even newlines and non-printable characters) enclosed in double quotes is an "atom".
Continuous set of characters which doesn't contain double quotes, spaces, commas, tabs, comments and newlines is an "atom".
For example, each letter is a separate "atom": "a"b/**/c,d f
.
The game accesses each "atom" one by one. Order is important.
Files parsed:
- worlds.prm
- escaves.prm
- spots.prm
- passages.prm
- bunches.prm
- vangers.prm
- item.prm
- car.prm
- price.prm
- crypt.prm - exists only in original version of Vangers
- tabutask.prm
- wrlds.dat