Roland Bruggmann — Portfolio

Personal Pages

« Back to Main Page

Unreal Engine Plugin: ZeroMQ

Version: v2.0.1
Author: Roland Bruggmann

Description

Screenshot of Plugin Content

Screenshot of Plugin C++ Classes

A game plugin providing with ZeroMQ (aka zmq) assets using C++-bindings from CppZmq. This plugin supports the ZeroMQ PUB/SUB pattern.

Features

Contents

C++ Classes

Dependencies

The plugin was developed using Visual Studio 2019 with an UE4 Project enhanced as C++ code project. Third party C++-bindings from CppZmq may be found in directory /Source/ThirdParty/CppZmq.

Usage

Use the plugin as project plugin (folder MyProject/Plugins). Add the plugin by downloading and unpackaging an archive or using git clone:

git clone https://github.com/brugr9/ZeroMQ.git

Screenshot of Plugin


Table of Contents

1. C++ Classes

Screenshot of ZmqActors in Unreal Editor, tab ‘Place Actors’:

Screenshot of ZmqActors

Class Diagram ZeroMQ:

Class Diagram ZeroMQ

1.1. Zmq Context Actor

ZmqContextActor has:

Screenshot of ZmqContextActor details panel with variables:

Screenshot of ZmqContextActor details panel with variables

Screenshot of ZmqContextActor function and event dispatcher nodes:

Screenshot of ZmqContextActor function and event dispatcher nodes

1.2. Zmq Pub Socket Actor

ZmqPubSocketActor has:

Screenshot of ZmqPubSocketActor details panel with variables from Link Info:

Screenshot of ZmqPubSocketActor details panel

Screenshot of ZmqPubSocketActor function and event dispatcher nodes:

Screenshot of ZmqPubSocketActor function and event dispatcher nodes

1.3. Zmq Sub Socket Actor

ZmqSubSocketActor has:

Screenshot of ZmqSubSocketActor panel with variables from Link Info:

Screenshot of ZmqSubSocketActor

Screenshot of ZmqSubSocketActor function and event dispatcher nodes:

Screenshot of ZmqSubSocketActor function and event dispatcher nodes

1.4. Zmq Publish Component

ZmqPublishComponent has:

Screenshot of ZmqPublishComponent:

Screenshot of ZmqPublishComponent

1.5. Zmq Subscribe Component

ZmqSubscribeComponent has:

Screenshot of ZmqSubscribeComponent:

Screenshot of ZmqSubscribeComponent

2. Demo

As a demo, a cyan and a yellow cube each loops publishing a message ‘Hello from Cube Cyan’ with topic ‘Cyan’ or ‘Hello from Cube Yellow’ with topic ‘Yellow’ respectively using an instance of ZmqPubSocketActor. A third, green cube subscribes both topics ‘Cyan’ and ‘Yellow’ using an instance of ZmqSubSocketActor and prints the received messages to the Viewport and to the Output Log.

Screenshot of Demo Map:

Screenshot of Demo Map

Screenshot of Demo Level Blueprint:

Screenshot of Demo Level Blueprint

Screenshot of Demo Actor BP_ZmqPubDemoActor_CubeCyan:

Screenshot of Demo Actor BP_ZmqPubDemoActor_CubeCyan

Screenshot of Demo Actor BP_ZmqPubDemoActor_CubeYellow:

Screenshot of Demo Actor BP_ZmqPubDemoActor_CubeYellow

Screenshot of Demo Actor BP_ZmqSubDemoActor_CubeGreen:

Screenshot of Demo Actor BP_ZmqSubDemoActor_CubeGreen

Screenshot of Demo Map Playing:

Screenshot of Demo Map Playing

Demo map, starting PIE, output log:

