All Projects → PushkinStudio → PsData

PushkinStudio / PsData

Licence: MIT license
Flexible data model plugin for Unreal Engine 4

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to PsData

tsu
TypeScript plugin for Unreal Engine 4
Stars: ✭ 62 (+82.35%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4, ue4-plugin
ProceduralDungeon
This is an Unreal Engine 4/5 plugin to generate procedural dungeon.
Stars: ✭ 95 (+179.41%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4, ue4-plugin
PsWebServer
Civet web server integration plugin for Unreal Engine 4
Stars: ✭ 24 (-29.41%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4, ue4-plugin
Ue4 Style Guide
An attempt to make Unreal Engine 4 projects more consistent
Stars: ✭ 2,656 (+7711.76%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Grid
An UE4 plugin for grid-based game
Stars: ✭ 122 (+258.82%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Ue4 Gitignore
A git setup example with git-lfs for Unreal Engine 4 projects.
Stars: ✭ 150 (+341.18%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Gascontent
Repo to gather all Gameplay Ability System content for UE4
Stars: ✭ 398 (+1070.59%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Psrealvehicle
Plugin for Unreal Engine 4 with simple force-driven vehicle simulation
Stars: ✭ 92 (+170.59%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Actionrpggame
Unreal Engine 4 Action RPG type game starter kit.
Stars: ✭ 773 (+2173.53%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
DiscordGameSDK
Unofficial Unreal Engine 4 plugin for the Discord Game SDK
Stars: ✭ 20 (-41.18%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
BMeshUnreal
Based on BMesh for Unity (https://github.com/eliemichel/BMeshUnity). It provides a half-edge data structure inspired by Blender's BMesh, which makes many mesh manipulation operations simpler. Especially useful when using mesh data for logical instead of visual purposes (e.g. irregular grids)
Stars: ✭ 45 (+32.35%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Dungeontemplatelibrary
🌏: Dungeon free resources (terrain & roguelike generation)
Stars: ✭ 595 (+1650%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Pbcharactermovement
HL2-style, classic FPS movement for Unreal Engine 4 implemented in C++
Stars: ✭ 582 (+1611.76%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Rts Community Project
Lets build an RTS Game with Unreal Engine 4!
Stars: ✭ 183 (+438.24%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Unrealcpp
Unreal Engine 4 C++ examples
Stars: ✭ 490 (+1341.18%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Runtimemeshcomponent
Unreal Engine 4 plugin component for rendering runtime generated content.
Stars: ✭ 903 (+2555.88%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
Flopnite Ue4
A remake of the popular battle royale game, Fortnite, made in Unreal Engine 4 and integrated with Amazon GameLift
Stars: ✭ 250 (+635.29%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4
LivePP
A UE4 plugin wrapper for Molecular Matter's Live++ Hot-Reloading Library
Stars: ✭ 105 (+208.82%)
Mutual labels:  unreal-engine, ue4, ue4-plugin
ue4-uitween
Unreal 4 UMG UI tweening plugin in C++
Stars: ✭ 178 (+423.53%)
Mutual labels:  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 (+758.82%)
Mutual labels:  unreal-engine, ue4, unreal-engine-4

PsData

Flexible data model plugin for Unreal Engine 4

Examples

Define PsData classes:

// Assume that you project called 'Foo'

#include "PsDataAPI.h"

// Enum

UENUM(BlueprintType)
enum class EFooDamageType : uint8
{
    None = 0,
    Pure = 1,
    Physical = 2,
    Psi = 3,
    Pierce = 4
};
DESCRIBE_ENUM(EFooDamageType);

// Character data class

UCLASS()
class UFooCharacterData : public UPsData
{
    GENERATED_BODY()

    /** Weapon damage type */
    DPROP(EFooDamageType, DamageType);

    /** Current health value */
    /** DMETA(Event) means that this property can fire events when it will changed */
    DMETA(Event)
    DPROP(int32, Health);

    /** Equipmented weapon */
    /** This is property with other PsData class type */
    DPROP(UFooWeaponData*, EquipmentedWeapon);

    /** Current location on the battlefield */
    /** DMETA(Strict) means that this property was be constructed by default and cannot be null or be reset */
    DMETA(Strict)
    DPROP(UFooPointData*, Location);

    /** Abilities */
    /** This is array property */
    DARRAY(UFooBattleAbilityData*, BattleAbilities);

    /** Link to the character prototype */
    DPROP(FString, CharacterProtoId);
    DLINK(UFooCharacterProtoData, CharacterProtoId, Prototypes.Characters);

    /** Link to the current battle target */
    /** DMETA(Nullable) means that this link can be null */
    DPROP(FString, TargetId);
    DMETA(Nullable)
    DLINK(UFooCharacterData, TargetId, Game.Battle.Characters);

protected:
    /** Some kind of constructor */
    void InitProperties() override
    {
        SetDamageType(EFooDamageType::Physical);
    }
};

UCLASS()
class UFooPointData : public UPsData
{
    GENERATED_BODY()

    DMETA(Event, Bubbles)
    DPROP(int32, X);

    DMETA(Event, Bubbles)
    DPROP(int32, Y);

public:
    FIntPoint GetIntPoint() const
    {
        return FIntPoint{GetX(), GetY()};
    }
};

Root of the model:

// Root of the data model

UCLASS(Blueprintable, BlueprintType)
class UFooRootData : public UPsData
{
    /** Game state */
    DMETA(Strict)
    DPROP(UFooGameData*, Game);


    /** Static world data */
    DMETA(Strict)
    DPROP_CONST(UFooPrototypesData*, Prototypes, FFooPrototypesDataAccessor);
};


////////////////////////////////////////////////////////
// Accessors for mutation of root data const members

class FFooPrototypesDataAccessor
{
private:
    // Only classes that need modifying static world data
    friend UFooDataController;

    static UFooPrototypesData* GetMutablePrototypes(UFooRootData* RootData)
    {
        return RootData->GetMutablePrototypes();
    }
};

Work with the model:

void UFooDataController::Init()
{
    // Create root node
    RootData = NewObject<UFooRootData>();

    // Get pointer to the mutable data
    auto PrototypesData = FFooPrototypesDataAccessor::GetMutablePrototypes(RootData);

    // Deserialize from UDataTable asset PrototypesDataTableAsset
    auto Deserializer = FPsDataTableDeserializer(PrototypesDataTableAsset, PrototypesData->GetCharacters());
    PrototypesData->DataDeserialize(&Deserializer);

    auto Characters = PrototypesData->GetCharacters();
    for (auto const Proto : Characters) {
        auto GameCharacter = NewObject<UFooCharacterData>();
        GameCharacter->SetCharacterProtoId(Proto->GetDataKey());
        // Setup character...

        // Add into the game state
        RootData->GetGame()->GetCharacters().Add(GameCharacter);
    }
    //...
}
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].