Multiplayer/Networking Questions

Discussion and feedback on Construct 2

Post » Fri Jul 26, 2013 9:12 pm

Hello, new user of Construct 2 here.

My background is programming, but not game programming nor networking. So far I really like how easy it is to use Construct 2 to put together games. Love that it also has things like dictionary objects, arrays, and functions. I think it is going to be very easy for me to make the core gameplay mechanics using Construct 2.

Having said that, I would ideally like to make the game multiplayer (doesn't every newbie?) and have some questions centered around that. Would be great if someone could help out and point me in the right direction.

1. I have the idea of there being a global variable isServer in C2. This is mostly so the game mechanics and logic can all be in the same place, and will control how messages are sent back and forth. For example, if an input message comes in and this is the server, it will execute it and return the results. If an input message comes in and it isn't the server, it will just execute it. Things like that. Then I will include with the server version an additional file that contains server only logic (networking and whatnot) and sets the global variable to true. Or I can just manually set it on after I export it. While I realize this isn't the ideal solution, it should let me keep the code together and create it within C2. Are there any potential problems with this approach?

2.a. UDP for HTML5? The game doesn't have to require instant messaging, but certain core parts would have to be reworked to better fit with a TCP solution and it would be a little less fun in the end, in my humble opinion. I see that WebSocket is included out of the box, but has anyone got a UDP solution up and running, or something similar? I saw JohnnySheffield did one that required Node-Webkit and wasn't HTML5. HTML5 is more important to us than UDP. Does anyone have thoughts on this: EmiNet. It seems good to me, but I don't know enough about this type of thing to really tell.

2.b. I see some posts about WebRTC, and combining that with node.js. I realize this would require changing the server logic some since there would be broadcasts going P2P in addition to going through a server. Any thoughts on the feasibility (and challenge) of doing something like this? I understand computers and programming, but am worried I'm missing something when it comes to networking protocols, servers, and the like.

That's all I've got for now. Love the tutorials and how easy it was to jump right in! Thanks everyone!
B
10
S
4
G
1
Posts: 58
Reputation: 1,420

Post » Sat Jul 27, 2013 8:37 am

Eminet doesn't support straight javascript or anything the browser has access to. It is at best another Nodejs technology from our perspective.

There are people working on server technology for C2. You mentioned one of them. Velotjet has a couple of plugins. Rexrainbow has Bottleneck technology that I think runs on Heroku, and i'm tinkering with a model to get C2 running as a server.

Also at this moment there is no UDP access for browser js. WebRTC comming and that has socket reliable and unreliable. I believe though it is not specifically UDP, but similar.

Due to the nature of network programing there is no one solution to all network messaging. Due to the nature of how different games handle movement and actions. it's just best to let each game handle custom game based messages. At least thats my opinion.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Mon Aug 05, 2013 4:51 pm

Hey, thanks for the info. I didn't realize Eminet wouldn't work with the browser.

I did find two games that have been made with WebRTC, so I think this approach is feasible. Of course for me the big hurdle is always time and motivation, so I have reworked the game to not require a fast connection. I'm also putting multiplayer support aside and just focusing on making a single player aspect of the game. After I get something that is playable, I'll request feedback and see if the concept is worth trying to make multiplayer.

I'm still not clear about if it is possible to modify C2's logic code to use it as a server, but guess I don't have to worry about that right now.
B
10
S
4
G
1
Posts: 58
Reputation: 1,420

Post » Mon Aug 05, 2013 11:32 pm

FYI: WebRTC is only supported currently in Chrome and Firefox. It can be possible to use HTML5 web sockets (as bombermine.com does), but you will have many possible lag issues to deal with.

Personally I'm, working on DreamSpace, which is an API for client/server web development (websites, server services, etc.), built upon my V8.NET wrapper (see CodePlex). The idea is to use a game-like graph system, instead of relying on a DOM. This allows running a web application (or game) that can have the UI "turned off" and still run - so the same app can run on both the client, and in a server console. I'll be creating some graph items to support Construct 2, along with some plugins, in the near future. After some discussions with Ashley, the first step in the goal is to use something like CEF (Google Chrome Embedded Framework), instead of a JavaScript only server, to get the WebRTC quickly off the ground. This will be made available in the DreamSpace Studio IDE.

Anyone interested in following the project can search CodePlex (or Google) DreamSpaceJS and click the "follow" link. I probably won't post about the progress here in the forums just yet until I run some trials with some demos first (we're getting close now! :) ).
Jack of all trades, and master of some.
B
30
S
9
G
7
Posts: 174
Reputation: 7,658

Post » Wed Aug 07, 2013 5:57 am

I'm following!

This looks like an ambitious project. If you are able to pull it off, so that client/servers can be easily written in C2, then it will be quite the achievement. I don't think any other engine out there can do that. If I can help in some way, let me know. I'm a programmer, but I have little experience in the way of networking. Or specific to gaming for that matter. So not sure how much help I can be.
B
10
S
4
G
1
Posts: 58
Reputation: 1,420


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests