PGD Home

P-0: Virtual World Concept: Update 5: Server Architecture

by on Feb.01, 2016, under Astral Realms, P-0, Servers and Networking, Spiritus Astrum

I have decided on my database and general server architecture for this project.

Torque has always had excellent network code, (and in fact, for a time the Torque Network Library was being sold as a standalone product) and generally the way networking works in a Torque game is that clients connect to a T3D gameserver by using a “master server” as a kind of directory lookup. This allows players to host their own servers, and other players to search for them using various search tags. The master server then returns a list of all of the (dedicated and non-dedicated) servers which match those search parameters.

For Astral Realms, which was basically the previous version of my virtual world concept, I used a slightly unusual setup for the game servers. Instead of connecting each client using T3D’s built-in multiplayer code, I instead set up each T3D client as a single-player client, with no networking. I then connected them to a complex Java server, which handled all of the object updates and synchronisation, and then send a list of objects to be rendered on screen to the clients. This list also included any other players in the area. The clients could also communicate with the database server using torquescript calls (although, for security and licensing, all of the actual SQL calls were done from the server-side, not the client). This system worked remarkably well, even with other players on screen. It was simple and easy to make changes to it, since I had developed it myself, and I knew the system well, and it was optimised for the type of project that I was working on.

The main reason why I used a Java game server and not a T3D based dedicated server was that I wanted to be able to connect to the game from other platforms. For example, I had a telnet client running that could access the java server, and interact with the game using text commands. I even printed out an ascii art map of the level with different types of objects represented by different letters, it was a great system. The idea was to try to integrate the virtual world with the real world as much as possible, and with a separate Java server, any device could interact with the virtual world, whether it is a smart phone, a computer with limited hardware, a web browser, etc etc.

I strongly considered using the same type of system for this project, since this project is essentially the next in a line of Virtual World type concepts, that all tie in to the same overall goal. However, with the previous virtual world concept, I focused more on the world building and object creation. I had a very complex system to model climate, zone-based object placement, etc (which I will also need in my current system) and the player was given tools to build structures. The system was designed for static objects, which wouldn’t require high-speed updates.

My current system, however, will focus much more on both social interaction (between human and AI players) and world interaction (interacting with flora and fauna, etc). This will require a network capable of handling fast object position updates. Consider hunting for example, if the player fires an arrow, or throws a spear, it’s position and velocity will need to be very precisely modelled in order to hit an animal. If the server lags even slightly, the system won’t work. Interaction between players, even though it will be quite rare (players will begin in a random location on their own, and may not meet other players for some time) will need accurate position updates to work properly. Visible lag will not be tolerable. I am also not really interested in developing browser based or mobile phone based plugins for this project, so I intend to use a T3D game server, which will connect to a mySQL database on another machine.

Since this is a persistent world game, there will only be one server (or one network of servers) so I shouldn’t need the master server either, but I may need to include it anyway if removing it proved to be more trouble than it’s worth.



Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!