Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Dec 17, 2018 4:06 am

All times are UTC




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
 Post subject: [DD] Configuration
PostPosted: Sun Nov 19, 2006 8:08 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
Configuration

Lua scripts stored and executed on the server side will configure the server. The syntax for the scripts is yet undetermined. A lua script may look like this:

Code:
local Train1 = AddTrain("Choo Choo", 1943, "choo choo.png");
   [name, year of availability, graphics]
DualHead(Train1, false);
   [Train1 isn't dual-headed, the default should be the same]

local Train2 = AddTrain("Zoof Zoof", 2005, "zoof zoof.png");
SetCargoTypes(Train2, "PASSENGERS & MAIL");
   [supported cargo types per vehicle, in this case passengers and mail]
SetCapacity(Train2, "PASSENGERS", 50);
   [cargo type capacity per vehicle]
SetCapacity(Train2, "MAIL", 10);



Question: server configuration is explained but how are single player games configured?

Only reply if you have a sensible solution please. Don't propose different configuration methods for servers either.

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


Top
   
 Post subject:
PostPosted: Mon Nov 20, 2006 12:16 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Fri May 26, 2006 3:54 pm
Posts: 221
Location: Perth, Australia
I got the impression that a single player game would be no different than a multiplayer game, that is, it still uses the multiplayer server/client. The difference would be that the server would be the localhost (with no external connections permitted).

Is this what you are looking for?


Top
   
 Post subject:
PostPosted: Mon Nov 20, 2006 7:11 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
In that case it might be better to rewrite this section entirely and include the way single and multiple player games are hosted. Currently that's not described anywhere in the DD but it would be a valid place to mention configuration of games.

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


Top
   
 Post subject:
PostPosted: Mon Nov 20, 2006 8:47 am 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Fri Mar 07, 2003 1:10 pm
Posts: 3602
Location: Germany
The example shows a configuration of objects in the game (we see trains), this should be same on the server and the client, regardless how it is handled after all ingame and what purpose the configuration has. Different formats on client and server are bad and should be avoided,

Configuration files for the server (even if it's local) and the client should be the same format, aswell the local client/server should use the same file for describeing how the game works.

This means the object the game uses, starting cash should be in a game config. Server passwords, ports should be in a seperate server config.

_________________
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...
Image


Top
   
 Post subject:
PostPosted: Mon Nov 20, 2006 9:17 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
But in all cases, whether it is a game or a server script, the script language/format is Lua. I suggest this edited text for the DD:


Game and server settings

Lua scripts are used to configure game and server settings. Game settings define specific settings that apply to one game only and can vary between different hosted games. Examples of game settings are starting year, map size, breakdowns etc. Server settings define settings that apply to every hosted game of Transport Empire, single player or multiplayer. Examples are server IP, screen resolution, maximum amount of layers etc.

The syntax of lua scripts is yet undetermined but might look as follows:
Code:
local Train1 = AddTrain("Choo Choo", 1943, "choo choo.png");
   [name, year of availability, graphics]
DualHead(Train1, false);
   [Train1 isn't dual-headed, the default should be the same]

local Train2 = AddTrain("Zoof Zoof", 2005, "zoof zoof.png");
SetCargoTypes(Train2, "PASSENGERS & MAIL");
   [supported cargo types per vehicle, in this case passengers and mail]
SetCapacity(Train2, "PASSENGERS", 50);
   [cargo type capacity per vehicle]
SetCapacity(Train2, "MAIL", 10);

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


Top
   
 Post subject:
PostPosted: Mon Nov 20, 2006 10:26 am 
Offline
TTDPatch Developer
TTDPatch Developer
User avatar

Joined: Fri Mar 07, 2003 1:10 pm
Posts: 3602
Location: Germany
The server shouldn't force the screen resolution!

Actually server settings may need to temporary overwrite the local settings for the player if they are mp game specific. You said the layer, I say the objects as example, or the company starting cash.

However the player should have control over his screen resolution, if he likes sound and heavy animations.

So I would say you have:
b) a local setting (screenresolutions, sounds, animations)
b) a game setting (prefered start year of the game, objects and co) The server uses this to send to the players so they have the same base
c) a server config for ip addresse, port, max players?

What happens if you join a mp game? You get the config from server and use it as temporary b). If you miss a object your lua can't load it and creates an error message.

What happens if you start a mp game? You will give all users your game config.

As usally it's one way of doing: If you like to have more game specific configs, like different sets, you can store several game configs. And if you start a mp game you can define what config you want to use.

If you want to share a savegame, you can put b) with no harm into the savegame which will be used temporary.

_________________
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...
Image


Top
   
 Post subject:
PostPosted: Mon Nov 20, 2006 11:10 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 03, 2002 10:36 am
Posts: 13179
Location: The Netherlands
OK, I revised it:


Game and server settings

Lua scripts are used to configure local, game and server settings. Local settings are settings that concern screen resolution, music volume etc. Game settings define specific settings that apply to one hosted game of Transport Empire only and can vary between different hosted games. Examples of game settings are starting year, map size, breakdowns, vehicle sets etc. Server settings define settings that apply to every hosted game of Transport Empire, single player or multiplayer. Examples are server IP, server port, maximum amount of players etc.

Game settings are accessed by the server for multiplayer games. This is to ensure that every player in a multiplayer game has the same game settings. I.e., a server using the New Zeland trainset will check if all players connecting to the server have this trainset in their game settings. If a player fails this check the player will not be allowed to connect to the server.

The syntax of lua scripts is yet undetermined but might look as follows:
Code:
local Train1 = AddTrain("Choo Choo", 1943, "choo choo.png");
   [name, year of availability, graphics]
DualHead(Train1, false);
   [Train1 isn't dual-headed, the default should be the same]

local Train2 = AddTrain("Zoof Zoof", 2005, "zoof zoof.png");
SetCargoTypes(Train2, "PASSENGERS & MAIL");
   [supported cargo types per vehicle, in this case passengers and mail]
SetCapacity(Train2, "PASSENGERS", 50);
   [cargo type capacity per vehicle]
SetCapacity(Train2, "MAIL", 10);

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


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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.