Thanks for an informative video. I understand the theory now, but in practice I'm kinda screwed... My Game Instance is my hub, it holds all sorts of variables and references that I want to access from everywhere, so a lot of my actors have a hard reference to this Game Instance and thus they all basically load the entire game with them (or close). I hope it won't be too much of a problem down the line as it's a project on the smaller scale but now I'm scared xD So it's something to know hard references must be avoided but it's something else to systematically do so. Edit : well it's even worse than than, as soon as I use a single function from my Function Library or a Macro, the SizeMap immediately jumps to 880mo x|
Yeah that's pretty bad you don't want everything loaded all at once even on smaller projects you start to get larger and larger files loading all at once I may put out another video on what you are dealing with and how to work around it but for now I'd say your best bet is interfaces or similar methods that could get you what you need without hard references
@@Spacemarine658 Haha thanks I'd watch that video ^^ Looking at the Size Map some more I think I could maybe get away with all this if I managed to at least put some heavy assets like Audios behind soft references. They represent a very big chunk of the total weight, almost half of it actually! 400mo out of the 880mo are audios, dang. Then there are a few heavy textures but I don't know what I'll be able to "softened" here. It's going to be an interesting exercise.
Wouldn’t the optimisation there be that passing a pointer is more optimal, because passing an object is copying the memory. E.g. if you had a object/actor/subsystem responsible for tracking hundreds of entries in data and something wants to access that, you probably don’t want to copy it around, but instead pass by reference
@@filipanicic771 eh but the actual way they work is a pointer points to the object vs a reference is another name for that same object. It doesn't copy the entire object it says here is the memory address of said object so direct changes could be made in it vs a pointer would say here is my memory location you'll need to dereference me to access the original. In terms of actual performance there's not much of a difference as both will load the object into memory if it isn't already.