Page 1 of 1

Configuring transport empire

Posted: 18 Dec 2008 01:14
by uzurpator
Greetings.

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)

example:

Code: Select all

section tree
section terrain
Next non comment line contains a set of properties which we will set. These are strings. Property names cannot be used twice in the row. Their order does not matter. However their order will set how are columns in this section interpreted. Not all possible properties need to be listed (unlisted properties will get 'default' value). The section can list non existing properties as well.

'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.

Re: Configuring transport empire

Posted: 18 Dec 2008 15:07
by Lilman424
So with this, pretty much everything from graphics to production levels and vehicle statistics could be very simply tweaked, right?

Sounds good to me, from a user stand point.

Re: Configuring transport empire

Posted: 19 Dec 2008 10:08
by Arathorn
Looks good. I can't comment from a technical point of view since I don't know enough about that, but I like that everything is configurable.

Re: Configuring transport empire

Posted: 30 Dec 2008 13:29
by Expresso
What about conditional information?

Some examples in which it might be useful to include conditional information:
  • A vehicle built in say 1970 could have a different livery and/or different specs then the same type built in 1965.
  • Houses/industries should look different above the snow line and under water (perhaps).
  • Testing for which tile should look like what (dessert, snow for example).
  • Testing where you could build the specified tree (you won't find an oak above the snow-line or under water).
  • Testing for tile requirements for certain industries or houses.
Some of these might have a workaround available, but it's better to have a solution then a workaround. Isn't a simple scripting language a better idea? That language should be designed in such a way that as much as possible can be preprocessed to something directly usable to the engine (performance).

Animations stand to especially benefit from this, or is that going to be solved in a different way? How about effects in the surrounding environment? (polution, to name but one example).
What if an industry has some alternative method of figuring out how and when to increase production? What if some people manage to dream up different signals (including behavior)? How about vehicles which can only hold specific contents? Or trains (road or rail) which can only pull certain wagons?

Imho these questions need to be addressed before you continue on this path, it could save nightmares later on.

Oh, and what about translations?

Re: Configuring transport empire

Posted: 30 Dec 2008 13:37
by Hyronymus
What about a demo of how this works with the code you've written sofar?

Re: Configuring transport empire

Posted: 03 Jan 2009 05:16
by uzurpator
Expresso wrote:What about conditional information?

Some examples in which it might be useful to include conditional information:
  • A vehicle built in say 1970 could have a different livery and/or different specs then the same type built in 1965.
  • Houses/industries should look different above the snow line and under water (perhaps).
  • Testing for which tile should look like what (dessert, snow for example).
  • Testing where you could build the specified tree (you won't find an oak above the snow-line or under water).
  • Testing for tile requirements for certain industries or houses.
Some of these might have a workaround available, but it's better to have a solution then a workaround. Isn't a simple scripting language a better idea? That language should be designed in such a way that as much as possible can be preprocessed to something directly usable to the engine (performance).
Those are features of the game, not of the engine. But my approach is to first have soma basic functionality, then add features. Scripts, either as a c source or something else can be added as a param to the config file anyways. With time most of the game should have as much functionality exposed as possible.
Animations stand to especially benefit from this, or is that going to be solved in a different way?
I want assets to be as simple as possible at first. So no fancy skeletal animation at first. Once we have TTO-level gameplay possible, we can start adding eye-candy
How about effects in the surrounding environment? (polution, to name but one example).
Pollution is game, not engine. As for special-effects, I want to make a particle systems. But after TTO-level gameplay is possible.
What if an industry has some alternative method of figuring out how and when to increase production?
Gameplay, not engine.
What if some people manage to dream up different signals (including behavior)?
ditto
How about vehicles which can only hold specific contents?
Rip off ECS. Problem solved
Or trains (road or rail) which can only pull certain wagons?
Gameplay, not engine :)
Imho these questions need to be addressed before you continue on this path, it could save nightmares later on.
You can only improve upon existing. Since no game exists yet, it cannot be improved. So - first we should make an actual game :)
Oh, and what about translations?
String files - each text in the table is mapped into a string in a unicode, displaying what we want :)