The famous websocket arrival...

Get help using Construct 2

Post » Mon Jan 21, 2013 5:14 pm

Hi all "constructeurs" in here, i am an avid fan and user of Construct2 and after the newest beta 116 websocket was introduced. The problem i need some kind of tutorial to learn how to use this new feature and what server and eventually a capx file so i can sniff out whats going on.

So if someone kind soul feels the power to do such a tutorial i would be in deep gratitude.

Best regards

Dennis
Denmark
B
16
G
2
Posts: 12
Reputation: 1,648

Post » Wed Jan 23, 2013 6:15 am

Agreed, simple tutorial about how to get started with the new websocket feature would be nice, it could be simple as sending text to websocket server and displaying that text in-game (from server).
B
7
S
1
Posts: 51
Reputation: 1,087

Post » Wed Jan 23, 2013 12:59 pm

Same questions here.
Is it possible to use an existing php websocket server ?
If no, do you have any link to create a simple one ? A tutorial not the php manual.
Thanks !
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Thu Jan 24, 2013 6:34 pm

Bump, would be lovely to get some sort of example. As far I see this could be used to make some sort of turn based games, for example something like Tic Tac Toe.

My upcoming game would benefit from this alot, if indeed I could use web socket to create turn based games.CoffeeOD2013-01-24 18:35:39
B
7
S
1
Posts: 51
Reputation: 1,087

Post » Thu Jan 24, 2013 6:49 pm

As these bits are still in Beta, most likely they are still working on it. I would figure that you will see tutorials on these when they have the next stable release (non-beta) that has these features fully implmented. Just a possibility.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Thu Feb 14, 2013 4:08 am

I've been working with it
I'm using it instead of the zackowack one simply because of how it works.

unlike zackowack socket the new websocket plugin uses true websocket type protocol.

but be forewarned it will NOT work with node and socket.io from what I have been able to figure out.

I'm using a Custom C# server that I've been developing to work with the true websocket protocol that the new one uses.

I like this new one for the simple fact I can use C# (since its *true* webscokets protocol) and send JSON data back and forth via rex's hash table plugin.briermay2013-02-14 05:10:34
B
6
S
1
G
1
Posts: 19
Reputation: 664

Post » Thu Feb 14, 2013 5:43 am

@briermay: The manual entry for websockets seems to indicate that node.js with a websocket support should do the trick.

Can you give more informations on your experiment and what makes you say it's not working ?
Perhaps even file a bug report to notify @Ashley there might be an issue.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Thu Feb 14, 2013 8:50 am

I simply loaded an empty new project added the websocket and tried to connect to my node server I was running when I was using zakos plugin and watched the console (i had it in debugging mode) and it never even showed the connect.

True websockets use a different protocol:

example of websocket address: ws://host:port/service

socket.io simply uses ip and port

everything I can find on node and socket.io you need to use the socket.io client script as socket.io on node implements its own structure hence the emit events system.

I fought with it for 4 hours and ended up just using a C# back-end serverbriermay2013-02-14 08:55:51
B
6
S
1
G
1
Posts: 19
Reputation: 664

Post » Thu Feb 14, 2013 10:21 am

@briermay: The manual entry states Node.js websocket server.
Zack0's plugin has nothing to do with the current websocket plugin (it is/was a thrid-part plugin).

According to this article you may install/use the node websocket server (several versions linked in the article).

Would you mind having another go at it with a websocket module on your node.js server to make sure there's definitely an issue ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Thu Feb 14, 2013 11:31 am

you would need to do a lot of "hacks" to get that to work as it expects JSON coming in and it sends JSON to the client. hence that if you read that it requires a "front end" script that the new websockets plugin doesn't supply.

the websocket plugin as is has no JSON support

I guess if you wanted to you could use rex's hash table to read the JSON and process the out going messages to JSON by hand but it looks funky.

that setup with node expects stuff coming in to look like this

{"Type":0,"Name":"Briermay"}

most novice users will find the new websocket plugin useless as its just a bare-bones wrapper around the websocket protocol and would be better off to stick with the socket.io version for now.briermay2013-02-14 11:40:22
B
6
S
1
G
1
Posts: 19
Reputation: 664

Next

Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Matthew de, Skebab, spcsmrf and 6 guests