LogZeroMQ: ZmqContextActor_2 Initialise context and socket(s) ...
LogZeroMQ: ZmqContextActor_2 Initialise context ...
LogZeroMQ: Number of I/O threads for this context: 1 threads.
LogZeroMQ: Maximum number of sockets allowed for this context: 10 sockets.
LogZeroMQ: Initialise socket ZmqPubSocketActor_1 ...
LogZeroMQ: ZmqPubSocketActor_1: Initialise socket ...
LogZeroMQ: ZmqSocketObject_6: Create socket ...
LogZeroMQ: ZmqSocketObject_6: Create socket done.
LogZeroMQ: ZmqPubSocketActor_1: Initialise socket done.
LogZeroMQ: Initialise socket ZmqPubSocketActor_1 done.
LogZeroMQ: Initialise socket ZmqSubSocketActor_1 ...
LogZeroMQ: ZmqSubSocketActor_1: Initialise socket ...
LogZeroMQ: ZmqSocketObject_7: Create socket ...
LogZeroMQ: ZmqSocketObject_7: Create socket done.
LogZeroMQ: ZmqSubSocketActor_1: Initialise socket done.
LogZeroMQ: Initialise socket ZmqSubSocketActor_1 done.
LogZeroMQ: ZmqPubSocketActor_1: Bind address tcp://127.0.0.1:5555 ...
LogZeroMQ: ZmqPubSocketActor_1: Bind address tcp://127.0.0.1:5555 done.
LogZeroMQ: ZmqSubSocketActor_1: Connect address tcp://127.0.0.1:5555 ...
LogZeroMQ: ZmqSubSocketActor_1: Connect address tcp://127.0.0.1:5555 done.
LogZeroMQ: BP_ZmqSubDemoActor_CubeGreen_2.ZmqSubscribe_Cyan Subscribe topic Cyan ...
LogZeroMQ: ZmqSubSocketActor_1 Subscribe topic Cyan ...
LogZeroMQ: BP_ZmqSubDemoActor_CubeGreen_2.ZmqSubscribe_Yellow Subscribe topic Yellow ...
LogZeroMQ: ZmqSubSocketActor_1 Subscribe topic Yellow ...
LogZeroMQ: ZmqContextActor_2 Initialise context and socket(s) done.
PIE: Server logged in
PIE: Play in editor total start time 0.103 seconds.
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Yellow: Hello from Cube Yellow #0
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Cyan: Hello from Cube Cyan #0
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Cyan: Hello from Cube Cyan #1
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Yellow: Hello from Cube Yellow #1
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Yellow: Hello from Cube Yellow #2
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Cyan: Hello from Cube Cyan #2
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Cyan: Hello from Cube Cyan #3
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Yellow: Hello from Cube Yellow #3
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Yellow: Hello from Cube Yellow #4
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Cyan: Hello from Cube Cyan #4
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Cyan: Hello from Cube Cyan #5
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Yellow: Hello from Cube Yellow #5
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Yellow: Hello from Cube Yellow #6
LogBlueprintUserMessages: [BP_ZmqSubDemoActor_CubeGreen_2] Received from Cyan: Hello from Cube Cyan #6
[...]

Demo map, stopping PIE, output log:

LogWorld: BeginTearingDown for /ZeroMQ/Demo/Maps/UEDPIE_0_Zmq_Demo
LogZeroMQ: ZmqContextActor_2 Close context and socket(s) ...
LogZeroMQ: ZmqPubSocketActor_1: Unbind address tcp://127.0.0.1:5555 ...
LogZeroMQ: ZmqPubSocketActor_1: Unbind address tcp://127.0.0.1:5555 done.
LogZeroMQ: ZmqPubSocketActor_1: Close socket ...
LogZeroMQ: ZmqPubSocketActor_1: Close socket done.
LogZeroMQ: ZmqSubSocketActor_1: Disconnect address tcp://127.0.0.1:5555 ...
LogZeroMQ: ZmqSubSocketActor_1: Disconnect address tcp://127.0.0.1:5555 done.
LogZeroMQ: ZmqSubSocketActor_1: Close socket ...
LogZeroMQ: ZmqSubSocketActor_1: Close socket done.
LogZeroMQ: ZmqContextActor_2 Close context ...
LogZeroMQ: ZmqContextActor_2 Close context done.
LogZeroMQ: ZmqContextActor_2 Close context and socket(s) done.

A. References

« Back to Main Page