Configuring transport empire

Discuss a Transport Tycoon-like game being programmed by forum users.

Moderator: Transport Empire Moderators

Post Reply
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Configuring transport empire

Post 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.
Attachments
default.config.txt
(971 Bytes) Downloaded 550 times
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
User avatar
Lilman424
Tycoon
Tycoon
Posts: 2743
Joined: 20 Oct 2002 14:55
Location: Georgia
Contact:

Re: Configuring transport empire

Post 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.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction. - Albert Einstein
User avatar
Arathorn
Tycoon
Tycoon
Posts: 6937
Joined: 30 Nov 2002 17:10

Re: Configuring transport empire

Post 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.
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: Configuring transport empire

Post 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?
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Configuring transport empire

Post by Hyronymus »

What about a demo of how this works with the code you've written sofar?
User avatar
uzurpator
Transport Empire Moderator
Transport Empire Moderator
Posts: 2178
Joined: 10 Jan 2003 12:21
Location: Katowice, Poland

Re: Configuring transport empire

Post 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 :)
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
Post Reply

Return to “General Transport Empire Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests