Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Addict

UDP Broadcast

This topic is 5212 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

Okay...I'm in charge of putting together our networking for our fps game. I've chosen to use UDP as the protocol, but I was wondering if I should just use UDP broadcasting as the means to update the world. There are going to be a significant amount of entities with a max of 4-8 players playing at one time (about 50 creatures in the world besides the players). We are going to have a central dedicated server to run the simulation and each client will run its own copy. Initially I was just thinking about doing a direct connect with each client and sending the data, but since I have so much to send, I was wondering if broadcasts would be okay. I have heard that its not a good idea to use broadcasts because it places a network load on all the machines on the lan you are broadcasting too. Oh...one other thing...I am still new to the entire network paradigm. I've set up a couple things like ping, but nothing on this scale and any tutorials that you have really enjoyed about UDP programming in Winsock would be appreciated. Thanks in Advance mmm...Coffee. Nectar of the Gods! [edited by - Addict on April 9, 2004 9:43:58 PM]

Share this post


Link to post
Share on other sites
Advertisement
Check out CodeProject code section for exmaples of winsock. Check out this website too.

http://www.tangentsoft.net/wskfaq/

Check out my website for more software development links.

http://www.dslextreme.com/users/kuphryn/links.html

As for network protocols, UDP is a very good solution for games. It is not as reliable and is not robust as TCP. However, one of its major benefit is a statically small header size (8 bytes) and is very fast. For games, it is okay to miss an incoming packet once every so often.

Kuphryn

Share this post


Link to post
Share on other sites
fyi....broadcasts will not go through a router
so unless you are only playing against other people on your own local network....broadcasts wont work.



"A soldier is a part of the 1% of the population that keeps the other 99% free" - Lt. Colonel Todd, 1/38th Infantry, Ft. Benning, GA

Share this post


Link to post
Share on other sites
Thanks guys...I''ve already read that winsock tutorial you posted kuphryn, but thanks for the link anyways.

One more question though...how many entities do you think i can reasonably manage using udp to make sure that all models are in synchronization? Maybe thats a bad way of putting it but assuming that i have so many random creatures that follow a set guideline with a random seed, excluding interactions with players its reasonable to assume that all the creatures are probably on the correct paths. I plan on still updating them though every so often and especially when they are close to a player.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

So how would you get the addresses of all the servers running your game out in internet-land if a broadcast packet won''t go past a router on your LAN? How do you get the addresses of servers running anywhere?

Share this post


Link to post
Share on other sites
They have to register with a known server that people connect to to download game lists. Or you have to have the user enter the address of the server.

Think about it - would you really expect every single broadcast UDP packet to go to however many million machines are on the Internet?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Of course not. But it has to be done somehow, right? Thats all that was being asked. Thanks!

Share this post


Link to post
Share on other sites

  • 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!