How do I create a Multiplayer Server with multiple Layouts?

0 favourites
  • 7 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hi. I started to work on a new small game and wanted to have a "dedicated server" running which stores player data in an array and saves it via nodewebkit to a textfile on the server. I created one Layout with all Server events and some other layouts for the players (login, 1. zone, 2. zone). But is it possible to manipulate items on multiple layouts at once on the Server? Or can the Server open multiple layouts at once to do this somehow?

    If a new player logs in can I create his entity in Zone1 even if the Server runs on another layout? (goto layout > create player > go back?)

    Did anyone already try something like this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Bl4ckSh33p I lost you at "open multiple layout at once". I don't think its possible unless someone proven otherwise.

    I'm also considering the idea of having multiple player zone, so I'm curious if this is doable that way. I'm new to the multiplayer feature, just jumped in today... my understanding is the zone will be the instance of the game, so can't you create a new tab for each zone/instance? I don't know how to do it and whether it will work or not but it's an idea at least.

    The barrier right now is probably figuring out how to create new tabs running the project upon request of the player.

  • if the data is being saved as a textfile to the server, why don't you have your clients access the textfiles directly via ajax.. just make sure that they are saved in an accessible location

  • This may be possible but the file just contains shipclass, shipcolor and credits right now. (loaded at start, sent to player, saved when logging out). But the problem is how/if I can use multiple layouts to have different "zones" for the players. It seems the server just can work with one (the current) layout?

  • Did anyone already try something like this? Maybe multiple tabs for the server could work?

    Like this: I launch it on my Server/PC and enter a Password or anything* that identifies me as "The Host". Now the game shows the Server Layout and there are Buttons or anything else to jump to the "Zones". Now I click on the first Zone and the Server now does all actions for this layout. Now I open the game in another tab or launch a second instance of Node-webkit (possible?**), log in as Server but this time select another Zone on the Server layout. So two layouts should be open and the Server can do thinks on both at the same time?

    *or maybe create a separate "Server App" which connects to the same instance/game IDs if you dont want anyone to be able to act as Host. (But I plan to allow user hosted servers so it should be in the game)

    **when I tried to run the .exe a second time nothing happened. and creating a second copy with another name did not work either. Is there a way to run a node-webkit export multiple times?

  • Bl4ckSh33p I did. Multiple tabs will/does work. So far my problem with multiple tabs is [action: wait xx seconds] which suspend inconsistently.

    I explained it in the intro in this thread on how I manage the hosts. I manage to handle/choose players and move them from the lobby room into a duel room and still working on how to get players to return to lobby upon disconnection from duel room. However I'm currently struggling to get the connection events to be perfect and handle recoveries flawlessly, still got major bugs here and there but at least the concept is proven doable.

  • Nice.

    I had some issues with joining rooms and tabs. Sometimes when I open host and peer in a tab in Chrome connecting to a room does not work (peer stuck until I go back to other layout, come back and try to join the room again).

    I was told it should work on a dedicated server when I run the browser there (dont know how, yet).

    It "should" be easy on a windows server but Chrome runs on Linux too, right? (Linux Servers from 1&1 have php installed, Windows servers just have ASP/.Net)) But Linux will not run node webkit .exe exports so I think I will have to try a Windows Server (the current server stores data in a .txt with node webkit actions and cant run in browser tabs).

    But does anyone know how/if I can run multiple node-webkit exports? Launching the same file (or renamed .exe's) does not seem to work. Maybe I can create one export for each zone so every zone has its own project and folder when exported? But it would be easier to manage if it could be in one export.

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