Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Asset store dependencies handling

Discussion in 'Assets and Asset Store' started by Metron, May 23, 2016.

  1. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Hi,

    I'm not sure in which sub-forum to place this question. So if any moderator could point me to the right direction, that would be great. My initial thought was the asset store sub-forum, but I don't promote a product yet.

    Things is, that we'd like to put some stuff on the asset store which depends on other assets. We have some scripts that depend i.e. on SteamVR and others that use DoTween (and which work with the free version). We don't really want to include the entire SteamVR stuff (nor do we want to duplicate SteamVR scripts) and the same goes with DoTween.

    So what would be the best approach to this?

    Thanks for your tips.
     
    ROBYER1 likes this.
  2. Socrates

    Socrates

    Joined:
    Mar 29, 2011
    Posts:
    787
    Take a look at some of the assets designed to work with Playmaker or NGUI. The description of the product will generally say that it requires asset X to work. (A hyperlink in your store page is a good addition there.)

    Some asset authors may allow you to distribute the free version with your code. You would have to contact the asset author directly.

    While I can understand wanting to do that, both to prevent your asset from failing due to the other free asset not being there or to ensure that there's a copy of the free asset included that you know your code works with, I personally dislike having one asset include another because I can end up with multiple copies of the asset fighting it out or just cluttering up my project.
     
    Kiwasi, Metron and theANMATOR2b like this.
  3. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Thanks. That's how we thought do handle this. We regularly run into the same issue that people include 3rd party stuff in their distributions.
     
  4. delinx32

    delinx32

    Joined:
    Apr 20, 2012
    Posts:
    417
    I thought (I'm near certain) it is against asset store TOS to include other assets in your asset package.
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I wonder if it's possible to open the asset store window to a particular asset from an editor script. That way one could just scan the project for dependencies, and then open a dialogue directing the player to download the appropriate asset.
     
    QFSW likes this.
  6. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,905
    That's actually a great idea, im interested to know if thats possible too or not
     
  7. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,984
    Maybe I'm missing something simple, but how would you package code that includes api calls to an asset you can't include? Unity would surely send it back if it opened with errors.
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,528
    Compiler defines. You can include an editor script that adds them to the project.

    Or include the dependent code in a sub-package and import it with an editor script.
     
    BackwoodsGaming and Billy4184 like this.
  9. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    I don't think that's correct. I can think of a few examples:

    1) Tons of packages use free art and assets that Unity make (free packages yes).
    2) Playmaker comes with iTween and has for eternity (don't know why though since it's soooooo slow compared to others).
    3) I've seen other packages come with tweening libraries that the author didn't make.
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    I include the optional packages and just let the user double-click them.
     
    Billy4184 likes this.
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,528
    Me too. But a neat trick I've seen in some newer assets is an editor window with buttons that do the unpacking for you.
     
    ROBYER1, BackwoodsGaming and jerotas like this.
  12. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    I wish you could just define dependencies in AS tools and make Unity resolve it (kinda like dependencies in Linux software packages, very good indeed). You'd specify package needed and its version number and Unity would take care of the rest (auto dl free dependencies and inform user about needing paid ones if user didn't already bought them).
     
  13. delinx32

    delinx32

    Joined:
    Apr 20, 2012
    Posts:
    417
    You can upload code that is under an open source style license that does not prohibit commercial use, provided that it is not the sole content in your asset. You can also freely distribute any of unity's free assets, UT has publicly stated that. You can upload images from places like cgtextures as long as you have a license to redistribute them, but they cannot be the sole content of your asset.

    I don't know about playmaker/itween. I just installed playmaker and it did not install itween as far as I can tell. iTween is a free asset though and the playmaker folks may have gotten a redistribution license from the itween author.

    I've seen several posts from UT about this and I'm near positive that you can't include another asset from the asset store. I couldn't find anything specific in the publisher guidelines though.
     
  14. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    You will definitely want to check with CGTextures.com to confirm this. I know when Gaia was still in beta, Adam checked with cgtextures.com and they told him no. That is why he worked out an arrangement with gametextures.com. There are certain conditions where they may be redistributed, but it is always best to check with them to ensure what you are doing falls within their guidelines before actually doing it. :)
     
    CrandellWS likes this.
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Well yes I'd assume that any sane person would ask the author of a free plugin if they could include it in another plugin, such as iTween with Playmaker, and not just include it without asking permission. But that still means that flat out stating "it isn't allowed" isn't entirely true, which is what I way saying. Yes, it still comes with iTween, as seen below, after you install one of the 1-2 Playmaker install packages.

    upload_2016-5-27_20-32-57.png

    Heck, our Master Audio and Core GameKit come with the free version of RelationsInspector, since the author built stuff for us to make the product better and get some exposure for his full version. I saw that one of the audio plugins (forget which one) comes with either LeanTween or Hotween as well.

    I was mainly talking about including free assets with other plugins as I don't know of any instance of paid plugins coming with other plugins.
     
  16. delinx32

    delinx32

    Joined:
    Apr 20, 2012
    Posts:
    417
    See, that's the thing though, ITween isn't included with playmaker, it is installed after the fact using an installer. The asset is most likely not included in the asset that was uploaded to the store. It is probably downloaded and installed via the installer, from the asset store.

    UT has publicly stated in these forums that you cannot include other assets with your asset. I'm too lazy to link the multitude of posts, but I guarantee that it was said. Obviously if the author has given you permission to redistribute something then you are allowed to, but you can't randomly pull a free asset off of the asset store and include it in your package. Free does not mean "Anyone can distribute it".

    I'm not arguing with you. I just want people to understand that they can't grab other people's work, even if its marked free, and include it in their asset. UT has been granted an explicit license to distribute said content, "Joe asset store publisher" has not been granted any such right.

    I wouldn't want anyone doing that with anything I wrote, even if its free. If I found code of mine in someone else's asset and I didn't give them permission to distribute it, then I would work very hard on getting that user banned from the store, and I think most people would probably feel the same way. Code is hard work, free code is still hard work, and many people only get recognition from publishing free code. If you take away the recognition, then you've taken away all compensation that the original dev could receive.

    Yeah, I meant that you can only upload things that you have the license to redistribute. If CGTextures license prohibits it then you can't do it. I wasn't necessarily saying it was ok to upload cgtextures stuff, just that you can only upload things license permitting.
     
  17. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Most of that I agree with, especially the ask permission part - which my last post did in fact say. iTween however is in the "install playmaker" package that comes with Playmaker from the Asset Store. It's not a separate download. I installed Playmaker yesterday to confirm before responding. That's not the only package in the Asset Store to includes things like that, but it's ok because they all asked permission (I assume).
     
  18. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Hi,

    just to give a feedback on my own thread:

    Our package CarouselPro has been accepted to the Asset Store. It has a dependency on DoTween (free version) and does not include the DoTween package. What it does though is to reference to the DoTween asset package in the asset store.
     
    CyrilGhys likes this.
  19. mthorade

    mthorade

    Joined:
    Jan 26, 2017
    Posts:
    3
    Actually, it is not just Linux package management, it is rather many modern programming languages, like PyPi and pip for Python, or npm for node.js, or CTAN for Latex, or Julias's package manager and so on.
    https://en.wikipedia.org/wiki/List_...nt_systems#Application-level_package_managers
    Being a programmer who is new to the Unity world, I am quite astonished this does not yet exist!
     
    CrandellWS and Metron like this.
  20. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    It's true that it would be cool to have such a package dependency manager...
     
    CyrilGhys likes this.
  21. lmlynik

    lmlynik

    Joined:
    May 29, 2013
    Posts:
    1
    Hey could you tell me how to achieve that?

    I'm working on an asset but I depend on Json.net which(I doubt) I can embed in my solution, but making the user prompt to add it would do the trick.
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    I'm saying I have a folder of various .unitypackage files they can import after importing the main plugin. You know how to make a package right?
     
    CyrilGhys likes this.
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,528
    Unlike @jerotas's assets, which include optional third party integration packages, it sounds like your core product requires JSON.NET to function. In this case, submit your asset without including JSON.NET.

    A couple of my products, such as Save System for UFPS, require other assets to function. I added bold text at the top of the asset's store description that states that Opsive's UFPS is required. Just make it very clear that JSON.NET is required but not included in this asset. You can use an <a href> tag in your description to link to JSON.NET's store page.

    It's a little more complicated if your asset is in multiple root folders, since Asset Store Tools only lets you specify one folder. (For example, the Save System for UFPS is in Assets/Pixel Crushers and Assets/Plugins.) If your asset is in multiple root folders, you must specify the root folder. The Asset Store folks updated Asset Store Tools last year so you can upload assets even if they don't compile due to missing dependencies. To submit the Save System for UFPS, I import UFPS and the Save System for UFPS into my submission project. Then I remove UFPS entirely from the project. Finally, I specify the root folder and upload. The end result is that the asset contains only the Save System for UFPS content, and not UFPS itself. It won't compile until the player imports UFPS, but that should be clear to the customer from the store description.
     
    CyrilGhys and a436t4ataf like this.
  24. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    5,984
    For my space kit, I have integrations for Rewired and Behavior Designer. I went with the .unitypackage files for storing scripts with dependencies as it seems the most straightforward. The asset was declined at first, but I just sent an email explaining the situation and they said it was fine. So if you have problems getting accepted, make sure you've told them clearly why you're doing it.
     
  25. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,444
    Wondering what to do when including functionality in my asset which is optional but uses a paid asset. Any advice?
     
    PixelLifetime likes this.
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,528
    Wrap it in a compiler condition:
    Code (csharp):
    1. public class SomeTextMeshProAddon : MonoBehaviour
    2. {
    3. #if TMP_PRESENT
    4.     // TextMesh Pro-specific code here
    5. #endif
    6. }
    Ask the user to define the compiler symbol if they want to use it. Or, better yet, provide an editor window or menu item to add it for them
     
    ROBYER1 and Socrates like this.
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,555
    Yeah that's what we do. Tony gave me some code to make it easy :)
     
  28. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,444
    That's so simple and effective, thankyou! I asked Unity support about that and they didn't even suggest it to me! Thanks :)
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,528
    Glad to help!

    Relevant API calls if you want to write an editor script to automatically add or remove symbols:
    • PlayerSettings.GetScriptingDefineSymbolsForGroup
    • PlayerSettings.SetScriptingDefineSymbolsForGroup
    • To get a list of all installed build targets:
      Code (csharp):
      1.  
      2.         public static HashSet<BuildTargetGroup> GetInstalledBuildTargetGroups()
      3.         {
      4.             var result = new HashSet<BuildTargetGroup>();
      5.             foreach (BuildTarget target in (BuildTarget[])Enum.GetValues(typeof(BuildTarget)))
      6.             {
      7.                 BuildTargetGroup group = BuildPipeline.GetBuildTargetGroup(target);
      8.                 if (BuildPipeline.IsBuildTargetSupported(group, target)) // Requires 2018.1+
      9.                 {
      10.                     result.Add(group);
      11.                 }
      12.             }
      13.             return result;
      14.         }

    Side note: If you're adding support for the new Input System, Unity 2019.2.6+ defines ENABLE_INPUT_SYSTEM and ENABLE_LEGACY_INPUT_MANAGER, so if your asset uses 2019.2.6+ you can just check for those instead of defining your own.
     
    ROBYER1 likes this.
  30. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    How about having this on AssetStore? I would like to be able to release plugins on AssetStore then release game templates using those plugins, game template in itself is a big project which could sell separately as other template projects do.

    It's not good - not having a system which ensures that people buying the asset need to buy dependencies as well. People will complain that they were not notified enough, that they didn't expect something like that etc. Lots of refunds and unnecessary actions, bad reviews...

    This is also a problem with bundles of assets. If I have 2 plugins, one is dependent on another, let's say Audio and Object Pooling. Audio requires Object Pooling. Now I need to include Object Pooling in Audio files but what about the price, is it twice the plugin price? What about people that have already bought Object Pooling, how do they get a discount? How not to confuse people into buying both assets accidentally? What if even more assets use Object Pooling, do I include copies of it in each asset? What if dependency chain is bigger than expected?

    I have seen some bundles just having a free key/url that let's you get asset for free separately if you buy a larger asset. Still the problems from above persist.

    Now that Unity has Package Manager I don't see a reason why this couldn't be a thing, npm or whatever is used in Package Manager allows for dependencies, if asset ensures that dependencies are bought, allow to import these assets as packages as well, this is very convenient for everyone, for publishers, for customers and for Unity (selling more assets on store brings revenue).

    Please like this message if you want to see a feature like that in the future, hopefully someone in Unity will notice, thank you :)
     
    Yany, piXelicidio_ and Suwas93 like this.
  31. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    My bad for not researching this properly, seems like there is something like that already on AssetStore.

    upload_2021-7-6_2-58-49.png
     
    piXelicidio_ likes this.
  32. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,444
    Where is this in the Asset Store Publisher Portal?
     
  33. Yany

    Yany

    Joined:
    May 24, 2013
    Posts:
    93
    ROBYER1 likes this.