Upcoming Socket.IO sneak peek
-
gfycat.com/ComposedShoddyAssassinbug
Left side is a web browser, right side is the hyperPad app. What you're seeing here is a real time chat application!
Took 10 behaviours to build it:
One behaviour to create the socket, and another one to connect to it:
Output the text to the server:
And listen to chat message event from the server:
-
Thats unfortunate, the video got cut off. But the web browser types something and it immediately shows up in the app.
-
What a terrible gif. It kept me in suspense then resets before it's resolved. You should never be a movie director.
Why didn't you just upload it to youtube or something?
-
Don't yell at me
-
Soooooo can this be used to create multiplayer
-
@DGames135 Yes
-
@Hamed like online multiplayer between two iPads
-
@DGames135 Yes. You would create a server using socket.io, then you can connect two iPads.
-
@Hamed OMG this will be the best Hyperpad update. When will this update comming? . Wait will this mean that when using the behaviour it will create a server???? 😍sorry so excited
-
@DGames135
No you need to create your own server.The left side with the web browser is the server/client side. The hyperPad app i simply connecting to his server.
See the "Socket" behaviour with the url: http://localhost:3000? That's where the connection is being made. The localhost is his server (it's using local host instead of a real IP or web address because it's a test server running on his own development machine).His server is running code to handle the chat. That's where the real part of all this is located. The hyperPad behaviours simply connect to it and know how to respond.
This isn't an easy behaviour to use, and isn't for beginners. This is why we held off on adding it for so long, because I firmly believed our community was not ready. Even still, I doubt it will be used much.. But the community keeps asking for it, so we decided to make it happen. Hopefully some cool stuff comes from this.
-
That being said, the server was only 20 lines of code and was also super easy to setup. I just used the example they have on socket.io
I should also mention that all networking behaviors are on developer tier, similar to the open URL behavior.
-
@Hamed I see a get array value behaviour... is this a networking behaviour or an actual behaviour? I'm currently working on implementing A* pathfinding into a project, but if arrays are in the next update and don't need developer, I think I'll wait for that... also, does socket.io mean we can have direct player to player connections where one player hosts a server?
-
arrays are not a networking feature. they will be available to everyone in the next update :)
-
As well as dictionaries (basically attributes but as a standalone behavior)
There's also bunch of other cool new behaviors related to arrays. We'll update the roadmap later today with more details.
-
@Hamed by networking, do you mean you need a server for it or is it just a category for behaviours?
-
Both. You need a server, and these are just a category (or subcategory) of networking behaviours.
These "networking" related behaviours (Socket, and HTTP requests) will connect to any server outside of hyperpad. This means you need a server, and code running on that server to send/receive and compute data.
We don't handle any of the server side stuff for you at all. That's on your end.
-
Updated roadmap: https://trello.com/b/EmwcGN1T/road-map-and-known-bugs
-
@Hamed wow I just looked at it...looks awesome!!!!!! When will it be out????!!!!!
-
@Murtaza never mind, I misread your previous post, I thought you said arrays ARE a networking behaviour but you said they AREN'T lol
-
@Hamed can an array be saved to file?