Page 1 of 1

Server

Posted: Thu Jan 02, 2014 6:29 pm
by Doctory
I'm trying to make a multiplayer game using UDP, I found the tutorial on the wiki, but I don't know how to be able to make server hosting, joining, chatting, all over a console.

Any idea?

Re: Server

Posted: Fri Jan 03, 2014 8:17 am
by Plu
Maybe the examples in this thread can help you out?

viewtopic.php?f=3&t=76711

I've not worked with this myself, so not much more I can offer.

Re: Server

Posted: Fri Jan 03, 2014 10:39 am
by Germanunkol
As in the thread Plu linked to, you should use the built-in Enet library that ships with version 0.9.0.
It has a lot of functions specific to gameplay where UDP doesn't. Also, what's more important, Enet has a "reliable" mode if I remember correctly - marking packets as reliable will make sure they arrive - something that you can't do with plain UDP.
In fact, you should first try to only send in reliable mode - otherwise you'll run into unecessary problems. You don't need unreliable mode unless you get the server into difficult situations with lots of players.

Re: Server

Posted: Fri Jan 03, 2014 12:11 pm
by Doctory
Thanks!

Re: Server

Posted: Fri Jan 03, 2014 3:25 pm
by MPQC
Germanunkol wrote:As in the thread Plu linked to, you should use the built-in Enet library that ships with version 0.9.0.
It has a lot of functions specific to gameplay where UDP doesn't. Also, what's more important, Enet has a "reliable" mode if I remember correctly - marking packets as reliable will make sure they arrive - something that you can't do with plain UDP.
In fact, you should first try to only send in reliable mode - otherwise you'll run into unecessary problems. You don't need unreliable mode unless you get the server into difficult situations with lots of players.
If you need reliable then using UDP is not what you're looking for (ie use TCP).

Re: Server

Posted: Fri Jan 03, 2014 5:04 pm
by slime
MPQC wrote:If you need reliable then using UDP is not what you're looking for (ie use TCP).
ENet is designed to be able to do (optional) reliable UDP, and ends up having far less overhead than TCP - which makes it ideal for real-time games: http://enet.bespin.org/Features.html

Re: Server

Posted: Fri Jan 03, 2014 5:41 pm
by MPQC
slime wrote:
MPQC wrote:If you need reliable then using UDP is not what you're looking for (ie use TCP).
ENet is designed to be able to do (optional) reliable UDP, and ends up having far less overhead than TCP - which makes it ideal for real-time games: http://enet.bespin.org/Features.html
Neat.