Introduction
Hello. I have a few detailed questions about networking. I don’t expect them all to be answered in one post. Answering just one question, or sub-question, is fine. I may update this post if anything else that concerns me comes to mind. If I do update it, I’ll be sure to write a timestamp next to it.
Situation
These questions are in relation to Unity 5.3.3 Pro (I say Pro because some resources may come in handy here) and a Linux operating system - preferably Debian Wheezy.
Questions (all questions answered - new ideas posted here)
-
Should I split the chat server and game server to minimize lag and possible bottlenecking?
-
Will Unity3D properly make use of multiple cores naturally? Is there anything I need to do to aid Unity3D in utilizing difference cores for different operations? If the answer to both of these questions is no, then is it safe to assume that getting multiple servers with single cores, higher frequencies, and better cache is the better route to go?
-
Scenario - If the game were to, hypothetically speaking, achieve 10,000 players and the maps were big enough to spread them around so you don’t have 100 players in one spot:
A) Should I separate the map in to “network”-chunks and have a server for each “network”-chunk (visually the map will load in chunks on the client, but I’m referring to the network aspect at the moment)? To be more clear, rather than handling calculations and network transfer for every player on a single server, should I figure out some way to break up the work between different servers? If this is the case, what would be a theoretical method to achieve switching between servers seamlessly. I say “theoretical” because I can do research myself, I just need the general idea on how to go about doing it. Such as should the two server boxes have the same IP, different port, and then the client just connects to the second port when they enter the new chunk.
B) If I were to give up the server-authoritative scheme and let the client handle calculations (ultimately offloading processing power from the server), should I still separate the map in to “network”-chunks or is it safe to assume that a single server can handle simply sending packets (providing that the network allows it)?
timestamp: 6:30pm EST - 2/25/2016
I talked to Kennux for a bit and came to a conclusion about my server model. As an example, I have 10 instances of my game to break up the processing between 10 chunks. These instances go on one server box. In addition to that, I have 2 server boxes totaling 20 chunks / instances. In crontab, or whatever I may choose to use for startup commands, I tell it to run the game’s file 10 times. Every instance that starts begins to send packets every 10 - 60 seconds. These packets request instructions from a master server. When it finally get instructions from the master server it stops sending these packets. The master server then increments its online chunks parameter. Until there are 20 (max) chunks online, no players can join. The master server holds the server data (IP and port) and tells the player which server to join.
- There is something I have never understood how to efficiently accomplish. How would I prevent a player from hosting a “network”-chunk if they were to have a Linux OS? My previous networking project tried to attempt this by having a few checks: It checks that the host IP matches the subdomain of a website & that their is a file present with certain text present. I used PHP on the domain to also get the current IP of the host. This seems like a bit too much. Isn’t there an easier way to go about this? Especially since not all servers may have the same IP.