Is it a bad idea to put preloads into autoloads?
Asked Answered
D

2

0

Basically, i have a global script in which i preload() every room the player can enter. So if the player enters a door, i just call the autoload to instantiate the scene the player's supposed to end up in. It works pretty well, but i'm not sure if this is a good practice?

As i understand it, preloading something keeps the scene loaded even when it's not being used, so would having a lot of rooms preloaded eventually lead to performance issues?

Dumbstruck answered 28/2 at 7:49 Comment(0)
C
1

Dumbstruck i am doing a project with an architecture similar to yours. I have seen no issue. If it is doing what you need it to do, I wouldn't overthink it.

For larger scenes, you may want to load upon reaching them, but I hardly have to do this.

Worry about the problems when they show up and actually affect the game.

Colan answered 2/3 at 0:13 Comment(0)
P
1

Certainly increases the memory used, but unless you hit virtual memory where it starts swapping to disk cache I don't think it should affect performance all that much as such... though if you are constantly loading and unloading data to/from the GPU that can indeed affect performance as well. To really know you need to profile it.

Pip answered 28/2 at 11:46 Comment(0)
C
1

Dumbstruck i am doing a project with an architecture similar to yours. I have seen no issue. If it is doing what you need it to do, I wouldn't overthink it.

For larger scenes, you may want to load upon reaching them, but I hardly have to do this.

Worry about the problems when they show up and actually affect the game.

Colan answered 2/3 at 0:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.