How do I implement for card game multiplayer (better way)

0 favourites
  • 4 posts
From the Asset Store
Template for trading card game, fully documented in comments and video
  • Hi, i would like a suggestion from someone more expert then me

    I'm developing a card game and would like to have a multiplayer turn based part of it

    I looked around and there is more then an option to do it. Before wasting weeks trying something that is not giving the right result for me, can you suggest the way to go, considering that:

    1) The opponent will be choosen randomly but considering some variables (like the level of player for example) just to avoid an unbalanced match

    2) Opponent can be chosen also from a list of friends (like facebook ones if i can put that, otherwise friends added searching the user in a mysql db)

    3) Should be cross-platform (ios, android, html5, windows8)

    Thanks in advance for any help!

  • 1) in Some sort of lobby, it will likely be the host setting the standard for levels of participation.

    The host could set some sort of name for the room containing an indication of the level of play by the host.

    Peers can then select to join or not.

    2) Peers/opponents can only join rooms once they are connected to the signalling server.

    You could however, create a special/private room name, and convey the room name to other potential participants, which after connecting to the signal server, they join. When you use a mysql DB you have a lot more freedom, but users would still need to be logged in to to the signal server to join a room.

    To fetch info from the database, they should know there is a request for them, not the easiest thing, you could do something with email requests. Or have the users poll the database at an interval looking for requests.

    There are some options for construct 2 to get info from the URL calling the application/game, you could process the room name in there, and use that to join a room once connected to the signaling server.

    3) chrome, firefox and nodejs support webRTC connections. I am not sure about the cordova webRTC plugin, I have not tested this.

  • 1) in Some sort of lobby, it will likely be the host setting the standard for levels of participation.

    The host could set some sort of name for the room containing an indication of the level of play by the host.

    Peers can then select to join or not.

    2) Peers/opponents can only join rooms once they are connected to the signalling server.

    You could however, create a special/private room name, and convey the room name to other potential participants, which after connecting to the signal server, they join. When you use a mysql DB you have a lot more freedom, but users would still need to be logged in to to the signal server to join a room.

    To fetch info from the database, they should know there is a request for them, not the easiest thing, you could do something with email requests. Or have the users poll the database at an interval looking for requests.

    There are some options for construct 2 to get info from the URL calling the application/game, you could process the room name in there, and use that to join a room once connected to the signaling server.

    3) chrome, firefox and nodejs support webRTC connections. I am not sure about the cordova webRTC plugin, I have not tested this.

    Wow... thank you for your detailed answer

    I think i'll need to read a couple more times it to understand better ehehe

    Still not approached the Multiplayer part so it's also harder for now

    If i understood well, best would be to use a signalling server along a Mysql Db

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah the whole DB idea would seem relatively easier.

    You could use it for friends lists too.

    1&2 a bit easier

    1) Host sets room name: NewGame-HostLevel10

    The peer could see in the lobby:

    Available games: NewGame (required level 10)

    2) You need a method to let the peers know there is a request for them.

    For example:

    an entry in the database containing a request to play, could contain the room name for the peer to join.

    or

    An email send to a peer as a request, could have a link to the game containing the room name: ie http://yoursite/yourgame/index.html?room=SomeGameRoom (could work for a facebook wall post too)

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