*cracks knuckles
Ok, as others have stated, an MMO isn’t 1 big server. They are multiple servers all handling different areas, or sometimes different tasks.
Commonly there is are seperate servers just for chat, another just for login, and then a bunch of smaller servers for each area in the game.
The individual zone servers are always crunching simple math. This monster moved here. That player got hit for x damage. They are simple math problems, but they are handling thousands at a time.
Chat is usually a seperate server because of filtering and logging. These operations are a tiny bit heavier than simple movement or combat equations, and chat has to be able to communicate with all the other servers as well in case one player whispers or shouts out to the whole game. So chat gets its own server.
Lastly is login. Login is separate because it does a LOT of heavy lifting, fairly slowly, and it is kept separate for security reasons too. Login must take the username/passwords of the players and authenticate them. Once that is done the login server goes to the database and requests all of that users data. Compared to the normal movement and combat network traffic normally sent between player and server, the login server is pulling hundreds of times more data at player login. Inventory, stats, location, buffs, pets, etc etc. And all of that is getting pulled from a SQL database, on a hard disk. So not only is this operation pulling way more data than normal, it is also pulling it from the slowest medium, physical disk. So the login server yanks all the newly logged in player data, bundles it all up into a player object and then passes that neat little package off to a world server and the player appears in the game.
There is also “interest management”. if Player A is 10 miles away from Player B, they don’t see each other, then there is no point in the server sending Player A the data on what Player B is doing. So the server isn’t sending everyone everyone else’s position and HP and whatnot, only the ones that matter.
Servers also run at a certain “tick rate”. Minecraft in particular runs 20 ticks per second. Meaning 20 times a second it calculates monster/player position, HP, actions, etc. 20 times a second for a server is pretty slow, so there is a fair amount of downtime between ticks. That downtime can be used for other operations, like batching player data for save operations to the database.
Modern SQL databases are multi threaded and can support dozens/hundreds of simultaneous connections. So having a few dozen zone servers all saving player data isn’t that big of a challenge to overcome.
This is a VERY dirty explanation of what is going on between player and server
Latest Answers