I below present my recent work on TE. The confiuration files
This came quite recently, and i guess, requires discussion. But first.
The most quintessential object in any game is an entity (often called different names, such as game object etc). Entity is, in short, something in the game, that is not infrastructure to handle entities. For example - in TTD. Cargo is entity, locomotive is an entity, vehicle is an entity, piece of road is an entity, tree is an entit. But mouse cursor is not an entity, neither is icon or pixel
Config files are all about configuring and arranging entities. For now the configurable part is rather limited to setting static variable values, but in future will be extended to other things
Anyway. The syntax is as following.
The config files are tab delimited ASCII text files. Easily edited in a variety of spreadsheets - such as openoffice calc.
Config files are held in the $TE_DIR$/media/configs directory. Where each an every file will be treated as a potential config file. For the sake of convention i propose ".config" extension.
Comments are lines beginning with anything that is not a letter or a number of the english alphabet
first column is ignored (because explicit line numbers might be useful for some)
The file begins with a 'section' keyword followied with the name of the section later
Name of the section defines which objects will be configured in the section
(image will be inserted here)
Code: Select all
section tree section terrain
'default' value is just that, the field will contain a value string that reads 'default'. It is up to consumer of the data to decide what to do with it. Default value can be inserted explicitily with 'default' in a given cell.
Next lines, until next 'section' keyword contain entiries, where each line defines one entity type.
Several notes: entities are keyed by several importand global properties. Those are:
1. family - a TE equivalent of a 'set'. Families group several (hundread, thousand...) entities into one cohesive collection. Say - a temprate climate
2. name - an _unique_ identifier of the entity within a family
3. version - current version of the entity
if during the parsing the parser finds two entities in the same family, of the same name, then the parser will replace the older entity with the newer one, based on version. Otherwise it does so randomly.
Below - i attach an example of the config file.