Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (780)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (857)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Handling both UDP and TCP input. Multithreading?  (Read 15972 times)
0 Members and 1 Guest are viewing this topic.
Offline shadowstryker
« Reply #30 - Posted 2015-05-28 16:45:39 »

None of this is what I made this thread for, but I'm just going to sit back and watch the show.  Smiley
Offline thedanisaur

JGO Knight

Medals: 59

« Reply #31 - Posted 2015-05-28 16:59:27 »

**tries to prevent the thread from de-railing, makes it worse**

 Roll Eyes

Every village needs an idiot Cool
Offline theagentd
« Reply #32 - Posted 2015-05-28 18:36:34 »

@Soul Foam
You kind of prove my point. The fact that people have misconceptions concerning TCP is exactly why rolling UDP is usually a bad idea. Like Cas explained further, TCP has a shitload of stuff going on under the hood, and none of your arguments are actually valid. Unless you can actually prove that UDP provides better latency both on stable and unstable connections, I am sadly going to assume that TCP is superior to your UDP implementation. I don't mean to come off as hostile; your code might very well be equally good or even superior to TCP, or even simply good enough for your use case, and you should feel no pressure to change it. I am only saying that the burden of proof lies on your end to show that your implementation actually is superior. If you could, I would be extremely interested in seeing a benchmark/performance test comparing the two.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline shadowstryker
« Reply #33 - Posted 2015-05-29 05:34:36 »

ANYWAY, I've been doing some reading on TCP, UDP, and mixing the two. In your guys' opinion, for an MMO should I use TCP or UDP (it's evident that the two should not be mixed from what I have read)? The MMO will be similar to Runescape. Runescape uses TCP, but games like WoW use TCP and UDP, and many FPS games use just UDP. I don't know what to me out? Tongue

I know some advantages and disadvantages of both, so I'm really just looking for what you guys think/would do here.
Offline Husk

Senior Devvie

Medals: 20
Exp: 3 years

Want to learn everything.

« Reply #34 - Posted 2015-05-29 05:53:10 »

Having been a long time RuneScape player, I'd say there's certainly no need for UDP, ever so minor performance concerns aside. The game plays at a slow pace compared to other real time games, moving at a few tiles a second, performing 1-2 actions a second, and mostly staying confined to a small area.

Since you click where you want to move, you presumably only need to ensure that the position of that click, and the players current position arrives to the other players, and the movement can be done on the client. The server will need to of course correct paths under certain conditions. The order and correctness that actions occur is important though. Other than most animations, the other players need to see what you're doing, in order.

You generally won't find more than a handful of players in any one area too, except for certain events, in which performance is killed by other factors anyway.

Offline princec

« JGO Spiffy Duke »

Medals: 1064
Projects: 3
Exp: 20 years

Eh? Who? What? ... Me?

« Reply #35 - Posted 2015-05-29 07:45:47 »

The use of UDP is complex and I'd suggest only using it when you're doing realtime twitchy multiplayer stuff. Almost every other situation you're better off going with TCP.

Cas Smiley

Offline thedanisaur

JGO Knight

Medals: 59

« Reply #36 - Posted 2015-05-29 15:14:56 »

@shadowstryker OK, you can mix the two, it's just that you should keep the data separate. For example game update code UDP, messaging code TCP.

Now I would just recommend TCP.

1. Sometimes your game needs to send "must have" packets and rolling out both TCP and UDP takes more time that just implementing one or the other.
2. If you go UDP and it fails you're going to have a problem with something at some point.
3. For an MMO you don't need instant feedback like in say an RTS or FPS.

Don't get me wrong I used UDP for an instant messaging program (easy to write + just learning about UDP) so you could go UDP, but refer to #2.

If you're still unconvinced do some research on which types of games use which protocol. There will be some overlap I'm sure, but it will give you a good idea.

Every village needs an idiot Cool
Pages: 1 [2]
  ignore  |  Print  

hadezbladez (1165 views)
2018-11-16 13:46:03

hadezbladez (525 views)
2018-11-16 13:41:33

hadezbladez (1185 views)
2018-11-16 13:35:35

hadezbladez (272 views)
2018-11-16 13:32:03

EgonOlsen (2567 views)
2018-06-10 19:43:48

EgonOlsen (2786 views)
2018-06-10 19:43:44

EgonOlsen (1564 views)
2018-06-10 19:43:20

DesertCoockie (2268 views)
2018-05-13 18:23:11

nelsongames (2121 views)
2018-04-24 18:15:36

nelsongames (2815 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!