Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
NoobHub matchmaking? — Gideros Forum

NoobHub matchmaking?

test29test29 Member
edited June 2016 in General questions
What is the best method to make NoobHub simple random matchmaking (2 players)?
I have tried with simple messaging and it works but it has problem when two players enters in the same time, it then creates two separate connections, one for each player instead of only one.
When there is small delay between players entering matchmaking screen, everything works OK.

Somebody help?

Comments

  • totebototebo Member
    I used Noobhub for matchmaking with up to seven players. Because everything is client side, you have to have an extra check to decide who will act as server, or game leader. This quickly gets messy, because players can lose their connection, and it's difficult to cover all edge cases. In the end I ditched my prototype in favour of a custom server with matching logic on it.
    My Gideros games: www.totebo.com
  • I was working on implementing matchmaking between two players in the server side. My approach is the following:

    1) The client app subscribe to "public" channel
    2) I have modified node.js file to create a room (rooms hash in Javascript) or connect to players in the same room when this first message is receive. The variable socket.connection_id is perfect to identify a connected player.
    3) Every client receives a special message with the connectionId of each players.
    4) Now every player knows the channel to publish messages.
  • I have found a similar project to Noobhub

    https://github.com/huytd/node-js-game-server

    It provides some room creation support but you should create your own cliente based on lua socket and Noobhub client.
  • MoKaLuxMoKaLux Member
    edited April 14
    there is this NoobHub port to love2d that I ported to Gideros and it is working on my machine B)

    No Node.js needed, pure Lua code :p

    The original project is here: https://codeberg.org/glitchapp/noobhub-love2d

    and my Gideros version: https://drive.google.com/drive/folders/1Rpc9qeowENCrHmEGFvuCJp_xoo0LTIY3?usp=sharing

    or

    https://drive.google.com/file/d/1UvlouR2b-hTut6VChu8zcF7zPAyNsshL/view?usp=drive_link

    Demo:
    local NoobHub = require("classes/noobhub-server")
     
    NoobHub:start()
     
    stage:addEventListener(Event.ENTER_FRAME, function(e)
    	NoobHub:update()
    --	NoobHub:drawServerInfo()
    end)
     
    NoobHub:drawServerInfo()
    Results:
    Uploading finished.
    NoobHub server started on port	1337
    NoobHub Server (1337)
    Uptime: 0.0s
    Connections: 0
    Channels: 0
    Online Users: 0
     
    Connected Clients:
    Channel Activity:
    PS: it was only for a quick test and didn't try to create a client/server demo
    PS2: for those who are into client/server stuff, this would be cool if you show us the basics with a demo
    PS3: when I come back to it I need to add it to the wiki ;)

    Likes: pie

    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.