• Stars
    star
    293
  • Rank 140,938 (Top 3 %)
  • Language
    C++
  • License
    MIT License
  • Created over 6 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Convenience UDP wrapper for the Unreal Engine.

UDP-Unreal

Convenience ActorComponent UDP wrapper for Unreal Engine 4.

GitHub release Github All Releases

This may not be the most sensible wrapper for your use case, but is meant to co-exist with https://github.com/getnamo/SocketIOClient-Unreal with similar workflow.

Wraps built-in ue4 udp functionality as an actor component (UDPComponent) with both sending and receiving capabilities. Works through the c++ FUDPNative wrapper which can be included and re-linked in a custom non actor component class if desired.

Confirmed working with node.js dgram (see example echo server gist for testing).

Quick Install & Setup

  1. Download Latest Release
  2. Create new or choose project.
  3. Browse to your project folder (typically found at Documents/Unreal Project/{Your Project Root})
  4. Copy Plugins folder into your Project root.
  5. Plugin should be now ready to use.

How to use - Basics

Select an actor of choice. Add UDP component to that actor.

add component

Select the newly created component and modify any default settings

defaults

By default the udp actor component will auto open both send and receive sockets on begin play. If you're only interested in sending, untick should auto open receive; conversely untick auto open send if you're not interested in sending.

Also if you want to connect/listen on your own time, untick either and connect manually via e.g. key event

manual open receive

Receive Ip of 0.0.0.0 will listen to all connections on specified port.

Sending

Once your sending socket is opened (more accurately prepared socket for sending, since you don't get a callback in UDP like in TCP), use emit to send some data, utf8 conversion provided by socket.io plugin. NB: if you forget to open your socket, emit will auto-open on default settings and emit.

emit

returns true if the emit processed. NB: udp is unreliable so this is not a return that the data was received on the other end, for a reliable connection consider TCP.

Receiving

events

Once you've opened your receive socket you'll receive data on the OnReceivedBytes event

receive bytes

which you can convert to convenient strings or structures via socket.io (optional and requires your server sends data as JSON strings).

Receiving on Bound Send port

Since v0.9.5 when you open a send socket it will generate a bound send port which you can use to listen for udp events on the receiving side. This should help NAT piercing due to expected behavior.

To use this feature can use Should Open Receive To Bound Send Port which will cause any receive open to automatically bind to your send ip and send bound port.

auto open bound send port

Or if you want to manually do this you can untick Should Auto Open Receive and then open with own settings on e.g. send socket open event with the bound port.

open bound send port

Reliable Stream

Each release includes the socket.io client plugin, that plugin is intended to be used for reliable control and then real-time/freshest data component of your network can be piped using this udp plugin. Consider timestamping your data so you can know which packets to drop/ignore.

Packaging

C++

Works out of the box.

Blueprint

If you're using this as a project plugin you will need to convert your blueprint only project to mixed (bp and C++). Follow these instructions to do that: https://allarsblog.com/2015/11/04/converting-bp-project-to-cpp/

Converting project to C++

e.g. Using the File menu option to convert your project to mixed by adding a C++ file.

Notes

MIT licensed.

Largely inspired from https://wiki.unrealengine.com/UDP_Socket_Sender_Receiver_From_One_UE4_Instance_To_Another.

More Repositories

1

TensorFlow-Unreal

TensorFlow plugin for the Unreal Engine.
C++
1,133
star
2

SocketIOClient-Unreal

Socket.IO client plugin for the Unreal Engine.
C++
845
star
3

GlobalEventSystem-Unreal

Loosely coupled internal event system plugin for the Unreal Engine.
C++
257
star
4

NodeJs-Unreal

Embed node.js as an Unreal Engine plugin.
C++
238
star
5

TensorFlow-Unreal-Examples

Drag and drop Unreal Engine TensorFlow examples repository.
Python
218
star
6

7zip-cpp

Fork of SevenZip++ for modern builds.
C++
206
star
7

ZipUtility-Unreal

Event driven 7zip utility plugin for the Unreal Engine.
C++
194
star
8

MachineLearningRemote-Unreal

Machine Learning plugin for the Unreal Engine, encapsulating calls to remote python servers running e.g. Tensorflow/Pytorch.
C++
135
star
9

TCP-Unreal

Convenience TCP wrapper for Unreal Engine
C++
96
star
10

SocketIOClient-Unreal-Example

sample project using the socketio-client-ue4
HTML
88
star
11

hydra-ue4

Hydra Plugin for Unreal Engine 4
C++
75
star
12

myo-ue4

Myo Plugin for Unreal Engine 4
C++
51
star
13

TensorFlowNative-Unreal

Tensorflow Plugin for Unreal Engine using C API for inference focus.
C#
42
star
14

realsense-ue4

RealSense plugin for Unreal Engine 4
C++
40
star
15

RuntimeGeometryUtils

Fork of https://github.com/gradientspace/UnrealRuntimeToolsFrameworkDemo plugin for inclusion as submodule
C++
23
star
16

ml-remote-server

Server component of https://github.com/getnamo/machine-learning-remote-ue4
Python
22
star
17

WeaponTrace-Unreal

WeaponTracing plugin for reliable melee combat.
20
star
18

CIMPlugin

Custom Input Mapping Plugin for the Unreal Engine 4
C++
19
star
19

UE4-MouseIKThirdPerson

Simple Unreal Engine third person template project with mouse click left arm movement.
15
star
20

VRArmIK-ue4

UE4 port of https://github.com/dabeschte/VRArmIK
C++
12
star
21

BodyState-Unreal

An abstract skeleton target for body tracking input devices
C++
10
star
22

RVD-Unreal

Real-time Value Debugger for the Unreal Engine.
C++
10
star
23

TensorFlowJs-Unreal

Tensorflow.js Plugin for Unreal Engine using Node.js plugin.
C#
8
star
24

socketio-client-prebuild

socket io client static library builds for UE4
Batchfile
7
star
25

BulkManager-Unreal

Plugin for managing a bulk of actors with data through programmatic relevancy.
C++
7
star
26

EnvCommand-Unreal

Access environment commands from bps
C++
6
star
27

SIONetworking-Unreal

simple echo networking using socket.io and ges
JavaScript
6
star
28

mnist-draw-server

server counterpart for drawing on webclients and sending via socket.io to ue4 mnist classifier client
JavaScript
3
star
29

clean-ue4

Simple npm script to clean Intermediate, Saved folders, and .pdbs from unreal projects and plugins for release prep.
JavaScript
2
star
30

BasicDatabase-Unreal

Simple wrapped DB API for json flatfile database & potentially more backends.
C++
2
star
31

PiperCLI-Unreal

Experimental Piper plugin for Unreal via CLI wrapper.
C++
2
star
32

AnswerHubMisc

Various answer/example projects
1
star
33

batch-resizer

Batch resize images using npm sharp and exif-parser
JavaScript
1
star