WebSockets: What do you want?

Post your work in progress addons and get feedback

Post » Mon Sep 09, 2013 12:46 pm

Adding a wait in between makes the simple demo more convincing. It's not performing the same operation as the arrow keys. I think that's the core problem here. Anyways ... this may be enough for my very first proof of concept experiment. You're right on track newt ... next step is to think about what it would take to assure things are in sync.

Whether or not this can work really well can depend on whether I can get a solid understanding of how Construct 2 works and whether I'll be able to perform the operations of the game via server input (if I may think in print by stating the obvious).

It seems quite oriented to people who don't program so I'm wondering if they're just not going to be interested in sharing any detailed technical information. I know there's an SDK. Maybe that's enough.
B
6
S
1
Posts: 76
Reputation: 606

Post » Mon Sep 09, 2013 1:42 pm

[QUOTE=newt] Yeah you can either have the server send a 0 after x amount of time, or have the client do it.
Of course if the client does it you run the chance of getting out of sink.

Then again the ideal method would be to do all the movement on the server, and just update the position data, then all the client would do is interpolate the xys, etc.[/QUOTE]

Seems like I always have to think at least twice whenever you post. :)

I recalculated and kept track of position in a robot control center I built to demo the prototype of the HLL Framework ... at that time using a workaround for websockets since they didn't exist yet. Then passed position information to the browser that controlled an SVG object that moved around in an image of rooms (walls and doors).

That was ok.
B
6
S
1
Posts: 76
Reputation: 606

Post » Mon Sep 09, 2013 1:46 pm

Now I've even exported to HTML 5 and put it on my dev system's server. Only works when I have the two servers running though. Dev system isn't the same as the demo computer I'm running for the other WebSocket demo ... which is full time.

Arrows cause movement but do nothing with websocket. czsx send r, l, u, d websocket commands which are returned as JSON strings. You get approx. the same movement with both.

http://isr.servequake.com:8080/WSGameTest/
B
6
S
1
Posts: 76
Reputation: 606

Post » Mon Sep 09, 2013 2:15 pm

So, my next question is: How does the HTML 5 page work? c2runtime is rather small. Does that load and provide all the needed support? Even for the webocket calls? Or does anyone who uses this have to have a game engine installed first?
B
6
S
1
Posts: 76
Reputation: 606

Post » Mon Sep 09, 2013 10:03 pm

Its all Html5 standard. The idea was no dependencies, no plugs.
Just think of each C2 game as blind mini server.
Image ImageImage
B
169
S
50
G
169
Posts: 8,286
Reputation: 108,216

Post » Tue Sep 10, 2013 7:01 am

Seems to work for me. :)

How hard is it to connect my websocket server to Construct 2?

OK, after spending a 3 day weekend on it: The answer is that the very simple app that I built would have been really easy had I understood Construct 2 to begin with. I was lucky to find someone helpful in the forum to get some hints on how to start. This was actually my first time using a "no programming" game development system. (I could have done it in under and hour if I had programmed from scratch.)

Now, it would be great to work with someone who has much more experience with Construct 2 to put together a series of trials / examples for controlling actions in response to input. "No programming" approaches often have limitations, but there does seem to be hope for Construct 2. It's even possible to build addons to extend the system and maybe that would be needed to support sophisticated behavior control via text commands. I don't know. That seems like the next question.

rogerfgay2013-09-10 07:17:25
B
6
S
1
Posts: 76
Reputation: 606

Post » Thu Sep 19, 2013 11:51 pm

I really hope somebody teams up with you on this ! I've been so surprised to see that the community is so lax about Multiplayer functionality, although I am a little biased as I only started researching Construct 2 to build a Multiplayer game I had though of and have been sorely disappointed ever since.

It's very rare an expert pops up willing to build a plugin, can somebody please please work with this guy !?

Best of luck !
B
2
Posts: 3
Reputation: 156

Post » Sat Sep 21, 2013 4:00 pm

Thanks phuse. It's nice to see some interest. Someone did help me and I got a simple demo going using the free version of Construct 2 ... so, proof of concept. I guess my last post explains that.

Since last I posted, I've started building a demo game from scratch. It's getting pretty close and I expect to unveil it in my blog next week. I'm sure people with game development experience could build a more interesting game with better graphics, but it's a good learning experience for me at the very least. I'm feeling slightly less like a newbie to the game world every day.

http://highlevellogic.blogspot.se/
B
6
S
1
Posts: 76
Reputation: 606

Post » Sun Sep 22, 2013 6:56 pm

@phuse, I am currently working on a C2 plug-in that would support the ASP.NET SignalR library. SignalR support websocket but also long polling in case the user's browser does not support websocket.

The server backend would be all C# but the front end can support JavaScript (a Construct 2 plug-in).

So far, I have been able to connect to my SignalR server from C2. I am now looking into connecting into server functions and vice versa.

I will post a new plug-in thread as soon as I do have a working prototype.
B
21
S
6
G
5
Posts: 51
Reputation: 4,999

Post » Sun Sep 22, 2013 7:58 pm

Hi there, i am also in websocket development myself. I have done more than 1 year of research in websockets in my previous projects. I have a full C# server backend that is working pretty well with my c2 client i have just done. I think a new plugin is useless because to have full control over your game only sending receiving a message is all you need. Construct2 will only serve as handling thoses queries and represent the state od your game. All the logic must remain on the server. Ive read your first post and what happen basically is that the server only know the positions of players then it broadcast this position over all client. Also keep in mind that security is important factor in all this. You need to validate all the queries sent to the server... even the collision must be server side. I added all thoses security features on the server including login etc.. it work with a sql database foe the data and have full logging features. I am pretty sure something like this would be useful here but its all C# i am not sure if many are familliar with that language. Sorry for grammar errors i am writting off a mobile phone.
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

PreviousNext

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 0 guests