Jump to content
  • Advertisement
Sign in to follow this  
LPVOID_CH

Sending multiple paktes

This topic is 4014 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all i'm developing a mmo game engine. i have already implementet a basic version of the client and server, and it works fine. i'm looking for a way to manage pakages on the server. i only update the players which are in the same local area. i'm working with "area of interests". each player is tested against the players connected to the server. then i do a simple distance check. if a player is to far away from a other player, it is not updated (e.g. i dont send a paket to this player). but if there are many players in the same local area, i have to send to each player a update paket. for the same message i use each time the send() method for each player. this is my problem, because each paket causes overhead and uses bandwidth. i read a article about multicasting, where players can join multicast-groups and you have only to send the paked to the group. but i'm using RakNet, and there is no support for multicast groups. what would be your approach to send the same paket to multiple clients? and does anyone did this with RakNet? (for a few players it works fine with the send() method. but later in my mmo game, there will be hunderts of players, and if these players are in the same local area, there will be a lot of send() calls and i want to avoid this)

Share this post


Link to post
Share on other sites
Advertisement
Don't worry about the overhead. Just send the packet to each clients. That's what everybody does. I don't think Multicast is matured yet. UDP adds 8 bytes overhead (plus 20 or 40 for the IP). So in the end, the overhead is not that great.

Share this post


Link to post
Share on other sites
ok, i think that the UDP overhead isn't the problem. but whats about bandwidth? if, for example, there are 50 players around me, i have to send 50 times the same paket to each player. with multicast-groups, i would only send one paket, and the paket would be replicated by the routers.
is there no other soultion to avoid sending 50 times the same paket? and if there would be 200 players, this will cause a huge bandwith. is there a bandwith-friendly way with raknet to solve this problem?

thanks

Share this post


Link to post
Share on other sites

yes, i read somithing like that, that multicasting only works on a LAN. well, in that case it's the only solution to send the same paket to each player.

thanks for your suggestions

Share this post


Link to post
Share on other sites
Serving 200 player will require a fat pipe anyway. You are chasing a red herring. There are no viable alternatives as far as I know. If you do need to send a large packet to 200 players, fragment it to fit your bandwidth requirement and send it in chunks over time. If it's small things, do the maths and see if it is a problem at all. Or change your procedure.

And if Raknet is UDP, it will support broadcasts over the LAN. Create a broadcast socket and send your packet across the LAN to the broadcast address.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!