Socket.IO Plugin - Discussion

  • You can create a first room peer and run it on your dedicated hardware server. Thus your now controlling the authoritative information. This peer

    A. Does not have a playable character or if it does it's out of bounds.

    B. This peer NEVER logs out as it's run on your computer as the authoritive host.

    Ah, ok. Thanks, that clears it up better!

  • But if the first peer becomes a host, who checks that peer? Or am I thinking about this incorrectly?

    Download the capx in my last bug report if you want to see a method of ensuring your server to always be the host. This is one of the few ways to do it, it uses roomlist checking to verify a host exist or not before peer attempt to join room.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wait, what do you mean by that? You mean you've been running a host using the shooter demo?

    The game is coded so that the host peer does not participate in the game, and then it's been running in a Chrome tab on a dedicated server for weeks without any issues. So it's basically like having a dedicated server for the game. That's been my point: it's always been possible to do that with the multiplayer engine.

    [quote:1gasejcs]But if the first peer becomes a host, who checks that peer?

    The question is identical to asking "who checks the server in an authoritative server game?". Nobody. The authoritative server (or host peer) has by definition *the* global game state, and everyone else is doing their best to display that state with minimal latency.

  • DatapawWolf

    Here you go, i've made the repo public, anybody is allowed to download and play with this plugin;

    http://git.machina.hr/c2-socketio/socket-io

    Few things to keep in mind:

    • Needs a custom version of a socket.io client library (one-liner change).
    • MIT license.
    • Want to contribute? Email me and i'll open up an account.

    edit: i've just saw this thread. Some good stuff is mentioned here!

  • JohnnySheffield That's neat, but my deal-breaker right off the bat is commercial use. The reason I'm considering/requesting Socket.IO is mainly because it's free, otherwise there's a convincing argument for Scirra's multiplayer plugin. Also - and I don't know if I'm just picky (probably picky) or what - why would you invite contributors to work on a project for which you hold all rights to?

    Like I said, not trying to pull apart your efforts. I'm glad to see an extension of C2 that supports the newest Socket.IO functionality. Just a bit skeptical.

  • Hey man, i understand your worries.

    I'll release it with MIT license as soon as somebody offers to maintain it. Are you interested?

  • JohnnySheffield if you're interested in getting people to maintain it, I'd suggest asking around the Reddit, Facebook Group, and the forums. I can sign up, but I'm not sure how much I can actually do, heh.

  • JohnnySheffield if you're interested in getting people to maintain it, I'd suggest asking around the Reddit, Facebook Group, and the forums. I can sign up, but I'm not sure how much I can actually do, heh.

    Cool! With your willing to sign up, you're the single best person i'll ever find. I'll upload the MIT license to the repo, and consider you the owner of this plugin. If you want to get read/write access to the repo, pm me any mail you have access to.

    Cheers!

  • Congratulations! You're the copyright holder of the socket.io plugin for C2!

    Download the repo again to get the latest changes.

    Enjoy, and happy coding!

    Cheers!

  • JohnnySheffield so far I've downloaded it but haven't had time to test it out yet. I will, soon!

  • I think this conversation is better continued here instead of the original place.

    Read this with tone: I demand a tutorial on multiplayer from you

    Seriously, this is awesome.

    I have the hosts screen be the game (pc screen / tv screen etc) and peers screens (mobile/tablet) are the analog controllers. My kid thinks its pretty fun. Still ironing out the kinks though. But love the multiplayer plugin. Damn hard sometimes, but very cool.

    I enjoyed your proccess... taught me a few things

    I do have plan to create some tutorial, but I found that it requires a rather long explanation that my draft never been finished because I was too occupied with my current project as I am currently very productive at it. Probably I should be doing it in series instead, once I hit another wall of problem, to occupied procrastinated time .

    The idea on PCscreen+2mobile control idea is BLOODY AWESOME IDEA! I love the fact that this is actually open up another possibility of exploiting C2 MP. Imagine street fighter or mortal combat or tekken skills executed based on gesture on touch screen and in mobile! This is one of the thing that makes webrtc triumph over other existing method (like socket.io). *hint *hint doing 10000 players playing pokemon is possible with C2 afterall . I'll keep this is mind for future projects, thanks a bunch on the idea though!

    Some note on the process I used, there are more to it actually. Using the same process flow, you can implement "host's load balancing", automated instance dungeon creation, and "remote browser controller" as the game master which you can access from your pc instead of remote desktop connection into the server.

  • I think this conversation is better continued here instead of the original place.

    > Read this with tone: I demand a tutorial on multiplayer from you

    > Seriously, this is awesome.

    > I have the hosts screen be the game (pc screen / tv screen etc) and peers screens (mobile/tablet) are the analog controllers. My kid thinks its pretty fun. Still ironing out the kinks though. But love the multiplayer plugin. Damn hard sometimes, but very cool.

    > I enjoyed your proccess... taught me a few things

    >

    I do have plan to create some tutorial, but I found that it requires a rather long explanation that my draft never been finished because I was too occupied with my current project as I am currently very productive at it. Probably I should be doing it in series instead, once I hit another wall of problem, to occupied procrastinated time .

    The idea on PCscreen+2mobile control idea is BLOODY AWESOME IDEA! I love the fact that this is actually open up another possibility of exploiting C2 MP. Imagine street fighter or mortal combat or tekken skills executed based on gesture on touch screen and in mobile! This is one of the thing that makes webrtc triumph over other existing method (like socket.io). *hint *hint doing 10000 players playing pokemon is possible with C2 afterall . I'll keep this is mind for future projects, thanks a bunch on the idea though!

    Some note on the process I used, there are more to it actually. Using the same process flow, you can implement "host's load balancing", automated instance dungeon creation, and "remote browser controller" as the game master which you can access from your pc instead of remote desktop connection into the server.

    Would love to know more... heck even if you put it in the store, I'll buy it (tutorial, template, whatever)...

    Like the controllers, try this. I play poker every month (guys around a table smoking cigars). The river cards are on the table via tablet, and each of us holds our mobile which is our cards. Webrtc is unbelievable.

    Only issue is how to package it. lol.

    I have created an autologin, mulitplayer game save type deal. So it registers your mobile and auto logs you into the lobby and tells you waiting for (whomever else was in your unfinished game) once they join players are taken to the game and it is the same game you left unfinished.

    Very exciting times... Now, I just got to get webrtc to work on mobile chorme on samsung S3, S4 (known bug) amongst a long list of nigglys lol.

  • JohnnySheffield hey FYI the Socket.IO plugin, server, and test project all worked successfully! The only thing was that using the newest version of Express which I downloaded removes the requirement of app.use, [quote:2mojzp36]the need to manually do app.use(app.router) has been removed.

    After that, as far as I know, everything is peachy with the newest version of Socket.IO, C2, and Express!

  • Great news!

    Yes, i think i've used the 3.0 version of the express. Express is optional here and was used to serve static files (eg- our exported C2 project). You can serve your projects anyway you want. I would recommend running socket.io and express as separated processes/machines, just to keep our concerns apart. It's easier to scale. Distribute all the things!

    I'll create a new thread for this plugin so it's best to continue there!

    edit:

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