It’s been awhile since we’ve done a tech blog, so I decided to write about what you can expect from our Phase 2 Multiplayer: Dedicated Server. I’ll even post some super high-definition renders of the advanced console interface that Josh (@JoshuaBrookover) has been working on!
So what do we mean when we say “Dedicated Server”? We already have the ability to host servers now, right? While we do have the ability to host servers now, the person hosting must be a player in the game and also be running the full version of the game in order to allow players to connect. This makes it very problematic to host a stand-alone server on a computer and just have clients connect at their leisure.
When we say “Dedicated Server” we are referring to the game running in a much reduced form (no graphics, gui, sounds, etc) than needed when actually playing the game as a seed in the world. The dedicated server is a stand-alone application that manages only what is necessary to maintain the state of the game, but does not process any systems that only a player would need. One of the biggest things we gain from this is that it will allow player count on a server to increase! This is the dedicated server:
(Figure 1: Server running and ready to be used, work in progress)
The dedicated server does not create a standard window like you’d expect with most of your programs, but runs as a console program. No graphics libraries are loaded or utilized; it doesn’t play any sounds, and there is no server player.
We use a console library called PDCurses to give us a clean-cut interactive console at runtime. It has an input area for the server owner to type commands, as well as some advanced stats across the top so at a glance you see what’s going on with your server. Each statistics box can be changed to show any other stat.
(Figure 2: Shows command input and statistic changes, work in progress)
This console will provide a lot of useful information, showing when a player joins/leaves, viewing the in-game chat, and seeing any useful debugging or warning information from the engine or Lua.
Logging is a large part of running your own server that you aren’t always keeping an eye on. Everything from system information to chat messages that pop up in the console will also be logged to a file that is specified by your configuration file. This log can provide very useful information to server owners allowing them to diagnose problems or view player’s chat logs.
So what does the dedicated server give us? With the dedicated server, a player can run a TUG server with their own hardware or service. This also gives hosting companies the ability to host game servers for the public. The dedicated server is completely configurable from a single file that allows whomever is hosting the TUG server to specify information such as number of players, maximum allowed view distance, networking ports and other useful configuration parameters as seen in the image below:
(Figure 3: Dedicated Server Configuration File, work in progress)
Our hope is that we can give any server host the ability to run TUG servers, and as we continue to improve on the Eternus Engine and TUG, be able to give them more and more capabilities with their game!
Keep in mind that we are still working on the dedicated server and we may choose to add or change some features that are seen here as we develop further. There is still a lot to do! Feel free to follow me on twitter @camfergusondfw or stop by our forums to ask any questions you may have about the dedicated server!