Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Plugins

UDP transfert protocol

ShiVa Plugin Development

UDP transfert protocol

Postby berdal84 » 05 Jan 2012, 23:58

Hello everybody,

For my multiplayer game MicroBattletank GENETIX I need to send data speeder than with the classical user.sendEvent who use the TCP/IP transfert protocol.
My problem is that with TCP the ping between the server and the client is around 100-80 ms
but it is too much because the objects in the scene move fast (missiles and tanks), so I have to decrease the ping. The solution is to build a UDP transfert protocol plugin for shiva.

Did someone know how to build this kind of plugin ?
I suppose I have to write it in C++ right ?
If you have any tips please post it here ^^

Thanks !!
User avatar
berdal84
Platinum Boarder
Platinum Boarder
 
Posts: 695

Re: UDP transfert protocol

Postby dreamora » 07 Jan 2012, 10:30

UDP has no impact on the ping only on the roundtrip time (latency), so if your physical ping is 100ms then it will remain 100ms even with UDP, the round trip time can only be lowered by allowing the networking to discard the packets.

And yes you would write any networking in C/C++, to my knowledge nobody has written a generic socket library yet though
I'm no stonetrip representative, just a happy board member like you :)

If you find my portfolio interesting, feel free to contact me or follow my shares on my twitter stream or my game development blog
User avatar
dreamora
Platinum Boarder
Platinum Boarder
 
Posts: 844

Re: UDP transfert protocol

Postby michax » 27 Mar 2012, 07:56

I'm currently working on Raknet wraper for Shiva. I'v got running simeple RepManager 3 sample and .. it works. But i've only tried windows platform. Next move will be trying to port it to android and ios.

Nevertheless i think Raknet is a library to go with. With shiva plugin workflow implementing it is not so problematic. But of course it's time consuming task.
User avatar
michax
Platinum Boarder
Platinum Boarder
 
Posts: 469
Location: Poland

Re: UDP transfert protocol

Postby broozar » 27 Mar 2012, 08:52

nonetheless, you will have to create some sort of dead reckoning algorithm for our game. pings of 80-100 are actually pretty good, usually you have to deal with 100-300 in standard online games, and a lot higher figures for oversea connections.
User avatar
broozar
Platinum Boarder
Platinum Boarder
 
Posts: 3573
Location: Berlin - Germany

Re: UDP transfert protocol

Postby RawenGroup » 27 Mar 2012, 13:07

Raknet
Do not forget that you can only publish open source,
need buying lib redistribute license is want publish closed dll.
RawenGroup
Expert Boarder
Expert Boarder
 
Posts: 96
Location: Hungary

Re: UDP transfert protocol

Postby michax » 27 Mar 2012, 14:50

I've read whole "Hobbyist" license http://www.jenkinssoftware.com/pricing.html and i didn't found part mentioning that sources should be released. But anyway as far as Shiva plugin, I'm open to share.

But to be sure i will ask on Raknet forum about GPL like license requirements.
User avatar
michax
Platinum Boarder
Platinum Boarder
 
Posts: 469
Location: Poland

Re: UDP transfert protocol

Postby michax » 27 Mar 2012, 15:01

nonetheless, you will have to create some sort of dead reckoning algorithm for our game. pings of 80-100 are actually pretty good, usually you have to deal with 100-300 in standard online games, and a lot higher figures for oversea connections.


Ping higher then 100 is seen as very bad for realtime games (shooters). Sure, you can smooth things out by interpolation and dead reconing but you can't do that in very unpredictable enviroment. I don't know about Stonetrip networking implementation but even through LAN i get relatively big latency. I will have more to say after finishing racknet networking tests. For now i'm very biased and I base my knowledge on articles from "the" net :)

Anyway i realy hope for some latency improvements in comparision with shiva networking.
At the same time i'm figuring out how to implement different levels of data interpolation to smooth gamplay out.

UDP has no impact on the ping only on the roundtrip time (latency), so if your physical ping is 100ms then it will remain 100ms


I've tested shiva networking with server put on rackspace and i got ping 90 - 100 (avarage "shiva" ping). My default ping (windows commandline) to rackspace server is equal to 59 in avarage. Difference could be because of "proxy" nature of shiva server.

When i try to connect on my lan network between two shiva nodes i got ping around 60.
User avatar
michax
Platinum Boarder
Platinum Boarder
 
Posts: 469
Location: Poland

Re: UDP transfert protocol

Postby dreamora » 27 Mar 2012, 15:26

For shooters and other low latency action oriented games the ping does not matter half as much as the 'guaranteed in order reliable' nature of TCP which is a neck breaker. The problem here is not the latency as such but the enforced order which can cause 100ms pings to result in 300ms++ latencies due to the fact that all packets will wait until a previously unreceived one is finally received.

In such a situation and for this use case you simply need UDP to make position updates and alike unreliable so they can be dropped if the next packet is received earlier than the previous one and alike. Thats the reason why most games use UDP and add the TCP functionality (reliable, ordered) on top of but optional to use it where its required and makes sense.

TCP is fine for MMO and other non-action packed - low latency situations though, where the ratio of 'unreliable' to 'reliable' data is not that much in favor of unreliable as it is with shooter which primarily consist of unreliable messages (position updates of players, bullets, ...)
I'm no stonetrip representative, just a happy board member like you :)

If you find my portfolio interesting, feel free to contact me or follow my shares on my twitter stream or my game development blog
User avatar
dreamora
Platinum Boarder
Platinum Boarder
 
Posts: 844

Re: UDP transfert protocol

Postby dtr1au » 17 Jun 2012, 00:16

michax wrote:I'm currently working on Raknet wraper for Shiva. I'v got running simeple RepManager 3 sample and .. it works. But i've only tried windows platform. Next move will be trying to port it to android and ios.

Nevertheless i think Raknet is a library to go with. With shiva plugin workflow implementing it is not so problematic. But of course it's time consuming task.



Hi Michax,
Wonder how you progressed with your raknet implementation, and if perhaps you would be willing to provide your base plugin project. I'd be more than willing to pay for it, as you say it's a time consuming task. Im interested in a number of platforms, mac, windows, web, ios, android (and maybe linux). If you've not progressed much with it I would be willing to pay for you to complete.
dtr1au
Platinum Boarder
Platinum Boarder
 
Posts: 375
Location: ACT, Australia

Re: UDP transfert protocol

Postby michax » 17 Jun 2012, 19:56

Hi dtr1au,

I had a little break with Game development. I will be back on track soon and I will share results publicly.
User avatar
michax
Platinum Boarder
Platinum Boarder
 
Posts: 469
Location: Poland

Re: UDP transfert protocol

Postby otester » 27 Jan 2013, 19:39

michax wrote:Hi dtr1au,

I had a little break with Game development. I will be back on track soon and I will share results publicly.


Any news?
otester
Platinum Boarder
Platinum Boarder
 
Posts: 331

Re: UDP transfert protocol

Postby Deleted » 29 Jan 2013, 14:10

Interested in this too.
Deleted
Gold Boarder
Gold Boarder
 
Posts: 198

Re: UDP transfert protocol

Postby michax » 30 Jan 2013, 00:08

For now i halted Racknet plugin development (there wasn't too much done).
I first need to finish my game.

After that I'll be thinking about networking.

However there wasn't any problem with testing racknet samples inside Shiva plugin environment for windows and linux. I dind't had time to test mobile platforms.
User avatar
michax
Platinum Boarder
Platinum Boarder
 
Posts: 469
Location: Poland


Return to Plugins