Would UDP or TCP be better for a multiplayer online game?
I dont know which to choose.
Thanks
Printable View
Would UDP or TCP be better for a multiplayer online game?
I dont know which to choose.
Thanks
hi
Coz I'm MCSE2000 , I can answer you :
if you have these two choices :
- UDP :provides an unreliable packet delivery on top of the IP protocol.
2-TCP : The Internet is based on TCP/IP.More reliable than UDP.
Where is the opponent ? in the same network or anywhere on the internet ?
If on the same network... you can try UDP, but UDP does not ensure the packet delivery... and you are linited to the size of the packet...
I would use TCP because the packet gets to the other computer for sure, and it does not matter where the computer is and how many networks the signal goes through...
well , my first post was general info just to get started .
Now that these two have given you the parameters of these two communication protocols which you probably found in MSDN help....
Almost all online multiplayer games use UDP to transfer in-game data. And in fact, DirectPlay uses it exclusively. TCP/IP connections may be used for initial connection to a server, to transmit player name and login/password...
If you play games alot, you'll notice sometimes people say,' I killed you, and you say, man you didnt even fire at me', well thats UDP... small overhead, less server resources, every grand once in a while, a packet gets lost, but its hell alot more reliable than MSDN would lead you to believe.
I'd use TCP.
You maintain a connection rather than do it on-the-fly.
Basically,
If your game is going to be serving more than 2-3 players, you should defintely use UDP...
1) it requires less bandwidth
2) it doesn't choke and sit retransmitting when a packet gets lost (because it doesn't care)....resulting in less latency...
Look at this, it should help you decide:
http://www.exhedra.com/DirectX4VB/Tu...P_Lesson01.asp
nemaroller is right. If you expect to have several people playing this game at the same time, you should use UDP..unless the game is something like Internet Poker or something..then use TCP/IP.
The major differences are the guarenteed packet delivery, and the connection itself.
With TCP/IP, packets are GUARENTEED to arrive. Therin lies the problem for games. That guarentee causes a TCP/IP connection to be slow.
With UDP, there is no connection. Period. UDP simply fires off packets, and hopes that A) The packets arrive, and B) The destination is actually waiting for packets. This means that the destination need not reply to those packets to say that they did or did not arrive correctly.
In the end, It all comes down to the game itself. Fast paced action games will want to use UDP, and slower, turn based games wll generally use TCP/IP.
And this thread doesnt belong in this forum.
Z.
To get this post answered , sure you have to get some info about DirectPlay since this concerns Online Gaming and stuff.
I suppose the best solution to my problem is to use UDP, with tagging system in the packets.
For the packets that must be recieved, it will send info back to say that the computer got it.
For other packets though.. it will not check.
That should work better then all TCP/IP
Right?
A better solution might be to keep a TCP/IP connection open for required packets, AND use UDP for the un-required packets. Writing your own guarentee system will be far slower then using the system built into TCP/IP.Quote:
Originally posted by Evan
I suppose the best solution to my problem is to use UDP, with tagging system in the packets.
For the packets that must be recieved, it will send info back to say that the computer got it.
For other packets though.. it will not check.
That should work better then all TCP/IP
Right?
Z.
Good idea!Quote:
Originally posted by Zaei
A better solution might be to keep a TCP/IP connection open for required packets, AND use UDP for the un-required packets. Writing your own guarentee system will be far slower then using the system built into TCP/IP.
Z.
Im VERY glad I asked. This is giving me alot of info.
So what ill do, is ill have 2 ports open... One for the Required,
one for the not...
Anything else i need to know?
I have a thought.
Would the TCP/IP latency really matter for a VB based game?
The latency of the connection wouldn't be a problem unless the game could achieve some killer framerates, and we all know for such things you'd need a C++ graphic engine, probably with some ASM too.
A game like Quake3, with 300 FPS, yeah latency is an issue, but on a game not even getting say 30 fps, what's the point? I'd pick stability over a small latency decrease.
My core engine IS C++ and ASM. And it runs about 60fps rendering 24 models with 3000 faces each.Quote:
Originally posted by DiGiTaIErRoR
I have a thought.
Would the TCP/IP latency really matter for a VB based game?
The latency of the connection wouldn't be a problem unless the game could achieve some killer framerates, and we all know for such things you'd need a C++ graphic engine, probably with some ASM too.
A game like Quake3, with 300 FPS, yeah latency is an issue, but on a game not even getting say 30 fps, what's the point? I'd pick stability over a small latency decrease.
=)
VB is just doing processing... no real calculations
Decent. Just this is General VB... so I assumed....Quote:
Originally posted by Evan
My core engine IS C++ and ASM. And it runs about 60fps rendering 24 models with 3000 faces each.
=)
VB is just doing processing... no real calculations
What's the game about, if you don't mind me asking.
Not at all...
This is something I wrote up a couple weeks ago.
Quote:
Based around pet grown, and character growth. IM going to include a huge database of all the 1000's of transformations of the different pets.
The idea is when you start growng a pet, depending on how much you feed him, and how much exp hes getting from the fights... he might transform into one of 3 or 6 new creatures. Some will be very rare and powerful as they get tword the top of the chart.
Fighting system will be simple. Some characters will have alchemy. Which will be the Direct Damage, Healing, Dots... ext. Others will be completely warrior types. The pets will all fight along side the character that they are attached to.
Im sure there will be people on my game that JUST grow and sell the pets. Being Im going to allow character to character trading of weapons, armor, items, and pets.
Now with the main idea explained. Im not going to focus to heavily on graphics. Im going to have one main look for each character, and when they switch weapons, the new weapon will appear. But as for Armor, there will be no appearence changes.
Posted Screen Shots:
http://www.vbforums.com/showthread.p...light=universe
http://www.vbforums.com/showthread.p...light=universe
http://www.vbforums.com/showthread.p...light=universe
Cool.
Can't wait to play it.
:cool:
did you DL that engine from PSC?
Naw. Its at www.TrueVision3d.ComQuote:
Originally posted by kleinma
did you DL that engine from PSC?
Very very good product. Forums are active. and Beta 3 is almost done, when that comes out ill start beta testing my game. )