Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Aug 19, 2018 1:38 pm

All times are UTC




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Dec 18, 2008 1:14 am 
Offline
Transport Empire Moderator
Transport Empire Moderator
User avatar

Joined: Fri Jan 10, 2003 12:21 pm
Posts: 2129
Location: Wroclaw, Poland / Katowice, Poland
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:
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 270 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.
Top
   
PostPosted: Thu Dec 18, 2008 3:07 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 20, 2002 2:55 pm
Posts: 2743
Location: Georgia
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


Top
   
PostPosted: Fri Dec 19, 2008 10:08 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 30, 2002 5:10 pm
Posts: 6939
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.


Top
   
PostPosted: Tue Dec 30, 2008 1:29 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Aug 09, 2004 12:14 am
Posts: 1372
Location: Not over here
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?


Top
   
PostPosted: Tue Dec 30, 2008 1:37 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13177
Location: The Netherlands
What about a demo of how this works with the code you've written sofar?

_________________
Image
Dutch Trainset for OpenTTD | Dutch Trainset Topic | Combined Roadset v0.10


Top
   
PostPosted: Sat Jan 03, 2009 5:16 am 
Offline
Transport Empire Moderator
Transport Empire Moderator
User avatar

Joined: Fri Jan 10, 2003 12:21 pm
Posts: 2129
Location: Wroclaw, Poland / Katowice, Poland
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.

Quote:
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

Quote:
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.

Quote:
What if an industry has some alternative method of figuring out how and when to increase production?


Gameplay, not engine.

Quote:
What if some people manage to dream up different signals (including behavior)?


ditto

Quote:
How about vehicles which can only hold specific contents?


Rip off ECS. Problem solved

Quote:
Or trains (road or rail) which can only pull certain wagons?


Gameplay, not engine :)

Quote:
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 :)

Quote:
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.