All Projects → slowburn-dev → DataConfig

slowburn-dev / DataConfig

Licence: MIT license
Unreal Engine JSON/MsgPack serialization framework

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to DataConfig

Ue4 Style Guide
An attempt to make Unreal Engine 4 projects more consistent
Stars: ✭ 2,656 (+3179.01%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
Buoyancysystem
A system for buoyancy and boat physics in Unreal Engine 4.
Stars: ✭ 87 (+7.41%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
LocalizationUE4
Translation Editor for Unreal Engine 4
Stars: ✭ 59 (-27.16%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4, ue5
Actionrpggame
Unreal Engine 4 Action RPG type game starter kit.
Stars: ✭ 773 (+854.32%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
Unreal Polygonal Map Gen
An Unreal Engine 4 implementation of the Polygonal Map Generator for generating islands found at http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/
Stars: ✭ 229 (+182.72%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
Rts Community Project
Lets build an RTS Game with Unreal Engine 4!
Stars: ✭ 183 (+125.93%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
Ue4 Binary Builder
An application designed to create installed Unreal Engine builds (aka Rocket builds) from Unreal Engine GitHub source.
Stars: ✭ 292 (+260.49%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
Unrealcpp
Unreal Engine 4 C++ examples
Stars: ✭ 490 (+504.94%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
Unreal-Binary-Builder
An application designed to create installed Unreal Engine builds (aka Rocket builds) from Unreal Engine GitHub source.
Stars: ✭ 554 (+583.95%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
gamedevguide
Game Development & Unreal Engine Programming Guide
Stars: ✭ 314 (+287.65%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
ProceduralDungeon
This is an Unreal Engine 4/5 plugin to generate procedural dungeon.
Stars: ✭ 95 (+17.28%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4, ue5
ue5-style-guide
An attempt to make Unreal Engine 4 projects more consistent
Stars: ✭ 2,892 (+3470.37%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
RuntimeBPs
This project allows for visual scripting in UE4 similar to Blueprints, but at runtime. The way this is set up does not make use of any UE4 boilerplate and could with a few adjustments be used in another engine.
Stars: ✭ 77 (-4.94%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
Unreal-Development-Guides-and-Tips
High-level concept explanations, detailed tutorials, performance considerations, shortcuts and other useful content that aims to improve your Unreal Engine 4 development journey.
Stars: ✭ 118 (+45.68%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
Ue4 Gitignore
A git setup example with git-lfs for Unreal Engine 4 projects.
Stars: ✭ 150 (+85.19%)
Mutual labels:  unrealengine, unreal-engine, ue4, unreal-engine-4
Unrealnetworkprofiler
A modern WPF based Network Profiler for Unreal Engine.
Stars: ✭ 29 (-64.2%)
Mutual labels:  unrealengine, unreal-engine, ue4
PsData
Flexible data model plugin for Unreal Engine 4
Stars: ✭ 34 (-58.02%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Nano
A tiny template for tiny Unreal games.
Stars: ✭ 117 (+44.44%)
Mutual labels:  ue4, unreal-engine-4, ue5
UE4-Plugin-OffAxis
This plugin provides a fishtank-VR via a so-called OffAxisProjection by modifying the projection matrix using a custom ULocalPlayer
Stars: ✭ 59 (-27.16%)
Mutual labels:  unrealengine, unreal-engine, unreal-engine-4
Ue4linuxlauncher
Stars: ✭ 79 (-2.47%)
Mutual labels:  unrealengine, ue4, unreal-engine-4

DataConfig

Serialization framework for Unreal Engine that just works!

Unreal Engine features a powerful Property System which implements C++ runtime reflection. DataConfig is a serialization framework build on top of it. Notably features:

  • Out of the box JSON/MsgPack read write.
  • Full support for UPROPERTY()/UCLASS()/USTRUCT()/UENUM().
  • Pull/Push styled API for verbatim data access and lossless type infomation.
  • Designed as a collection of tools that can be easily extended to support other formats.

Documentation

See DataConfig Book for details.

Example

Given a struct annotated and processed with Unreal's Property System:

UENUM()
enum class EDcTestExampleEnum
{
    Foo, Bar, Baz
};

USTRUCT()
struct FDcTestExampleStruct
{
    GENERATED_BODY()
    UPROPERTY() FString StrField;
    UPROPERTY() EDcTestExampleEnum EnumField;
    UPROPERTY() TArray<FColor> Colors;
};

DataConfig can deserialize an instance from JSON with the snippet below:

FString Str = TEXT(R"(
    {
        "StrField" : "Lorem ipsum dolor sit amet",
        "EnumField" : "Bar",
        "Colors" : [
            "#FF0000FF", "#00FF00FF", "#0000FFFF"
        ]
    }
)");

FDcTestExampleStruct Dest;

//  create and setup a deserializer
FDcDeserializer Deserializer;
DcSetupJsonDeserializeHandlers(Deserializer);
Deserializer.AddPredicatedHandler(
    FDcDeserializePredicate::CreateStatic(DcExtra::PredicateIsColorStruct),
    FDcDeserializeDelegate::CreateStatic(DcExtra::HandlerColorDeserialize)
);

//  prepare deserialize context
FDcPropertyDatum Datum(&Dest);
FDcJsonReader Reader(Str);
FDcPropertyWriter Writer(Datum);

FDcDeserializeContext Ctx;
Ctx.Reader = &Reader;
Ctx.Writer = &Writer;
Ctx.Deserializer = &Deserializer;
DC_TRY(Ctx.Prepare());

//  kick off deserialization
DC_TRY(Deserializer.Deserialize(Ctx));

//  validate results
check(Dest.StrField == TEXT("Lorem ipsum dolor sit amet"));
check(Dest.EnumField == EDcTestExampleEnum::Bar);
check(Dest.Colors[0] == FColor::Red);
check(Dest.Colors[1] == FColor::Green);
check(Dest.Colors[2] == FColor::Blue);

Note that enum is deserialized by its name and FColor is deserialized from a html color string like #RRGGBBAA.

Say if we accidentally mistyped the EnumField value:

{
    "StrField" : "Lorem ipsum dolor sit amet",
    "EnumField" : "Far",

DataConfig would fail gracefully with diagnostics:

# DataConfig Error: Enum name not found in enum type: EDcTestExampleEnum, Actual: 'Far'
- [JsonReader] --> <in-memory>4:25
   2 |    {
   3 |        "StrField" : "Lorem ipsum dolor sit amet",
   4 |        "EnumField" : "Far",
     |                           ^
   5 |        "Colors" : [
   6 |            "#FF0000FF", "#00FF00FF", "#0000FFFF"
- [PropertyWriter] Writing property: (FDcTestExampleStruct)$root.(EEDcTestExampleEnum)EnumField

License

DataConfig is released under MIT License.

It would be trememdously helpful if you credit us in your projects. See the license page for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].