Skip to content

Instantly share code, notes, and snippets.

@PAndaContron
Last active December 24, 2017 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PAndaContron/f98389d1efcc8a3594dbbaf05167df3a to your computer and use it in GitHub Desktop.
Save PAndaContron/f98389d1efcc8a3594dbbaf05167df3a to your computer and use it in GitHub Desktop.
Feedback on the process of setting up a server

I tested setting up a Terasology server under several different conditions. First, I tried the normal way of running a server from the same computer as the client. Then I did a second test, where I ran a headless server on a separate computer. I also ran both going over LAN as well as WAN. For all tests, I used a relatively high-performance desktop and a low-performance laptop for the 2 clients.

The setup process was very simple for the standard scenario. I clicked “Host Game” on one computer, created a new world, added a couple modules, and it worked. Then joining the game from the other computer worked as well. I clicked “Join Game”, entered the IP address, and it connected. Setting up a headless server was relatively easy as well. I followed the instructions exactly as written on this guide and it worked with exactly the same results.

It didn’t really work perfectly on the first try though; there was one minor snag. For some reason, the default memory allocation on the laptop wasn’t enough and it kept crashing from running out of RAM. It worked fine after increasing the allocation slightly, but it’s very odd that this was necessary since the laptop was never running the server in any test and it runs single player just fine on default allocation. As far as I know, using it only as a client with the server on a separate computer should be less intensive since the laptop no longer has to perform much of the game logic on its own.

The biggest issue was the lag. For some reason, the framerate on both computers was so low playing the game was like trying to watch a slideshow. Even the text entry field for the chat wouldn’t render characters until several seconds after they had been typed. This doesn’t seem like something that would result out of a connectivity issue, since rendering frames and text entry fields are both typically done client side, and switching between LAN and WAN barely had any effect. Overall, it seems like there’s some kind of extra process only running during multiplayer which drains a lot of resources, probably more than necessary.

There was also a minor bug where players who log out will still be rendered in the same place as “ghosts”, even if they log in again. They do disappear eventually, but the effect seems to stack when you log in and out again and again.

With those problems aside, I think some improvements could be made to running a headless server. As far as I can tell, there is no way to adjust settings, modules, etc. for a headless server, and if there is it should be included on the guide on how to run a headless server. Assuming no such feature exists, I think it could be implemented as a config file, which would be created prior to the creation and given settings on what modules to include, what terrain generator to use, what gameplay engine to use, the name of the world to use, etc. This file would go in its own folder and it would be provided in the console as an argument when starting the server.

Image 1

Image 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment