works

Plugins, tools, and games.

works/UE Plugins

Struct and Byte Conversion

On sale

SimpleByteConversion

Convert between basic types, structs, byte arrays, and JSON strings.

  • Data & Configuration
  • Simple series

Platforms:Windows (Win64) / macOS / Linux / Android / iOS

Requirements:UE 5.2–5.8

Back
This page's table of contents

Overview

SimpleByteConversion provides UE Blueprint interfaces for converting common data and structs to byte arrays, and converting structs to and from JSON strings.

Blueprint logic that needs network transfer, file storage, or data exchange with external programs can first obtain an explicit byte or text representation, then pass it to the appropriate communication or storage layer.

Background and goals

Getting a sendable byte array directly from integers, floating-point values, or custom structs in Blueprints is inconvenient. Data from different sources may also use binary or JSON representations.

The work organizes these basic conversions into callable nodes, reducing repeated interface development across projects while keeping conversion separate from subsequent transmission and persistence.

Core capabilities

Basic types and byte arrays

Paired ToBytes / FromBytes interfaces are provided for int32, int64, float, double, bool, and FString. Basic numeric values are written using their memory representation; strings use UTF-8.

These interfaces can encode data before sending or restore data received in the same format.

Binary struct conversion

StructToBytes and BytesToStruct handle custom structs. Blueprint interfaces accept different types through generic struct parameters, then output byte arrays or restore structs.

The struct type and field layout form a shared contract between both ends. A receiver cannot infer meaning from byte length alone.

Struct and JSON conversion

StructToJsonString and JsonStringToStruct convert between structs and readable text.

JSON is better suited to field inspection or exchange with external programs such as Python. The work also handles conversion issues in field names and floating-point output so results are easier to identify and review.

Use cases

It can prepare data for UDP/TCP communication in UE or convert structured state to bytes before file storage.

For external program integration, JSON can help verify fields. Network connections and file I/O in these examples must be supplied by other modules.

Scope and limitations

The conversion interfaces do not define a cross-language protocol. Structs containing object references or resource handles are not supported.

Sender and receiver must agree on types, fields, encoding, and versions, and verify round trips using fixed examples. Check compatibility with old data after struct changes. Successfully calling a conversion node does not mean the data has been interpreted correctly.

See the usage guide for steps and parameters.