So i am making a farming life simulator game, most things need to reference either the time system, or the player in some way. To top it off the few things that only reference one of them or doesn’t reference either of ends up loading the other into memory because they reference something that does. So what do i do? do i just keep going and hope the build is fine? I am aware of using say interfaces to interact with things instead of casting and I am even aware of soft references but from my understanding of soft references once they are loaded up they are just as loaded a s hard reference. And as such because everything references the time system they are all getting loaded regardless. Is there some way of soft referencing i am not aware of? Am i making a mountain out of a mole hill? I would really appreciate some advice on the subject
If these systems need to be loaded, they will be in memory anyway, so in effect it doesn’t really matter that they are referenced everywhere. Only one copy will be loaded.
Soft references and interfaces are a way of making sure things don’t load until they really need to be. But you do need to load this stuff, so nothing will be gained there.
The only thing I would say is that interfaces would make things neater. So no more casting and calling internals from outside a blueprint. You could put the systems inside the game instance, which can be called with an interface ( so again, no casting ).
That is what I was afraid of. At the very least this saves me days of work of trying to soft reference everything. I appreciate the response
What you need to avoid is to have actions or timers running on individual inatances…
welp, one thing you gain is editor startup time, if everything is hard referenced it gets slower and slower as project grows.
Not if they’re all referencing one thing…
And that one thing isn’t referencing a lot of other things. The most referenced object should have the least amount of dependencies on other objects.
especially if all are only referencing one thing but it’s hard to believe it’s only one thing tbh
Its not that they only reference one thing, its that most actors are referencing the same thing or same two things, either the time system or the player controller.
Thats fine, it should not cause any load issues so long as there is no casting involved or their own on tick checks…
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.