   Basic networking question.
  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 serveror send possible next position  to server and see if you can move or not ?    
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 serveror 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.   ;Quote:Original post by AnntorYour 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?;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];Quote:Original post by AnntorUsing 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 :} 