Help me please (multiplayer online)

1 favourites
  • 10 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi, I am developing online card game but I red that the multiplayer plugin of Construct is very difficut to use... Is there an alternative or a guide (with simple examples) where I can learn about this plugin? In addiction I heard that p2p multiplayer is laggy and I prefer to use a central server...

    Would somebody give me directions to make this "multiplayer project" with Construct?

  • I have no experience with the multiplayer side of Construct... except when I caught my students modifying the mp chat example to send messages to each other in class... But I have a couple of questions.

    How many players are you thinking of? As a card game, I'm wondering if it's 1v1 or something bigger.

    Is player lag even going to affect your players? By this I mean, a lag of a few milliseconds (or even longer) isn't going to be noticeable in a card game like it would be in an action shooter.

    Honestly, I think p2p is perfect for a card game. Hell, even a lot of AAA games use p2p rather than dedicated servers. I think you'll be fine.

    Of course, someone with more experience on the mp side of Construct might come here and contradict me which is cool.

  • Here's the problems you face:

    MP Plugin: While this is probably the easiest solution to implement, it requires use of the signalling server. If it ever goes down, you game goes down. It also means your clients are connected to each other and none of the data or stats are funneled through any service you have so collecting that data requires additional work. It can act as a server but this requires that somewhere on the internet you have to have a dedicated client running inside a browser. To me, that's just a huge, huge overhead for running a server. It just seems silly, though I suppose it does work to a degree, to have a server running inside a browser. And, that also means that if you're going to host the game on fast commercial connections, you'll need a server that you can VPN into to constantly make sure that browser is running.

    Ajax: Connecting to a webserver with Ajax is easy enough. You'll have to write scripts in a language like PHP to make requests of the server. The problems here is you're only making requests, it's one way communication. The server can't 'push' notifications out to your clients using just Ajax. Your clients can 'poll' the server with a request, say every second, and see if there's anything it needs but this has it's own set of problems. You get 1,000 clients polling a server every second and you're likely to run into hosting issues.

    Web push notifications: There are methods out there to send these 'push' notifications to clients and I have successfully made them work in C3. However, each such connection to a server becomes a constant connection. Unlike Ajax which makes a brief connection and then disconnects, this method keeps the connection open. The problem there is, each client is going to need a connection and to get more than say 100 connections on a web server, you're getting into premium server price range. You get more than 1,000 connections and you're going to need some server horsepower to manage them all.

    WebSockets: This method has the potential to have thousands of active connections without using the actual webserver (like Apache). Many games use this along with other communication methods (UDP/TCP) to communicate with clients. The problems here is that you are going to have to write a dedicated server in, most likely, a higher level language like C#, Python or C++, which can be a daunting task. You'll also need hardware sitting somewhere that the server code can run on.

    For a card game, lag shouldn't be an issue. Were I thinking of doing something like this I'd most likely look into using Ajax or a combination of the MP plugin and Ajax to collect stats from the players.

  • I would suggest trying the Photon Cloud Plugin as well. I also had some problem grasping the built in multiplayer plugin.

    Photon Cloud was much more simple to understand for me and worked great. Try it out.

    construct.net/en/forum/extending-construct-2/addons-29/plugin-photon-cloud-93112

    There is a C2 and C3 version of the plugin and it seems quite well maintained.

    There are some examples as well. Pretty easy to set up and understand.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would suggest trying the Photon Cloud Plugin as well. I also had some problem grasping the built in multiplayer plugin.

    Photon Cloud was much more simple to understand for me and worked great. Try it out.

    https://www.construct.net/en/forum/extending-construct-2/addons-29/plugin-photon-cloud-93112

    There is a C2 and C3 version of the plugin and it seems quite well maintained.

    There are some examples as well. Pretty easy to set up and understand.

    The Photon Cloud Plugin is for CS3 - Construct 2 Runtime only.

  • > I would suggest trying the Photon Cloud Plugin as well. I also had some problem grasping the built in multiplayer plugin.

    >

    > Photon Cloud was much more simple to understand for me and worked great. Try it out.

    >

    > construct.net/en/forum/extending-construct-2/addons-29/plugin-photon-cloud-93112

    >

    > There is a C2 and C3 version of the plugin and it seems quite well maintained.

    >

    > There are some examples as well. Pretty easy to set up and understand.

    The Photon Cloud Plugin is for CS3 - Construct 2 Runtime only.

    Ahh.. I havn't used it for a while.. maybe should ask them for an update?

  • WebSockets: This method has the potential to have thousands of active connections without using the actual webserver (like Apache). Many games use this along with other communication methods (UDP/TCP) to communicate with clients. The problems here is that you are going to have to write a dedicated server in, most likely, a higher level language like C#, Python or C++, which can be a daunting task. You'll also need hardware sitting somewhere that the server code can run on.

    For the backend/dedicated server, you can use node.js with websockets or directly a server node module (ws : npmjs.com/package/ws ) on the exported node-webkit application from construct 3.

    With the last method, you can use the construct 3 engine for your server.

  • macube Hmmmm tested it in C3 runtime and seems to be working fine.

    No issues here. Maybe they updated it recently then?

    Opened an old c2 project with Photon Cloud, and switch to C3 runtime with the latest version of Photon plugin and everything works as expected.

  • macube Hmmmm tested it in C3 runtime and seems to be working fine.

    No issues here. Maybe they updated it recently then?

    Opened an old c2 project with Photon Cloud, and switch to C3 runtime with the latest version of Photon plugin and everything works as expected.

    Hmm, is this the last version/download-link? :

    photonengine.com/sdks

  • > macube Hmmmm tested it in C3 runtime and seems to be working fine.

    >

    > No issues here. Maybe they updated it recently then?

    >

    > Opened an old c2 project with Photon Cloud, and switch to C3 runtime with the latest version of Photon plugin and everything works as expected.

    Hmm, is this the last version/download-link? :

    https://www.photonengine.com/sdks#construct2

    Version 4.1.0.1 seems to be working fine in C3 runtime. Just downloaded it.

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