Dedicated Server Questions (Please help!)

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
arkmtech
Engineer
Engineer
Posts: 2
Joined: 16 Feb 2007 20:30
Location: Bozeman, MT
Contact:

Dedicated Server Questions (Please help!)

Post by arkmtech »

After a few hours of searching TT-Forums using both the forum search and Google, and haven't yet found an answer to these questions... :( So I'm thinking the answers are either painfully obvious and I'm dumb, or no one's asked these questions in a really long time. So, here goes!
  • How can I create an MOTD?
    I've created a 'scripts' sub-directory in my OpenTTD folder, and made the 'on_server_connect.scr' file complete with echo "Welcome to my server" and echoc red "Please follow the rules..." commands inside, yet my server seems to completely ignore it's presence.
  • How can I increase the maximum loan in multiplayer mode?
    I've searched exhaustively for information on changing the size of the loan, it's percentage, etc, and have yet to come up with the necessary console commands for changing the loan size.
  • How can I change the dates at which vehicles or rail-types become available?I found info on the data tables which hold these settings while browsing through http://docs.openttd.org - Best as I can tell, these settings only pertain to oTTD's source code, and cannot be modified in-game or using configuration files. (I'm hoping I'm wrong, though...)
All thoughts, flames, comments, help, and information are greatly appreciated - Thanks in advance! :D
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Re: Dedicated Server Questions (Please help!)

Post by Brianetta »

  • How can I create an MOTD?
    peter1138 can definitely help here, as he successfully got his server to run with a MOTD for new players using the kind of scripting method that you're using. I have a MOTD on my server, but it's provided by autopilot. autopilot is definitely a bonus for a dedicated server, but I don't want to look like I'm blowing my own trumpet - I did write the thing, so of course I'll say it's good.
  • How can I increase the maximum loan in multiplayer mode?
    This is a setting in your openttd.cfg file. Specifically, a part of the diff_custom line of that file. diff_custom is just about the only set of configuration options that cannot be changed from the console while the game is running.
  • How can I change the dates at which vehicles or rail-types become available?
    Use a newgrf. You can either use one of the many vehicle sets around the place, or you can read about newgrfs on the TTDPatch wiki if you want to make your own. The majority of vehicle NFO code is supported by OpenTTD, and that definitely includes introduction dates. Once you've looked at that documentation, there are many on this forum who can assist with the details and nuances. Bear in mind that any newgrfs used on your server must be available to your players before they are able to connect.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
arkmtech
Engineer
Engineer
Posts: 2
Joined: 16 Feb 2007 20:30
Location: Bozeman, MT
Contact:

Post by arkmtech »

Brianetta, you're godly mate - Thanks so much for the helpful advice. :D

Just a few more questions for you now...

In regards to the 'net_frame_freq' and 'net_sync_freq' properties...
  • Are there/what seem to be optimal settings for most servers? My server is a Pentium III 700MHz /w 256mb of RAM running at 40% CPU usage when running an OpenTTD server - I am also on a 800kb down/48kb up connection.
  • What other factors play a role in determining these?
  • Is there a method to calculate what settings will work best?
Again, many thanks for any information you can offer! :) I'll hopefully be contributing much of this to the OpenTTD.org Wiki within the next few hours...
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

net_frame_freq determines how fast the network heartbeat is, and net_sync_freq determines how frequently the server asks the clients for their random seed.

The heartbeat (which isn't the correct term, but will do for now) is, by default, sent once a frame. All the clients move the game forward one frame when they receive a heartbeat. This uses twice as much bandwidth as doing it every second frame, and allowing the clients to move two frames for every beat. That's the setting I use (net_frame_freq = 2). You can increase it, but the game gets laggier and laggier the higher a number you use.

The random seed is used to check that all the clients have the same game state. Unlike an FPS game, the game state in OpenTTD is huge, and cannot be easily shared. It gets shared when you join, and that's when you sit there looking at a progress bar. While the game is actually running, the entire game is simulated on all clients, and the server asks each client for its random seed from time to time. If the random seed of a client is different from the server's, then that client cannot have been running the game identically. That's called a desync, and the client is disconnected. net_syc_freq determines how often this seed check takes place.

There is no optimum setting as far as I know. I prefer setting net_frame_freq to 2 because it halfs the default bandwidth use with a negligible impact on game play, but apart from that it's a matter of trial and error. You can change these settings at run time, so it's easy enough to experiment.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: Bing [Bot] and 28 guests