[DD] Configuration

Development discussion about Transport Empire. Other discussion to General forum please.

Moderator: Transport Empire Moderators

Post Reply
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13189
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

[DD] Configuration

Post by Hyronymus » 19 Nov 2006 20:08

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: Select all

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.

User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Post by aarona » 20 Nov 2006 00:16

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?

User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13189
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus » 20 Nov 2006 07:11

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.

User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3602
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os » 20 Nov 2006 08:47

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

User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13189
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus » 20 Nov 2006 09:17

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: Select all

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);

User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3602
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Post by eis_os » 20 Nov 2006 10:26

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

User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13189
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Post by Hyronymus » 20 Nov 2006 11:10

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: Select all

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);

Post Reply

Return to “Transport Empire Development”

Who is online

Users browsing this forum: No registered users and 1 guest