networked multi-player games (with peer discovery)
2 posters
networked multi-player games (with peer discovery)
Is anyone using peer-to-peer networking with a multi-player SIO2 game? Can you recommend any framework or anything? I don't think sio2 addresses this issue (although maybe it should).
I saw the socket wrapper stuff but I doubt you want your buddy to type in your internet protocol address every time you want to play. Any help is appreciated.
I saw the socket wrapper stuff but I doubt you want your buddy to type in your internet protocol address every time you want to play. Any help is appreciated.
geekschmoe- Posts : 14
Join date : 2009-06-22
Re: networked multi-player games (with peer discovery)
I saw the socket wrapper stuff but I doubt you want your buddy to type in your internet protocol address every time you want to play. Any help is appreciated.
>> SIO2socket is perfect for this... you just have to wrap an interface in order to connect... any other library will give you the same access to the API.
>> SIO2socket is perfect for this... you just have to wrap an interface in order to connect... any other library will give you the same access to the API.
Re: networked multi-player games (with peer discovery)
I'm totally missing something.
The example code in tut 13 has a hard-coded ip address endpoint. It looks like just a straight socket API. Nothing for handling the discovery of other devices. I'm talking about discovering other instances of the game that is running on other devices via the local WLAN.
Consider this:
1. we're standing next to each other at my house and both our phones have the same multi-player game installed
2. we both open the game at the same time and start a new multi-player game
3. the game (on both devices) looks for local peers
4. whichever game instance finds the other one first becomes the host (server) and the other is the client
5. if a 3rd person opens their phone during this initialization period, then the host (server) node has already been designated and it falls in line as another client
6. During game play all the clients broadcast their events to the server (including the server broadcasting back to itself)
7. etc etc..
The important part here is the boilerplate discovery protocol stuff. This is at a much higher level than just straight socket programming isn't it? Does SIO2 provide this? Maybe this code to implement the aforementioned steps is just so trivial its not worth including in SIO2? Like I said, I'm missing something and I probably just need a dope slap.
The example code in tut 13 has a hard-coded ip address endpoint. It looks like just a straight socket API. Nothing for handling the discovery of other devices. I'm talking about discovering other instances of the game that is running on other devices via the local WLAN.
Consider this:
1. we're standing next to each other at my house and both our phones have the same multi-player game installed
2. we both open the game at the same time and start a new multi-player game
3. the game (on both devices) looks for local peers
4. whichever game instance finds the other one first becomes the host (server) and the other is the client
5. if a 3rd person opens their phone during this initialization period, then the host (server) node has already been designated and it falls in line as another client
6. During game play all the clients broadcast their events to the server (including the server broadcasting back to itself)
7. etc etc..
The important part here is the boilerplate discovery protocol stuff. This is at a much higher level than just straight socket programming isn't it? Does SIO2 provide this? Maybe this code to implement the aforementioned steps is just so trivial its not worth including in SIO2? Like I said, I'm missing something and I probably just need a dope slap.
geekschmoe- Posts : 14
Join date : 2009-06-22
Re: networked multi-player games (with peer discovery)
Dude the discovery is like SOOOO easy... simply make the client or the server ping the other devices within your gateway parse the command line output (or simply | grep) and list the IP....
Or simply try to connect using socket to all the devices at a specific port running the game... the whole process to scan the gateway is a few sec.
For internet play... you have to enter manually the IP but even then that's easy...
Or simply try to connect using socket to all the devices at a specific port running the game... the whole process to scan the gateway is a few sec.
For internet play... you have to enter manually the IP but even then that's easy...
Re: networked multi-player games (with peer discovery)
Thanks for the reply. I guess since everything else in sio2 is so nicely abstracted and high-level in sio2, I just figured that the network stuff would be too. Honestly, whatever multi-player networking code I write will function almost identical to others' network code, which to me seems like a giant opportunity for abstraction but I digress.
Is the only advantage to using sio2 sockets over the CFNetwork or C api directly is for portability purposes?
whats this grep output? are you implying that you can do system calls on the iphone/ipod to command line network utilities? or?
Is the only advantage to using sio2 sockets over the CFNetwork or C api directly is for portability purposes?
whats this grep output? are you implying that you can do system calls on the iphone/ipod to command line network utilities? or?
geekschmoe- Posts : 14
Join date : 2009-06-22
Re: networked multi-player games (with peer discovery)
Honestly me I would go with an SIO2thread that loop using an SIO2socket and try to connect to the other devices contained in your gateway... every successful discovery list the IP address and then I would use that address with some SIO2widget & SIO2font.
The whole code should be pretty small...
Cheers,
The whole code should be pretty small...
Cheers,
Similar topics
» Multi-Touch Handling
» Multi-Materials for one object
» Problem with multi-touch in 3D space
» Player Object Movement Tutorial 09
» Tutorial 09 Player Export Problem
» Multi-Materials for one object
» Problem with multi-touch in 3D space
» Player Object Movement Tutorial 09
» Tutorial 09 Player Export Problem
Permissions in this forum:
You cannot reply to topics in this forum