Multiplayer options

0 favourites
  • 7 posts
From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • Hi there. This is my first actual post in a while and its a sort of direct question for Ashley ... I've been playing around with the multiplayer pong idea for a while with my co worker and the recent template was great in clearing out some of our doubts.

    However I've been thinking... I know at least on this recent version of multiplayer the signaling server is hosted by scirra and manages the information traffic for the host and peers... Is there any possible way to make something similar over bluetooth connection among paired devices?

    Any ideas or suggestions are welcome too.

    Thank you again for such a great product.

  • The signalling server needs to be a central point for peers to meet, so everyone knows where to go to find other players. This makes it difficult to run anywhere other than a public web server with a fixed name (in this case multiplayer.scirra.com). However if two peers are on the same LAN, then WebRTC will figure this out and connect them directly to each other for the actual gameplay, so you have near-enough zero latency for the game itself.

  • Ashley Thank you for the quick reply. So if I wanted my game to have a private yet multiplayer connection w/o adding extra load on scirra's signaling server we would have to make our own solution right?

    The game we are developing is for mobiles and we'd like the players to be able to setup their "room" and invite their friends(2-8) for a nice challenging game much like old battle tetris(ours is not tetris tho) used to do.

    I'm just asking because I have to rely this to my team in a clear manner and I want to have the best possible explanation I can for them so we can make the adjustments we need to do if any.

    Thank you for all the help you've been great.

  • Our signalling server is running on a high-end server which is currently yet to hit 1% network utilisation... so I wouldn't worry too much about the load on our server!

  • ok cool good to know.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I also have a question for you, ASHLEY. You said it was possible in your chat tutorial to add private messaging. I tried it myself to what I believe should work, but doesn't work. Could you elaborate more on your theory? I've attached my .capx if you need it.

    Thanks

    ** Updated to include who from **

    The way i do it might not be the most efficient way.

    But i have an array in my project for the peer, 4,1,1.

    I insert the ID/alias of the player i want to message into the first element.

    Then the "tag" into the second element.

    Then the message into the third element.

    Then who its from in the fourth element.

    I then send a message to the host with the tag "pm" and the message as array.asjson

    The host has two arrays.

    arrayrecieved 4 by 1 by 1

    arraysending 2 by 1 by 1

    The host has a call waiting on.message.from.peer.with.tag."pm" >

    It then loads arrayrecieved with arrayrecieved.load.from.json multiplayer.message

    Then it loads arraysending first element with arrayrecieved.at(3)

    Then loads arraysending 2nd element with arrayrecieved.at(4)

    Then multiplayer.send.message

    To: arrayrecieved.at(1)

    Tag: arrayrecieved.at(2)

    Message: arraysending.asjson

    The recieving peer has 1 array, arrayrecieving, 2 by 1 by 1

    multiplayer.on.message.recieved.from.peer with tag "pm" > arrayrecieving.load.from.json multiplayer.message

    textbox.append from & " " & arrayrecieved.at(4) & ":" & " " & arrayrecieved.at(3) & newline

    Hopefully this isn't too confusing

  • I'm not using an array though, I'm using a text box.

    The text box object is used to show the peers what others are saying.

    You still need a way to whisper someone.

    Since peers cannot talk to each other directly, you have to send a message to the host telling it who to relay to, what the message is, and any tags.

    In my previous example, i used an array, after some thought, it might be easier to use the dictionary object for small messages.

    Ill make an example for you and upload it after lunch

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)