- Home /
4 gigabyte "loading screen"
i have noticed that all unity games released (example: endless space 2) consume 2 - 4 gigabytes for a simple main menu with 4 buttons.
in pure c, this menu would have taken 100 bytes at max.
So unity consumes 4294967296% more file size for a simple main menu than c.
Is this a bug with the unity engine ? Does it have to "preload" all potential models / textures / sprites of the game that will ever be used in the future, even for scenes that haven't ever been loaded, and wont ever be loaded because player with just click "quit" instead.
If so how could one avoid this issue and load the resources only when needed in a scene.
At this rate, the next game will consume 100 gigabyte for a "now loading button". Unfortunately, rams cannot hold more than 4 gigabytes.
Answer by Nition · May 01, 2017 at 08:40 AM
Unity generally only loads assets as needed, unless they're in a folder called Resources.
I wonder if the games you're looking at are doing things a bit wrong and throwing everything into the Resources folder, or if they're intentially preloading everything for performance.
As an example my own Unity game uses around 150MB of RAM at the main menu and around 300-400MB while in-game with everything loaded.
Answer by WarmedxMints · May 01, 2017 at 09:00 AM
All Unity games? That's simply not true.
Superhot & poly bridge certainly don't for example. It all depends on what the game is doing.
Answer by Eric5h5 · May 01, 2017 at 08:45 AM
This isn't what happens, though; seems like you have a problem with your system. Building a project with an empty scene takes around 100MB of real memory (macOS 64-bit build). This is because it's loading the entire engine. However scenes don't use any RAM if they haven't been loaded. I don't have Endless Space 2, but I do have Endless Space 1, and when the main menu is loaded it's using around 180MB. (It would take far, far more than 100 bytes in C, since there are various sounds/textures/etc. that are used.) If by "rams cannot hold more than 4 gigabytes" you're trying to say that apps can't use more than 4GB, that's incorrect. RAM is typically 8-32GB these days, and you can use all of it. An old 32-bit Windows app can generally address around 2GB, but we've long since moved on to 64-bit, which has no such limitation.
thank you, then it means it must be a problem with indie games that their developers didnt optimize. That's a reflief, because it means that scenes will be optimized without having to resort to asset packs.
Answer by tanoshimi · May 01, 2017 at 01:51 PM
The whole point of a loading screen is that it's something simple to display to the user while the main body of a game is being loaded in the background. So it's not the "simple main menu with 4 buttons" that you can see that takes 2-4Gb of RAM - it's all the rest of the game, and 2-4Gb for a modern game doesn't seem too bad - most new systems come with 8Gb of RAM as standard, and gaming rigs often have much higher.
Your answer
Follow this Question
Related Questions
Is AssetBundle.LoadAllAssetsAsync more efficient than AssetBundle.LoadAssetAsync? 0 Answers
Best way to manage object memory/world streaming for large worlds nowadays? 0 Answers
How do Unity manage loading with inspector linkage? 0 Answers
Serialized class to google games services cloud save 0 Answers
Issues getting WWW.LoadImageIntoTexture to use DXT1 compression at runtime 0 Answers