How do MMOs work?

#1TrueKuPosted 4/7/2013 4:25:09 PM
Or a chat service?

Like MSN, so... each user sends something, do all messages go through Microsoft's servers which then sends it to the other end(s)? Or it is p2p?


For a real-time mmo game, how is data sent around?
Let's say you move a character, are you sending a packet for every single pixel the character moves? so move 1000 pixels, send 1000 packets.!?!?!! and then say there's 50 people on the same screen and everyones moving! then it's like 1000^50 = 1e+150 packets!!!
That's more bandwidth or something than in the universe or something?

That's totally wrong, so how's it done?

Are character positions sent p2p? or sent to the game server and then broadcasted to everyone else?

How often is player data sent to the game server? And is the data held in memory on the game server and then written to the DB periodically? How is that done? Like memcached, redis or something?

And then postgres, mysql, riak, cassandra?
---
Chief Scientician
#2OrangeWizardPosted 4/7/2013 5:18:53 PM
From: TrueKu | #001
For a real-time mmo game, how is data sent around?
Let's say you move a character, are you sending a packet for every single pixel the character moves? so move 1000 pixels, send 1000 packets.!?!?!!



Packets are sent every so often. Perhaps once every second. These packets are sent to the server, and then the information is retrieved by the players

On the client side, it reads the updated player positions/headings for each toon on the server, moves the characters, adds an animation so they aren't just sliding around, and faces them the appropriate direction, all using your hardware.

This is why whenever your internet connection dies, you see people running into walls, or off cliffs. Your client hasn't gotten an update yet, so it's just following the last set of instructions.

At least, that's what I've deduced.


How often is player data sent to the game server?


Every second to a few seconds.
When you desync from the server, you can usually tell how often you're supposed to get an update, because you might start rubber-banding at predictable intervals.
---
Trolling and making valid arguments are not mutually exclusive things.
#3nesisPosted 4/8/2013 8:46:19 AM
Most MMOs do only periodically save to a database, keeping everything in ram (memcache I think?) at other times. If imagine it'd be a similar generic solution that other high traffic online services experience.

I agree with OW that data is only sent periodically rather than per frame. Some games let you control the rate (eg, the hl2 engine), which confirms that as a good general strategy for reducing needed bandwidth. Player data is typically just interpolated between received packets, and occasionally results in the rubber banding he mentioned.

And in MSN, I'm pretty sure all data goes via Microsoft's servers. File transfers are a pain in the butt because of that.
---
|_|\\ ||'E_ I__|
|_|| \\|_S_S_|
#4UD4Posted 4/10/2013 4:56:23 PM
I remember that back before Live Messenger was a thing, sending a file was a direct process where you could log the other user's IP, regardless if you were sending or receiving. Messages were relayed through MS servers though.

It's VERY outdated info, but I'm 100% sure that at least back in those dark ages it was via direct connection.
---
(\(\ ~ Hardcore - We'll probably be modded for this...
(='.') ~ THIS ARE SERIOUS CHAT. I ARE SERIOUS ADMIN. ~ CJayC
#5OrangeWizardPosted 4/11/2013 9:13:22 PM
Also, about messengers IN mmos, they work independently of the game itself. They don't follow the same update schedule that the game does.
---
Trolling and making valid arguments are not mutually exclusive things.
#6MegidolaonPosted 4/16/2013 4:26:14 PM
Usually when people disconnect they just disappear (obviously).
Running into walls and standing still is lag cause their data is not updated fast enough for the game to display properly.
---
Setebos, Setebos, and Setebos! 'Thinketh, He dwelleth i' the cold o' the moon.
http://www.youtube.com/watch?v=zIjVvnO5lgM
#7scar the 1Posted 4/16/2013 10:43:47 PM
MSN is now Skype, and Skype is P2P.

As for MMOs, packages are sent all the time. I'd be very surprised if the traffic was one package per second. That sounds like it would be a very slow game.
---
Everything has an end, except for the sausage. It has two.