Skip to main content
GameDev.net gamedev.net
🔒 Locked

UDP and Network Game

Started by brwarner Jun 27, 2010 at 10:34 AM 0 replies 1.5k views
Original Post
brwarner
brwarner
I am trying to design my first real network game but I am having trouble designing it (the game is a 2D 2 player shooting game). I figure that I will use UDP due to the obvious speed benefits and so far I figured as well that the clients would continually send the commands the player is trying to do (move forward, shoot, turn, etc.) while the server will continuously transmit information such as the new position of moving objects but I have on problem.

Things like dynamic object creation and objects instantaneously changing state wouldn't work since in UDP packets may be lost, and since this isn't a continous movement like something moving forward, if the packet is lost the client may never know something changed.

Can anyone offer any advice or even ideas for how to design things differently?
rip-off
rip-off
You can use a reliable UDP protocol. There are many libraries that implement this (see the Multiplayer & Networking Forum FAQ for examples). This allows you to mark particular messages as important, and these will be re-sent until they arrive.

You could also look at Q12 in the FAQ in particular, which will give you much more detailed information about how you might design the networking portion of your game.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.