Hello,
please scroll down if you would like to have a service where you can just upload your zip file from construct and then have it run as a multiplayer server.
I have spent some time thinking about this and there is a way to use construct to develop a multi-player server without coding anything else.
If you want it to scale to hundreds and even thousands of simultaneous sessions, then even that is possible, but it would not be the cheapest of solutions when it comes to cost-of-ownership.
But for a few simultaneous sessions with about 8 users it roughly comes down to this:
For the server you have a layout that connects to the websocket and listens for any incoming message as forwarded by the proxy.
Each client (game/enduser) connects to the websocket and announces itself using a GUID (or login/password or somesuch)
The server 'layout' then 'routes' this client to a 'room' or 'session' (i.e. giving it a GUID as session id).
The client now uses that session to message the other clients, all through the session 'layout' in the server.
This involves having at least 2 processes at the server side: the 'entry' or 'router' part and the 'session' or 'room' part.
If you want as much control over the game as possible then have the clients only send the inputs ('key down', 'mouse clicked at x,y') and have the server 'play' the game using constructs events, collisions etc. and send the x,y, effects, instances created/destroyed back to the client.
You would use the node-webkit combo to run the 'room'/'game' at the server side.
The overhead is then, of course, a new process per session.
For a headless server (i.e. one in a datacenter with no graphics/output) you would use something like xvfb.
What I am wondering is if there is an interest in having this as a service.
Basically, you would upload the generated zip file and then your server runs.
The service would take care of the scaling (which can be handled quite nicely actually, if you code some extra things in there).
A development setup would be possible by having your own layout connect to the dev websocket so you can see your code running.
But, as I am a nice guy with quite some room in my datacenter but I am not wealthy enough to just run something large without having some remuneration going towards the cost of running something like that, I am wondering *if* and if yes *how much* would you be willing to pay for a service like that and in what form (i.e. per session played, fixed amount per month for a maximum of X sessions, etc...)
Basically, if I have the idea that such an endeavour could cover running costs then I would be willing to get my team cracking and build a 'Construct 2 Server Service'.
Let me know what you think.
With kind regards,
Adrianus Warmenhoven