Search Unity

Discussion Cross-game asset database

Discussion in 'Authoring Dev Blitz Day 2023' started by Baste, Jan 26, 2023.

  1. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    We've developed a couple of games over the years here at Rain. One thing that we end up wanting to do a bunch is to reuse assets between games - if we have a perfectly good brick wall texture in Teslagrad or World to the West, we can use it in Teslagrad 2!

    We do this in a very ad-hoc manner - we copy files from one project to the other! This is less than optimal, though. We can search by name, but if you've ever met an artist, you know that the chance of a brick wall texture being named "brick wall" is near zero. It's probably
    background_theTower_temp_statueArea_final2.png
    . Also, Windows' folder search is probably the worst search engine ever produced by mankind, so searching for "brick wall" will take an hour and get you a picture of a penguin.

    So since that's a dead end, we will want to open the game we're copying assets from, find the scene where we know there's a brick wall, and copy it over. But that requires us to have a copy of the game imported, and with the correct Unity version (I'm not updating a game from 4.6 to 2022 to copy a texture, lol!)

    So that's a lot of work, and do we even remember that we have the old texture? It's also a pain to export something with all relevant dependencies, since Unity's Export Package will include every single file in the project if what you select happen to have a single script anywhere on it :)

    All in all, the entire story around reusing assets between games is a bit shoddy. We could of course be better at organizing our stuff and naming things and whatever, but that still leaves a lot to be desired.

    What we have been looking for is a way to have all our studio's assets reachable from a central database. The things we'd want from that would be;
    - A way to tag assets, so they're more easily searchable
    - A way to search through and importantly preview assets in the database, from inside of Unity, without having to import them.
    - Ideally a way to add other data to the assets - like images that gives context to where they were used.
    - A way to associate assets in our Assets folder with assets from the database, so we wouldn't import them twice
    - Cross-references between assets, such that when we're looking at a texture, we can check what kind of models it was attached to, and what kinds of shaders it was associated with.
    - Ways to support custom formats. Our sounds are usually bundled with settings for pitch etc., so we'd want that in order to reuse sounds that are reliant on those settings. And we'd want to see all the sprites in a sprite animation in context as an animation, not just one at a time.

    There's some additional benefits that would fall out of this. We might end up keeping assets inside of our assets folder because we might end up using them, and deleting them would make it hard to find them again. If we were able to instead add thing to a central asset database, and then pull them in to the project at the moment we needed them, it'd be a lot easier to keep the project clean and the asset folder low weight.


    Of course, this isn't an easy tool to build, but I think it's worthwhile. So I have some questions, both for Unity and the community;
    - Has Unity in any way looked into solutions for asset sharing between games?
    - Does anyone know of any tool like this in the wild with good Unity support?
    - If we were to build a tool like this, how much would people be interested in paying for it? Alternatively, are there somebody that'd be interested in putting in serious time on an open-source solution for this?
     
  2. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    I do have a solution, but it's pretty different from what you have described: however, with the right setup, I think you could achieve it like this:

    I have a Unity package on github called Unity Extras, and in all of my projects I like to add it as a submodule. This allows me to continue work on the package in whatever game project I'm working, and any change I push will immediately be pullable from all my other submodules. Unity Extras, then, is meant for general game code. A good example is how we wanted correct foot placement for our game. I wrote the code for it in a generalized manner, put the script in Unity Extras and blamo, foot placement is now a solved problem, forever!

    I think you may achieve the same result for assets. So you create a "Teslagrad Commons" package, put it on github, and you instruct your team to put any common teslagrad assets inside the package. You can also depend on Addressables in order to create a base configuration for loading these assets, and it would immediately work for any Teslagrad game!

    From there you get all Unity functionality as-is: so cross-references between assets is provided by how you would find cross-references in Unity normally.

    You may need to put a guy on R&D for a month just to figure out how to integrate this all cleanly and smoothly but it would work. Even if you want to split it up into multiple packages, you can have gits within gits within gits and with a quick tutorial to catch up your team on the new workflow you should be able to reap all the benefits you're looking after.
     
    Baste likes this.
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    There's a few things an approach like that doesn't solve. The biggest one is that having the assets imported slows down Unity. All processes that in any way scales with the size of the asset database is now slower.

    That means that Quick Search is slower. That means that importing the project is slower. That means that a ton of other things are subtly slower.

    So having the assets outside of the project is a core feature, not an optional requirement.
     
  4. EricDziurzynski

    EricDziurzynski

    Unity Technologies

    Joined:
    Mar 11, 2022
    Posts:
    53
    @Baste, I do believe we are working on something to help address this but I'm not the right person to give you more insights on the topic. Let me see if I can get someone from this project to provide a better response.