Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Adding a dependency to an asset store product in a project's manifest.json?

Discussion in 'Package Manager' started by PhilSA, May 11, 2021.

  1. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    I am wondering if it is possible to add a dependency to an asset store product in a project's Packages/manifest.json.

    The end goal would be this:
    • Have an asset on the asset store.
    • Make a public "Samples" project repository for that asset on github.
    • Make that "Samples" project's manifest.json include a dependency to the store asset.
    • When a user downloads & opens the "Samples" project, if they have purchased the original asset, it is automatically imported into the project. If they haven't purchased the original asset, it is not imported and errors show up.
    Is this currently possible?
     
  2. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    Hey there. Having spoken to the team, it is not possible for a project to depend on an Asset Store product.
     
  3. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    96
    @UnityMaru

    I'm also interested in something like this. I'm working on an asset that has a sample scene to demo the feature set on a terrain. Though the scene having that terrain uses the official TerrainSampleAssets from the Asset Store. I'd like to add a dependency pointing to that asset to let the users purchasing my asset open the TerrainSampleAssets asset from Unity. I don't think a link added somewhere around my own asset is satisfactory enough. Actually, I'm not sure why isn't it already a feature as UPM already takes care of dependencies defined for packages. Why isn't it available for the asset store packages?
     
  4. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    545
    Hi @Yany,

    The concept of dependencies on Asset Store assets is not as well-defined as for UPM packages: those just need to be downloaded, installed, and loaded in the project (but separate from the Assets directory), whereas Asset Store content is typically meant to be integrated in project assets to be freely used and edited in the project (when it's not a full project in and of itself!). Therefore I'm not sure exactly what a dependency on "TerrainSampleAssets" should look like or what Unity should do with it.

    But perhaps you do, so I'd like to invite you to submit your idea for the product team to review by going here, under the Package Management section (scroll down the Roadmap after selecting Package Management to see the Submit a new idea! button).
     
  5. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    96
    I did so. Thank you for the links, I appreciate your attention.

    Just like the packages can list other packages as a dependency, Asset Store assets should be able to do the same for similar reasons.
    A practical example: I'm working on an asset, a rope bridge creator tool:


    It consists of a bunch of scripts and just a few sample materials and prefabs that are the bare minimum to provide what it is intended for: to let people create rope bridges without knowing all the tricks needed in the physics system and without writing a single line of code.
    But as with any kind of asset, this, as well, needs to showcase its features in a scene that simulates a practical situation. To build up that scene, of course, I use different assets, like terrain tile textures, detail textures/meshes, whatever.

    But (now comes the important part) as a creator I’d want to leave those huge assets out of my package as without them the whole is just a few kilobytes, maybe megabytes, but not 1.6GB like the Terrain Sample Assets I would use for instance. Yeah, I could include parts of it and compress the large textures, and even I could draw my own textures, and so on, but to be fair, I don't want to take care of those stuff in any way, just use them as they are, but in a way that everybody could do: import it from the asset store. What I mean: if I just mark my asset that it needs to pull the TerrainSampleAssets from the store, I win a bunch of things:
    1. I don't have to add it to my project repository, as any dev in the team (if there are) wants to touch the project, they need to pull the relevant stuff I made (or the team made) and not anything that otherwise could be downloaded from the Asset Store.
    2. Cloud repos, like Bitbucket has a limit of 1GB for indies without a subscription. If the external assets are excluded, the entire asset could easily fit in the repo, otherwise not at all.
    3. For anybody who purchases it, there could be a well-known, apparent place in the store that warns people that this package depends on this and this. Currently, this warning is up to the creators and it highly varies how well-founded those warnings are. It also leaves the task for the users to gather the mentioned asset(s) and buy/download/import them.
    4. The asset package would be much smaller in the asset store as well. Not 1.6GB + my few kilobytes that DUPLICATES stuff already available in the asset store.
    5. If the external assets are updated, the main asset remained the same, as a buyer I don't need to update the main asset, but only those changed individually, just as it is done with the packages too.
    6. The individual update can be important in other aspects. For instance, if those external assets are not a pack of textures or any passive content, but a few scripts which could brake with a newer version of Unity, I, the creator of the original asset, don't want to understand and update those external scripts by myself, not even by merging the differences between the instance I added to my asset earlier and the latest one in the store. It's out of my scope in every way.
    7. Licensing: as a developer (or even as an artist) I'm sure no one wants to spend time to find out which assets can be included in their own asset and in what way (partial/full/license notes/anything). We all have the asset store that already manages this question. If a user has a right to use the asset, they can download it, if not, they cannot. But having permission to access my asset does not mean by default I can give access to those external assets. And it's insanely time-consuming to hunt down all aspects of using each.
    8. With the capability to have dependency-specs in the asset store packages, the buyers can avoid accidental (either partial or full) duplication of the external assets. Let’s say I’m a Unity user who wants to create a game played on terrain but I want to put some rope bridges on that. What would I do: I “buy” the TerrainSampleAssets and also buy the rope bridge. Now in the current situation as a result I will have the TerrainSampleAssets twice. Ok, there’s the import dialog to cherrypick the files, but there are several in them, and there can be renamed ones, and so on, it’s just insane. Why would I, as a buyer should start with selecting from the files if the creator of the rope bridge builder forgets to warn people that the asset contains the TerrainSampleAssets, or some part of that.
    TLDR
    • Asset creators win time/space/money by concentrating only on their own stuff, paying for less space, and managing their own licensing and updates.
    • Buyers win time/space/money by having a single copy of every asset regardless of the dependency, by knowing for sure what kind of assets the stuff about to be purchased depends on (as the store could have a standard way of showing/warning/managing dependencies for the potential buyers).
    • Asset store wins as there would be more satisfied buyers, more satisfied creators with much smaller assets, and even better assets as everybody had much more time to deal with what they had to, and not with unnecessary things mentioned above.
    I can see now I'm not the only one with this idea, so it would be really kind of you if you could dedicate some time to consider this feature. Thank you.
     
    Last edited: Nov 29, 2022
  6. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    545
    That's a very good, fully detailed write-up. Thanks!
     
    ROBYER1 and Yany like this.
  7. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    96
  8. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    96
    Should I see my submission around the "Under consideration" section somewhere? If not, does that mean this idea has already been ruled out?
     
  9. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    545
    Hi @Yany,

    I'm not too familiar with the processes of the product management team. I'll follow-up. I can tell you however that we're in the process of designing the future of the Asset Store/Package Manager experience to improve interoperability and a feature like yours sounds like it would fit in this, at least in spirit. I can't say it will get implemented as suggested (there's a number of obstacles to consider here, such as customized said packages, licensing...) but your report definitely gives us additional exposure on usability from users' point of view.
     
    Yany likes this.
  10. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    96
    Thank you. :)
     
  11. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    545
    @Yany I can confirm your feedback is still queued for processing and hasn't been rejected ;) I got some more details about the process however, and ideas like this will typically be used to define broader, curated features. Unlike some systems, which can end up having hundreds of publicly visible feature tickets, ours works differently. That's why you're unlikely to see your idea come up as-is in that page, or in the short term. But I insist, the feedback is still useful and appreciated!
     
    Yany likes this.
  12. Arycama

    Arycama

    Joined:
    May 25, 2014
    Posts:
    183
    Not having this kind of functionality makes the Asset Store extremely unscalable, and also pretty useless for prototyping...

    Simple example, I'm making a prototype for a new project, and I'm using a few asset store packs I have to speed up prototyping. It's not uncommon for a single asset store pack to be several hundred mb, or gigabytes in size...

    I want to commit my protoype code to version control, and I also want to keep the references to the asset store pack content I've used. (Eg I've placed prefabs in levels for art/obstacles etc) However, my only choice is to commit the asset store pack to version control as well as my code. Due to the size, this is a bad idea or just impossible. The alternative is to only commit the few assets I'm actually using, but this requires a lot of manual work tracking down exactly what assets I need and removing everything else. It also means I can't use other assets from the asset store pack at a later date without redownloading them.

    It also doesn't help that asset store content is often extremely unoptimized in terms of size. There will often be uncompressed multi-layer PSDs and 4k TGAs, and unneeded lightmap bakes for demo scenes etc that make up a significant portion of the content size. If this didn't have to be committed to version control for every project using it, it would be less of an issue.

    It's pretty rare that I'll actually want to modify content from an asset store package. And if that's the case, it's easy to simply copy the files into the assets directory and modify/commit them there. But for the majority of use cases, I just want the files sitting in the packages directory for me to use without modifying them.

    I'm really hoping this kind of functionality gets added soon.
     
  13. astro_camille

    astro_camille

    Joined:
    Apr 18, 2020
    Posts:
    1
    I very much agree with Arycama. Asset Store packages are a nightmare for repository storage limits and versioning in general. I would love the ability to reference them in the project manifest similar to UPM.

    One way around this that I've used in the past - which unfortunately takes ages and takes up storage - is to locally package the asset store package and include the local path in the project package manifest. It's essentially the same as UPM dependencies but you have to manually bundle it up yourself and also keep everyone in your team having the packages in the same location on their local drives. Just saves it taking up space in your repo.
     
  14. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    96
    Let me add one extra point to the list: if the Asset Store managed the whole dependency, licensing, file management, etc, the Asset Store itself could calculate the actual price for the users depending on what they have purchased already from the dependency tree. For those who miss some assets of those, the Asset Store could show which assets they must buy for how much money to use the visited asset.
     
  15. DarkDungeonStudio

    DarkDungeonStudio

    Joined:
    Oct 31, 2013
    Posts:
    37
    I'm in a very similar situation where we're busy setting up a framework for our future projects.

    Our framework has a package.json file with a list of dependencies, but would like to be able to add asset store dependencies to that list as well.

    This would allow our teams to quickly import the framework package, which in turn will automatically install all the assets it depends on.

    Luckily at this time, most of the assets we depend on has git repos which we can add to the manifest, with a few other assets needing to manually be installed.
     
    Yany likes this.
  16. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    412
    They need a way to see any asset store dependencies as well. Asset store packages can have dependencies now. But other than just installing them or skipping them I can not find how to know what is used.
    Clicking on the package viewer on the store the manifest.json is just a picture.

    And when installed the manifest.json is not included. I am not going to just let a asset store package change my current set of dependencies with out at least seeing what it wants to do.

    Dependencies are only listed in package manager for internal packages but not asset store packages.

    *edit: you can go find it by finding the downloaded asset and digging into it and finding the file there. Very much a pain just to know if its safe or not. And what might be required if i skip it to manually install.
     
    Last edited: Jul 23, 2023