Jump to content
  • Advertisement
Sign in to follow this  
Akusei

Loading assets

This topic is 2584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In regards to memory usage and performance; is it better to load all assets into memory at initialization of the game or to load them from disk into memory as you need them and maybe even delete them when you're not using them?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
I like to load the assets for the current level or game area that I need at loadtime. Its possible to load them in on a different thread as you need them, both have been done, you can just profile your code and see which is more efficient.

Share this post


Link to post
Share on other sites
If you can fit everything in memory, that's the way to do it. Otherwise, in open world games like GTA or Assassin's Creed, they obviously can't load everything in memory. In that kind of game, there is a complex dynamic loading system loading and releasing resources depending a lot of parameters. If you're only a beginner, I would avoid this.

If you can fit all your assets in memory, but you don't load them all in one shot, you'll get hangs or frames with missing resources when they are loaded.

Share this post


Link to post
Share on other sites
It's just a 2d maze game and I am currently loading all resources into memory at the start. The performance seems ok and I think the memory usage is ok but I'm not sure what a typical small 2d game would be using, right now it's using 30 megs in release build.

Share this post


Link to post
Share on other sites

It's just a 2d maze game and I am currently loading all resources into memory at the start. The performance seems ok and I think the memory usage is ok but I'm not sure what a typical small 2d game would be using, right now it's using 30 megs in release build.


Then leave this thought for the future when it will be relevant.

Every game is different, this can be quite a generic topic. In general it is better to have all your assets loaded, because then you won't have to load them. But it completely depends on the amount of memory you need and have.

Share this post


Link to post
Share on other sites

Then leave this thought for the future when it will be relevant.

Every game is different, this can be quite a generic topic. In general it is better to have all your assets loaded, because then you won't have to load them. But it completely depends on the amount of memory you need and have.


Thanks everyone for the input, I will leave it as it is; but I might add the ability to delete the resources if I want. For instance, there are quite a few resources used in the splash screen that are not ever used again in the game, so I'll just release those and not worry about the rest being in memory.

Thanks everyone.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!