Socket.io Client Plugin

I’m a big fan of web technology. Scripting in javascript makes me jealous that VR development isn’t quite as easy just yet, with this release that development gap hopefully shrinks just a little bit.

For the third London is Unreal meetup I made a presentation on the topic of plugins and chose to implement a useful plugin live during the presentation. A socket.io client was chosen as the plugin, which was finished with a basic Connect, Bind, Emit functions and an On event all interfaced through an Actor Component. Doing this in a small time frame was a daunting task, but something I was certain was doable. While I didn’t meet my target of 15min for the live implementation, within 25minutes the whole meetup was chatting away from their phones with a UMG chat widget in the game engine.

The presentation slides can be found here.

If you’ve haven’t heard of socket.io before, it is a performant real-time bi-directional communication library. There are two parts, the server written in node.js and the client typically javascript for the web. There are alternative client implementations and I’ve used the C++ client library and ported it to UE4. In sum, it makes networking very easy, real-time and flexible.

How does this look like in blueprints?

After adding the new plugin component to your actor of choice

lskfhq2

You connect and bind functions of choice

rjm2pkw

which you can receive as events

0bcfoos

and emit equally easily

eoadata

A C++ version of this setup is available and I encourage you to check out the main forum thread and github repository for more details.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s