Hi there! I have spent a while on UE4 (I am fairly new) and I’m starting to get the gist of the workflow. I used to work on Unity, but I really wanted to work on Unreal because I think it’s time for an upgrade :p. Anyways, there was something that I wanted to create that I managed to get in Unity, and I’m wondering if I can replicate it here?
First things first, I am working in C++. I know the language decently so I shouldn’t have a problem with that.
Ok so in Unity, I made this thing called the Survival system. Think of a typical survival game -> there’s always health, hunger, stamina etc. All of these share some common values like their currentValue, or their maxValue, or their depletionRate etc. We can think of each of these as “Subsystems”. In my survival system I created a parent class called BaseSystem. This class essentially has all the variables that each subsystem will contain. Then, for each subsystem (like health for example), I create a new class which inherits from BaseSystem. Ideally, all subsystems will derive from BaseSystem. In this particular subsystem, I can define more unique variables and methods.
This approach has been very flexible with me in Unity. Once I have made all the subsystems, I create another class called Character. In unity, this was a component that would be attached to the player object. Character will be the place where I declare what subsystems I’ll be using. Then, I can call their methods in Start or Update.
I hope to do something similar in Unreal. I am starting off from the Third Person Template that you can choose from when you create a project in Unreal. My question is, will my approach in unity be the same?
What I know so far is that when I make the subsystem classes and BaseSystem, I want them to derive from UObject. The class called Character that I made in Unity will be replicated in the form of an ActorComponent. Is this a good start?
Additionally, I am also concerned about this : In Unity, I can edit the values for each subsystem declared within the inspector. Unreal has a similar window : the details panel. I know that you can expose properties by calling UPROPERTY on an individual variable. If I do this on classes, will all the individual variables of that class be exposed?
Thanks and let me know if I have to be more clear!