• Welcome to AtomicTorch Studio Forums.
 

Some questions about the Server-side for multiplayer

Started by spadefoot, May 02, 2014, 07:54:45 AM

spadefoot

I've set up a little server for multiplayer and I have a few questions, and maybe some suggestions about documentation:

q's:
1) Is the server multi-threaded? I'm trying to figure out if adding vCPU's to the server instance will be of more benefit than trying to get more MHz on a single core. Right now, with 1 vCPU it very quickly hist 100% CPU with 2 pirates and 1 player on the screen.

2) Any time I fly quickly for more than a few seconds, or if I am in combat, the game quickly starts to frame skip. Watching the server-side CPU, it will get maxed if there are 2 pirates on the screen, but doesn't seem to be maxed at the other times where frame-skipping happens.

3) On the server config wiki, there is mention of being able to edit the config file, which is nice, but the options aren't really documented. The in-line notes in the config file help, but they don't really give enough info on what the options mean. In particular, the public/private option needs additional documentation. If I want to run a private server, how do I determine who can and cannot join? It references a whitelist, but I don't see anything about where/how to set up the whitelist.

Suggestion's

1) The Wiki indicates CLI options are in the "-option" format, but when you run the server cli, with options, like "-new" it brings up a second line for you to specify options. It works OK, but it's a little confusing, and might be hard to write scripts with that pause in there.

2) The network port isn't documented, that I could find. It's in the .XML file, but I couldn't find any mention in the actual documentation. 

Thanks for a neat game, keep up the good work, please!

DLirry

Hmmm, okay, here are some thoughts and suggestons:

1. Server is partially multi-threaded, but not scalable =) That's because physics library, which we are using, is not fully muti-threaded. And there's pretty much nothing we can do about it right now, sorry.
Next thing is server doesn't actually depend on what you see on screen. Server process whole system, every system is a separate physics world, so there's no dependency on what's on screen, only on how many ships are there in system.
Next thing is 100% CPU, which is not so good. Even on our test machines we get maximum 10% (usually 1-2%). I can't tell for sure, but maybe your server configuration is not enough for VoidExpanse? You see, we use extensive scripting, scriptable physics and effects, and it bites performance pretty much. So, any low-end computer won't do as a server in this particular case.
What is the configuration of your server?

2. No surprise the game is lagging, if server-side CPU is maxing. But, maybe, there are another reasons for that, like client-side lagging, network lagging etc. But this matter we will investigate.

3. I've just added information about whitelist and blacklist here: http://wiki.atomictorch.com/VoidExpanse/Server_setup
Thanks for your notice!

We will try to improve performance as much as possible in future releases, thanks for your feedback!
Doubting yourself is the only path to perfection

spadefoot

Thanks for the quick reply!

I'm using the Amazon EC2 (Elastic Compute Cloud) to set up the server, so the exact specs are a little tricky to define. Through some experimentation yesterday evening, I found that the M3.Medium (1vCPU 3 ECU 3.75GB RAM 1x4SSD, Windows Server 2012) seemed to be the minimum instance that would support reasonable multiplayer (well, actually one person, but playing on a server). Ping times to that EC2 instance tended to run in the  125-135ms range, which is on the high side of ideal, certainly. How sensitive is this game to lag/ping times?

retropert

I am working with spadefoot some on this project and wanted to add a little more information.

I rolled my own ubuntu virtual machine. We were able to get reasonable 2 player (we did not test it very long) game play off a single core 3GHz with 1GB memory located off-site for both users but running an a standard cable internet connection.

One note on the documentation:
In the section about launching with Mono, I think you meant to have the mono.exe listed.

mono AtomicTorch.SpaceRPG.Server.RuntimeMono.exe

I am really liking what you have done with this game.

ai_enabled

The game server should run pretty fast on a such hardware. But we noticed sometimes it performs badly on a VDS/VPS, but runs great on a real hardware, not virtual machine. It's seems to be related to how virtual machines handles the OS timer.

Could you do a small test please?

  • connect to your server and start playing;
  • toggle console ('~' as usual) and enter command "debug on" (without quotes) and press Enter key; toggle console again;
  • press F9 to toggle the Debug View display;
  • play for a while and make a screenshot for us.
Regards!


ai_enabled

#6
Thank you! As I can see the server runs pretty fast on your hardware - total frame update ("total_ms") takes <2 ms. We need to start worry only if it go higher than desired frame length (16.67 ms). So server is not lagging and fast enough at least for 5-10 simultaneously connected players.
What's wrong I found - the client seems to incorrectly calculate the interpolation time (required to smoothly play on the server). Please send me the output_log file from client for more investigation of this issue.
As a workaround, please try to manually increase interpolation time - console command "set_interp_time 100" or even "set_interp_time 150" should be enough. Look on the stat report "interp_lag_avg_ms" - when it's higher than +30 or +40 the client will run smooth without any glitches (but further increase will also increase overall client lag - game will run smoothly, but rendering will go with a noticeable delay to the server).

retropert