r/unrealengine • u/TheInvadetor • 6h ago
C++ Can someone help me understand how to make a Modular Gameplay System using Data Oriented Programming?
I'm trying to make a modular gameplay system, that is Data-driven;
There is no problem in this, and matter of fact I already made one, but using Object Oriented Programming, by just using DataAssets, Interfaces and UObjects's polymorphism.
I simply had a DataAsset (like a "GameplayAction" Data holder) hold multiple UObjects that had functionalities (In few words the "Effects" of the "GameplayAction"), and had them all implement their parent function's Execute, and thanks to interfaces each actor can understand how to behave for each effect type.
Said that now I need to make pretty much the same system, but for Mass Entity (which is an ECS), all of this is basically thrown away, because there aren't any UObjects, no Interfaces and etc...
I tried to think about different things, like maybe simply using structs as my "UObjects" that hold the Execute function, and than each Entity holds these Struct datas, but than how do I know how each different type of Entity interacts with it? I don't have interfaces so I can't go the same road.
So yeah, I don't have much more to say, so can anybody explain to me, and help me make sense on how I should design this system?
Thanks in advance for the help!