Multiplayer Games

Discussion and feedback on Construct 2

Post » Mon May 06, 2013 5:21 pm

Multiplayer games, any chance with C2?
B
9
S
3
G
1
Posts: 5
Reputation: 1,538

Post » Mon May 06, 2013 6:00 pm

Of course. You can make any 2d multiplayer game in C2.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon May 06, 2013 7:14 pm

@LucasTorres
Please provide more details. Local MP, Online MP, Turn based, realtime, reasonable time. What kind of multiplayer. The method and solutions can vary depending on what your looking for.

For all them, the answer is yes, but the amount of work will vary greatly.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Mon May 06, 2013 8:18 pm

@LucasTorres
Have a look at my two multiplayer plugins. In both, C2 is used as a front end to take input from each player and to display the current game state. In the first (MultiPlayer), you need to program the game logic server-side; in the second (PhotonClient), no server-side programming is needed, and most of the game logic is handled by your C2 code:

1) MultiPlayer (NodeJS server - you need some server-side JavaScript experience if you want to adapt my server code).

2) PhotonClient (Photon Cloud server - no server-side programming needed here, but it does mean that you have fewer options for management of your game).
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Tue May 07, 2013 1:03 pm

[QUOTE=jayderyu] @LucasTorres
Please provide more details. Local MP, Online MP, Turn based, realtime, reasonable time. What kind of multiplayer. The method and solutions can vary depending on what your looking for.

For all them, the answer is yes, but the amount of work will vary greatly.[/QUOTE]


online, for example, DDTank
B
9
S
3
G
1
Posts: 5
Reputation: 1,538

Post » Tue May 07, 2013 2:20 pm

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:

- Get a server (I can also explain how P2P would be possible but that is a bit more involved. Also, a server is easier to use if you want to prevent cheating).
- Either install a specific server that listens for websockets and that can forward specific messages to specific clients (I have made a PoC for myself in Go) or use something like https://gist.github.com/bradleywright/1021082 in a plugin or CallJS call.
- 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
B
5
S
1
Posts: 11
Reputation: 750

Post » Tue May 07, 2013 5:07 pm

@awarmenhoven
What your talking about is cluster based networking. yes that was my plan :D. there is interest of course. If you want to do it. Please go ahead. This would save Velotjet and me great time for some one else to handle it :)

I was starting to do the PoC Here. But then I was faced with 2 problems.
1. Photon doesn't have Channels or Routes. They only have from what I can tell are isolated lobbies. So i couldn't sit cluster server to be the game logic for mutliple rooms :(
2. I would have needed to install Visual Studio Express. We all have our bias for coding langauges. I won't work with .NET unless I'm paid. I'm not being paid. I won't touch it. :D

instead if no one set's up a C2 cluster network. I plan to use NodeJS Tycho or ActionHero. Which both can be configured for cluster networking :)

My question is. Would people pay a descent amount of money on Kickstart for a team to get this going. Or pay an X amount for a plugin. I would love to quit my job :D

@LucasTorres
Yes, You could do DDtank like game. However, that game looks like it will have a lot of server based code. So it's going to be a lot of work and at this moment. Your going to need to learn a programming language... unlsess of course some one get's a cluster network going :)


I don't know. This wave of "is there online multiplayer" questions has a different feel to it.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Tue May 07, 2013 6:02 pm

[QUOTE=jayderyu]
@LucasTorres
Yes, You could do DDtank like game. However, that game looks like it will have a lot of server based code. So it's going to be a lot of work and at this moment. Your going to need to learn a programming language... unlsess of course some one get's a cluster network going :)


I don't know. This wave of "is there online multiplayer" questions has a different feel to it.
[/QUOTE]

I work with Web Development Web.I know PHP.
is enough?

Sorry for language mistakes, I'm Brazilian and beginner in English
B
9
S
3
G
1
Posts: 5
Reputation: 1,538

Post » Wed May 08, 2013 2:32 am

[QUOTE=awarmenhoven]... 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. ...[/QUOTE]
That's exactly how my MultiPlayer behavior/NodeJS server functions. A demo is currently running on the Nodejitsu cloud platform (which uses automated clustering).
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Wed May 08, 2013 5:52 am

[QUOTE=LucasTorres] [QUOTE=jayderyu]
@LucasTorres
Yes, You could do DDtank like game. However, that game looks like it will have a lot of server based code. So it's going to be a lot of work and at this moment. Your going to need to learn a programming language... unlsess of course some one get's a cluster network going :)


I don't know. This wave of "is there online multiplayer" questions has a different feel to it.
[/QUOTE]

I work with Web Development Web.I know PHP.
is enough?

Sorry for language mistakes, I'm Brazilian and beginner in English[/QUOTE]

I'm not bothered by your English. I speak and write English as my native and only tongue, yet I am very poor at writing :D

no, PHP will not be enough for anykind of real time game play. Not only does PHP over TCP, PHP also script handling isn't as fast. PHP is meant to serve up core data and web pages.

However, you can use PHP for all the inventory and character management. but you will need at least Websockets for gameplay. You can use Velotjet plugin for that :)
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 16 guests