<@!171934690691907584> wanted to ask you anyways, good time: are you planning on publishing your AssetStore packages as Hybrid Packages? Happy to support on that, long-time user of AFPS here 👋
#🐸-hybrid-packages
📦 : https://github.com/needle-tools/hybrid-packages
🧵 Threads (1)
are you planning on publishing your AssetStore packages as Hybrid Packages? Yeah, I'm going to try switching all my assets to the pure packages, starting from the Advanced FPS Counter which is now going through the major upgrade development process (I'm adding generic Unity Profiler counters feature) ^^
Hope to release it before 2022 kicks in, and that's when I'll test Hybrid Packages. Totally appreciate any support on that, but hopefully all will go fine 😅 I'll provide feedback on the package usage anyway, so you'll know how it worked for me 🙂
Happy to support on that, long-time user of AFPS here 👋 yay, really happy to hear that! hope you'll like what I'm prepping with a major upgrade 👀
Has anyone here used https://github.com/adamgit/PublishersFork ?
So <@103054507105067008> :
- just add hybrid packages to your project (https://github.com/needle-tools/hybrid-packages#installation-)
- follow this flow here https://github.com/needle-tools/hybrid-packages#using-an-upload-config
Thanks! Any issues or questions I'll just post back
Please do! The docs are currently lacking screenshots unfortunately but the process should be pretty straightforward - if you find you're doing something very complex it's probably wrong, haha 😄
<@279330166705225728> if you have any questions, here's the right place to ask them 🙂
Is exporting packages with the config only allowed for a Package from disk?
Would like to export a package that I added from NMPJS
Might well be that I'm protecting against accidentally doing that with an immutable package What you can do easily though:
- go into Library/PackageCache
- find the package
- copy the folder into Packages/
- focus Unity again
This will make the package mutable (== editable) and that should work
It is because of this check
Yup – I still think that's a good thing to protect against by default 🙂
(the other workaround from looking at that code is going into internal mode, which bypasses the check)
Yeah for sure. But if I right click export it just works fine 😉
But can't upload to the unity store that way so 🤷♂️
I think that's exactly the point of that check - too easy to get into legal trouble.
(accidentally)
Yeah somebody accidentally uploading a payed dependency 😱
Do you think releasing a hybrid package is the way to go now a days?
Internal mode works perfect with a NPMJS package 👏
We're using Hybrid packages for our stuff on the store, yes There's been some back-and-forth with the relevant Unity teams on how they should deal with it on the store – they're kind of promising a proper UPM solution for a couple years now...
Bottom line is: they'll not support hybrid packages but also not really block it, it should be reviewed regularily (I hope that's still the case, one never knows)
There was definitely some confusion when we found that method and suddenly packages showed up on the store, backwards compatible to 2018 😄
Thanks for all your help! Hybrid packages seem the best for us to release our package to the store.
I was just about to mention this also! Would be good to have a tooltip or user advice to do the workaround there maybe if it is to avoid legal stuff
I'd like to learn more about your usage for this <@103054507105067008> and <@279330166705225728> In which case do you want to actually export / publish an immutable package? In my mind that would only be the case if you don't have access to the original and then uploading to the store is never a good idea
I'd rather argue "something is fishy about your publishing workflow" when you're trying to publish in this way but eager to learn more about what I might have missed
My use case is I want to include the Unity OpenXR package and XR Interaction toolkit as Packman dependencies in my exported package. Am I going about this the wrong way maybe?
Yes, then this is the entirely wrong approach 😄
I don't want them explicitly bundled in with my asset store package
ah
What you want:
- have your local package
- specify those dependecies in package.json as usual
- upload just your local package
This is in fact exactly why I blocked uploading immutable packages.
I'll look into making my asset into a package first then, thanks
If you want dependencies then yes, your asset must be a package, that's the whole point of Hybrid Packages 🙂
It's "I want to ship a UPM package with proper dependencies and samples to the AssetStore instead of shipping just some random folder in Assets"
Should I include the folder for my asset from assets in a hybrid package, export that as a package then use that to test the code as a package? Otherwise I'll go use some package exporters I have tried but not fully used before
Just this is best I think https://docs.unity3d.com/Manual/CustomPackages.html#LocalMe
Just shipped a new version of Hybrid Packages - this adds support for the new Asset Store Tools, fixes a few issues with their new implementation, and updates the docs with all you need to know about Hybrid Packages as integrated into the Asset Store Uploader.
Fun fact: the new Asset Store Tools already ship as Hybrid Package! 🙂 We're very happy that Unity has listened and has decided to implement a version of Hybrid Packages into the core workflow.
Here's how the Hybrid Packages integration into the Asset Store Tools window looks - they did well 🙂
Hi! i'm not sure wether i've misunderstood but i should be able to use hybrid packages to avoid manually getting packages from the unity package manager correct?
at the minute i've just tried to import a project after deleting my packages folder to test that i've installed your software correctly. However i'm still missing dependencies such as UnityEngine.Animations.Rigging
Oh, nvm! i figured out this if you use assets/export package or right click packages the packages folder won't get exported
however if you select each package individually it works - is this a bug/limitation?
either way now i've sorted that i just came here to say thankyou for this awesome package because it's helping me vastly in college! 😄
Hey! Yes, you can export invidual packages but not the entire Packages folder. The "Packages" folder is just a virtual folder in Unity, it doesn't really exist
to avoid manually getting packages from the unity package manager Not sure I understand that part!
Ah i see thankyou for clarifying! (as aforementioned awesome addon btw)
ah when i said "to avoid manually getting packages from the unity package manager" - i mean that normally i (and anyone who downloads my github project) would have to open the unity package manager window and find a package like Unity Rigging or Shader Graph to remove errors when compiling scripts in unity
but with this addon i no longer have to - which is awesome if i do say so myself!
Still not sure if I get your flow - you mean when you send people a .unitypackage you can now have a proper Package with package.json and dependencies inside of that?
yes, exactly that! Sorry I must've not made myself clear enough 😅
Understood!
An even better flow is if you give people install instructions for how to add your package from GitHub or from OpenUPM 🙂 Hybrid Packages are kind of a workaround for that, especially for AssetStore distribution.
ah that's ok - it's only for college work at the minute so it gets the job done!
again thankyou a lot (I can't believe this isn't a functionality in unity already - it's a massive timesaver!). 😄
Good news, at least partially: the new Asset Store tools contain a hidden flag to turn Hybrid Packages on for asset store submissions 🙂
We were able to convince them that this is a good middleground between "old .unitypackages" and "new proper packages"
Well, they listened (we had a bunch of calls with them) and saw the value in providing that middle ground between current .unitypackage hell and future nice-and-clean packages. Allows publishers to prepare for and leverage parts of that golden future now instead of being stuck
I think just internal alignment and understanding what that actually means at scale. E.g. discussions around mutability / immutability, render pipeline compatibility, reuse of assets between projects, user expectations, ...
Hey here,
Did anyone ever run into DllNotFound Exception or
Hey <@668872193551106048> do you mean when exporting with Hybrid Packages or in general? I've seen this issue when DLLs reference OS-specific code (e.g. stuff that only works on Windows) but not related to hybrid packages
Thanks. Possibly it was an issue with Unity AssetStore, this was happening when I uploaded my package from Windows editor. Not happening now when I use Mac Editor for uploading. Weirdly, I was able to directly use the unitypackage exported from win editor just fine, and it only when I downloaded it as assetstore pkg... so not really sure what was wrong in the older pkg. I have also removed needle hybrid package, as the newer unity assetstore package now allows uploading local UPM packages. So it's fine now.
Yep, they adopted the hybrid packages workflow 🙂
hey! loving hybrid packages!! came here to ask a question about .meta files in Samples~ ... after export (using the SO config workflow), importing into a new project makes the editor complain about the existing .meta file with non-existing Samples~ folder. I understand why it's complaining, however the question is if this is expected as a one-time warning after import, or is there a solution to have a clean install with hidden Samples folder.
Hey there! It should only export what's there, so if you remove that .meta file before exporting it should also not appear upon reimport.
Thanks for the response. I thought of it but Unity adds it back immediately.
no it does not! I must have been doing something wrong, sorry
Typically that will happen when you have workflow / script where you're renaming from "Samples" to "Samples~" and vice versa for editing (we do the same for our packages)
In some Unity versions the .meta file will be automatically deleted, while in others Unity may keep it and warn about empty folders
confirmed, I now have a perfectly clean install! fantastic
Cool 🙂 glad I could help!
I know what threw me off, FYI, removing the meta file makes the "hidden' folder disappear completely, so in a panic attack I moved it back, thinking it would not export the samples
got one more question, out of curiosity, successive exports always produce different .unitypackage file size, why is that?
Hmm that should not happen - if you open the .unitypackage files with 7zip or so, do you notice any immediate difference?
three exports in one minute, they seem to have the same number of folders inside
they all have archtemp.tar with 185 folders inside
this is tcmd compare by content, if it helps, reds are differences
ok the differences are basically time of creation, most of the time, hm
ok, got a lead, found out that some PNGs have different sizes, so it could be the compression
I see! Still strange, one would assume that's deterministic, but who knows. Maybe it's the thumbnails?
could be the thumbnails, if I ever find out, will let you know
Hi! Got a question about licensing. I know it's not the best place to ask, but perhaps not a bad place to start - considering Hybrid Packages allow us to have Asset Store packages in UPM section "In Project", which exposes the "Licenses" link. Standard AS packages do not have this default link in UPM, probably because they are provided under the umbrella of the AS license. Could not find any relevant info about what to write into LICENSE.md in the case of an AS package. Providing no license file or a link results in an error in the console so this forces us to have this file. If anyone has faced this issue, I'd be glad to hear your solution. Thanks a lot!
Hi! My understanding is that Asset Store assets are typically covered under https://unity.com/legal/as-terms unless you state something else (Non-Standard Eula, https://support.unity.com/hc/en-us/articles/205623589-Can-I-use-assets-from-the-Asset-Store-in-my-commercial-game-#h_01FYBTYYF2W04SC368GH2T2S2A). Since things downloaded from the AS also don't typically come with an extra license file, I don't think you have to ship that, but you could (e.g. if you want that "License" button to work)
Yeah, sounds like a good solution. I'll just provide the link to AS EULA in the package.json. Thanks for inspiration!
"Since things downloaded from the AS also don't typically come with an extra license file" - yeah this is I think because they don't have the Licenses link exposed in UPM so no one has ever needed to even think about it 🙂
To be honest I think to simplify things they didn't require it (assuming default AS license) but also didn't add license files on download, better would be if each asset came with a License.md file, otherwise it's far too easy for people to "accidentally" move it elsewhere and reuse it wrong
yeah, but it could also be one of the reasons they are hesitant to moving AS fully to UPM packages, as suddenly lots of publishers could make mistakes by being "forced" to provide some license info, I'm sure many would provide some license violating the general AS EULA
Hey there, got another one 🙂 Workflow with editor-only assets inside packages, ie. icons/images. It seems there is no ideal way, at least from solutions I've searched.
Easiest is to do Resources.Load<Texture2D> and have Resources folder within the package. Works for local packages (file:... in the manifest) and also imported UPM package, however will end up in user's build.
Then there is AssetDatabase.LoadAssetAtPath<Texture2D> which allows having custom paths without resources folder.
Publishers generally use this approach, however this does not work with local packages with the way path is set-up in the manifest. So using as suggested by Unity on the forums like this: AssetDatabase.LoadAssetAtPath<Texture2D>("Packages/com.my.package/Editor/Images/image.png"); does not work.
I guess converting the path is possible to allow development, but it cant be tested to see if the package actually works until actually importing it from the published version on the AS. Are you aware of any other options or an ideal solution? Any hints appreciated!
Always use the guids 🙂
LoadAssetAtPath<Tex2D>(GuidToAssetPath("7464636rhheheu3u"));
That being said, your second approach also works with local packages
Things starting with "Packages/com.my.package" are virtual paths that Unity automatically resolves depending on where the package is
of course it works, I just had the worst typo in my filename 🤦♂️
but then why the GUIDs? if it works with the path itself? curious ...
In my experience you can't really stop people from moving files/folders somewhere else for random purposes. Packages go a long way guarding against that but not 100%
"guarding" in the sense of people not doing it, I wouldn't want to prevent them from doing it
Both methods are totally fine, just saying we've mostly switched to guid-based references. Or e.g. Shader.Find is unreliable because it will find whatever the first shader with a given name is, the guid will find exactly what you want
interesting, I always thought GUIDs are more fragile than filenames due to reimports, meta file deletions, etc. But I understand why you do it.
Hello everyone! 👋
Herbst recommended me to post an odd naming issue with hybrid packages here. It is thoroughly described in this forum thread with examples: https://forum.unity.com/threads/failed-to-create-folder-structure-when-importing-custom-package.1458016
Basically, you cannot import two packages that start with the same name, such as:
- com.cec.something
- com.cec.something.extension
I will throw this error: Failed to create folder structure: Packages/com.cec.something.extension
Super annoying. I want to reflect the way Unity names it's packages, like com.unity.render-pipelines.high-definition and com.unity.render-pipelines.universal.