Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Question Asset loading priority

Discussion in 'Editor & General Support' started by AndreaCoso, Dec 7, 2022.

  1. AndreaCoso

    AndreaCoso

    Joined:
    Dec 2, 2022
    Posts:
    2
    Take as an example a typical open-world game, where tons of assets are placed around the world, but when we're playing we do not have such amount of memory to hold everything loaded at the same time, the typical solution, and the one that I want to adopt also, is to load just subsets of those assets.

    I know have a world divided into scenes, but the transition has to be seamless to the player, and to do so I want to progressively load the assets in that scene in an order that I somehow decide, but the problem that now arises is: how do I tell unity what load (or enable) first? In simpler words, how do I let it follow my order?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,935
    It's not a simple problem, but if you insist on me using simple words to describe it, here you go:

    - load the parts you need when you need them
    - unload the parts you no longer need

    Every single decisions and heuristic used to decide the above will be intimately tied to your game design choices.
     
  3. AndreaCoso

    AndreaCoso

    Joined:
    Dec 2, 2022
    Posts:
    2
    thanks, I got this macro understanding of the problem, if you don't mind being more specific I'd love that.
    the fact that is not a simple problem is actually a good thing, it is part of my thesis, especially the decision of the algorithm used to evaluate the "importance" of an asset

    Momentarily I'll start with every object disabled and progressively enable them to simulate a progressive loading, and it should actually be of some use since it would be useful for less-performing GPUs

    I am now focused on the implementation side, since I now have the need to compare such algorithms, but I'm struggling on identifying those gameobjects that are "always" available with some identifier that I can use both at runtime and in the editor. I'd use it to first sort however I want these assets offline to then use such order at runtime. But of course, I have to find these gameobjects in an efficient way, meaning that using unique names is not a very good option.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,935
    As you implement your game solution you will encounter and become aware of issues and you will engineer solutions.

    Every part of this will be an engineered solution in response to a constraint.

    Every choice you make will be made suited to whatever your game is and the requirements of that game.