Search Unity

Modded environment for level creation

Discussion in 'Asset Bundles' started by PassivePicasso, Mar 3, 2020.

  1. PassivePicasso

    PassivePicasso

    Joined:
    Sep 17, 2012
    Posts:
    100
    Preface: the developers of the game I'm modding are aware of and encouraging the work I'm doing here. however making updates to the game to support his endeavor are not currently an option and I'd like to exhaust all options before making a request to modify the games structure.

    I am working to setup a modding environment for level creation for a deployed game. As part of this I would like to be able to reference assets from the game without duplicating those assets, primarily it protect the IP of the developer, but additionally because it would save a huge amount of file size by not including them in Asset Bundles.
    I've been reading about Addressables, and honestly I'm pretty confused about how it works. so pardon me if I something I say doesn't make sense.

    The way I've been approaching the issue hasn't work, I've tried 2 primary setups.

    The first setup is as follows:
    1. Extracting the games assets, preserving the existing meta files for the assets
    2. Copy the desired assets into a folder, preserving folder structure according to the games Assets root folder
    3. Add a package.json to the root folder of copied assets.
    4. Create a set of prefabs which reference the assets, specifically a Mesh, a Material, and possibly a collision mesh. Indirectly this also references a Shader and some Textures.
    5. Create a bundle for the prefabs via AssetBundle Browser
    6. Create bundle for Scene
    When i build the bundles with Asset Bundle browser, this setup works, correctly loading the scene and its contents, it looks how its expected to look. However the prefab bundle appears to automatically bundle in the Package resources, thus violating the first principle of protecting the developers IP.

    Since this didn't work, I moved the copied assets into a folder, such as ReferenceAssets, and then added that folder as an AssetBundle into AssetBundle Browser.
    This prevented the Prefab Bundle from automatically packaging up the reference assets.
    Then I rebuilt the bundles, and copied all the bundles except the ReferenceAssets bundle, as it isn't the source we actually want to consume for the assets.

    the idea behind both of these approaches is that we preserve the fileID and GUID of the assets, which we believed would allow Unity to correctly resolve the references, but there is obviously a piece of this puzzle we are missing.

    Any ideas on how I could move forward, or things I can check to determine why this isn't work would be greatly appreciated.