does anyone here have any kind of tutorial on what manager classes are and how to use them?
I’ve been setting up my save system but I have 2 instances of my project, one is using the GUID system that I was working on with someone on the discord, the second is using this tutorial: https://www.youtube.com/watch?v=7gfA-QO5pA8 I want to compare and contrast the 2… see how scalable they are, see how well they work etc, when I asked about doing things like destroying objects that aren’t meant to be in the level, saving items that were added into the level, saving positions etc, what the creator of the video told me was this:
“Should handle it fine. You can have a manager class that keeps track of items like that in the world.”
I’ve done a lot of searching and can’t find what a “manager class” is, how to make one, or how to use one to save data
can anyone link me to a source for how to do this? Like I think I get the general idea of what they do, but what I need to know is the how, like someone demonstrating how to make and use one for something like this because honestly I’m stumped.
He’s simply referring to another actor class that specifically handles tracking.
I’m still really new to UE and to game dev in general, so, I get that idea in premise, but I’d really like to see some examples of it being used in practice, like some barebones version in a tutorial somewhere just to get the point across that I can then adapt to my own system.
This is something you have to create manually based on the “stuff” you want it to do.
General process is to create a new BP class of ACTOR type. With that Actor you get references of the actors in the level you want to track, destroy, save etc.
For example storing added actors you’d need an Array of structs. Struct would have a class reference and transform elements.
This is standard coding stuff, regardless the language. C, C#, C++, Python, Perl, Java etc.
Adding to this, you’ll want this to be an actor placed in the world. You’ll also want to implement a blueprint interface and add this BPI to the character/controller, The manager class and any actor you want to manage.
In the BPI you’ll write custom functions to call when actions occur in the world.
For example, When a new actor is spawned it will need to get a reference to the manager class and then call BPI function on the manager class. It should pass to the manager what class it is and its transform.
The Manager class would “Implement” the event in its graph and store the passed data in an array struct.
Manager class is going to be pretty intensive.
I… think I’m getting a general idea of this… it’s just going to take a lot of trial and error I guess… I’m just kinda lucky I created a separate version of my project specifically for testing save/load stuff.