Sending multiple paktes

Started by
4 comments, last by oliii 16 years, 6 months ago
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)
------------------------<< deltasoft games >>Homepage: http://www.deltasoftgames.ch
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.

Everything is better with Metal.

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
------------------------<< deltasoft games >>Homepage: http://www.deltasoftgames.ch
Multicast doesn't work over internet, only over properly configured LANs, and some dedicated connections.

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
------------------------<< deltasoft games >>Homepage: http://www.deltasoftgames.ch
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.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement