Sign in to follow this  
precious roy

Basic networking question.

Recommended Posts

precious roy    156
hey every one. I am very new to networking in games.. and I need a couple of pointers. i'm working on a simple rpg style Network game(mmo) just for fun and to learn how things work. I want the server to be able to presses up to 900 clients with ease. but I don't really know the right way to handle client. what would be better. control a character and send cords to server or send possible next position to server and see if you can move or not ?

Share this post


Link to post
Share on other sites
Anntor    254
Quote:
Original post by precious roy...I want the server to be able to presses up to 900 clients...
what would be better.
control a character and send cords to server
or send possible next position to server and see if you can move or not ?...


It depends on what you want.
If you want an easy implementation than do it like your first thought. The client computes all (positions, movement and collision check) and sends his result to the server, which in turn is just a relay to other clients.
But if you want an authorative server to prevent cheating (speed hack etc.), the server have to do all calculations itself, so you need to send your movement command without any position information (the server has to compute that for itself).

Your main problem with 900 clients will be bandwith consumption with each clients downstream (if 1 client receives position updates from your 899 other clients all at the same time). To overcome that limit you need to do "interest management", which will send information only to clients in need of it.

Share this post


Link to post
Share on other sites
precious roy    156
Quote:
Original post by Anntor
Your main problem with 900 clients will be bandwith consumption with each clients downstream (if 1 client receives position updates from your 899 other clients all at the same time). To overcome that limit you need to do "interest management", which will send information only to clients in need of it.


So if I understand this correctly. A server like wow uses would do all the collision detection. And send client info only of clients in range of the player? That sounds interesting, that is probably harder to make but in the end a lot mote hack proof?

Thanks that really helped! Gives me a lot of ideas.

Edit:
Now how would a server get client information… would he put all 900 clients in memory and that way presses their info, or would he directly save it in a database and if needed get the info from their?

Share this post


Link to post
Share on other sites
Anntor    254
Quote:
Original post by precious roy...A server like wow uses would do all the collision detection...

I don't know WoW in detail, but when i search for "WoW speed hack" and see the results listed at google, than that indicates that WoW doesn't do all movement checks server-side. Most probably something in between client-side calculation and server-side verification plus server-side tracking of possible cheating.

For example, the client calculates its own movement and position and sends that to the server. The server accepts that and relays it to other clients. But every 10th (+ random value) position package from client gets verified by the server (for that package it does plausability checks). If the server detects that it was a package with incorrect position updates (e.g. a speed hack replaced original calculated position with own position so it differs from the server side calculation), the client entity at the server gets a penalty. If that penalty exceeds a treshold, that client gets kicked from the server and banned. This way the server can unburden most of the calculation to the client but stays authorative over most of the clients actions (The client can still use a speed hack, but doesn't know which package gets checked by the server).


Quote:
Original post by precious roy...And send client info only of clients in range of the player?...

Most MMOs doing "interest management". Otherwise they couldn't be MMOs. ;-)

Quote:
Original post by precious roy...That sounds interesting, that is probably harder to make but in the end a lot mote hack proof?...

It's the only way to stay authorative as a server. You can't trust a client.

Quote:
Original post by precious roy...Now how would a server get client information… would he put all 900 clients in memory and that way presses their info, or would he directly save it in a database and if needed get the info from their?...


All stays in RAM (900 players should perfectly fit into your servers RAM; e.g. 1 MB data per player needs less than 1 GB RAM), because RAM is fast, fast, fast.
Storing at the database is just for persistence after you log out, or to save snapshots of clients/players current state in case of an unexpected server shutdown. Further direct database access is used for random stuff like auction house or quest texts, which doesn't need to be done 10 times every second for just one client.
Using just the database without precached player data in RAM would be a huge performance hit for any MMO, which needs to update player state a lot per second.

[Edited by - Anntor on May 6, 2010 7:00:14 AM]

Share this post


Link to post
Share on other sites
precious roy    156
Quote:
Original post by Anntor
Using just the database without precached player data in RAM would be a huge performance hit for any MMO, which needs to update player state a lot per second.


Well that actually sounds logical. Thanks for the info I think I will do some brainstorming on this. I will post my results. When I’m finished :}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this