-
-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added package manager support #408
Conversation
Added support for package manager and added Heathen's Foundation Extensions.
Added package manager installation instrucitons
Reduced the package structure to be Steamworks.NET only
Added your Steamworks Examples as a sample with a minor change. I added the camera back in to prevent the editor from griping. Also corrected a cut and paste error on our readme.md edit |
There's been some ongoing work here: #389 Could you rebase this CL on that branch to see what we want to take from this? I agree with merging the Example and Test projects in too, I definitely want to go with a larger Monorepo with the switch to packages. |
Yep will take a look at that this evening |
Took structure queues from unity-package branch to update the master
Okay so what is there now on the master takes its queues from what you had on the unity-package branch. The only funcitonal difference here from your unity-package branch is that I have included samples for spacewar ... and of course the switch to md for the license file so Unity Package Manager will see it properly. This should make it very easy to install, update, remove Steamworks.NET and selectivly install the examples scripts. Still needs some clean up around lack of namespace in the editor scripts, get rid of the IMGUI based UI in the example, etc. I will look at doing some of that later tonight to see what you like and dont like with it. Heathen has a number of extensions built around your Steamworks.NET some of which we do release freely on Unity Asset Store ... if there is any interest in included it here as a sample devs can pull in I can see what from that we can pull and make standalone and donate to the Steamworks.NET project. |
I updated the redist regarding the steam_appid.txt ... keep spaming me about not being able to write the steam_appid.txt fiile so I used our method and removed some old bits of code I found there that are only applicable to versions of Unity that are no longer supported. I pulled in a lite version of our Steam Settings concept (renamed to SteamSystem) and adjusted the names so that if it is adopted in Steamworks.NET it wont break anything for users using our toolkit. The core of it is a scriptable object that handles configuraiton and intialization of the API for client or game server based on UNITY_SERVER define. As an extra nice to have it also manages common artifacts (stats, achievements, leaderboard and DLC) these are also scriptable objects for easy referencing ... that can be striped away without adversly impacting anything. The main bits are SteamSystem = ScriptableObject and root of it all, this handles config and initalization of client API and game server API and also manages artifacts as scriptable obejcts for easy refrencing in Unity editor. SteamController = MonoBehaviour which deals with as little as possible mainly kicking off the start up, update loop and clean up based on Unity events. In addition there is an example scene demonstrating the extension in a manner similar to the current Spacewar example |
Correcting issue where the SteamSystem wasn't being marked dirty and so was not saving changes
I think we're going to need to squash all the changes in this to one, and then discard a lot of non-changes like .meta files changing. Then we probably will also need to move some of the other changes out into future changes, it's going to be too hard to take all of this at the same time. But most of this sounds pretty good. |
The fundamental change is everything except the Samples~ folder and the related samples entry in the package.json. That would get you into a shape that properly supports Unity's package manager and makes life much easier for importing and updating Steamworks.NET Interestingly just in the past few days we have had quite a few support tickets around updating Steamworks.NET plugin updates most of it comes from simpyl droping the unity package onto Unity. Unity tries to update assets by ID but any changes in name or additions or moves can result in duplicates or other issues and that is where we get calls :) Putting it to package manager would make it a simple button press to remove the old and import the new. On that my sugestion would be to strip back the concept and just do the plugin folder and editor scripts. Ideally updating the redist install stripping away anything older than 2018 LTS Can always bring in samples, tests, etc. later. Thats a relativly minor edit, if you would like I can set this branch up that way. Your still going to have a big structural change on master branch as it does mean removing the standalone folder and the meta files will be touched in all that I'm fairly sure. |
Reduced the concept to its minimal viable change
If the standalone folder is removed, and the VS sln/csproj within it, how will non-Unity C# users build/use Steamworks.NET? |
I would honistly run that as a seperate branch and since Unity's package manager can be a bit finiky about the pull from git I would have Unity be on the master and then provide the tools for non-Unity based C# project use a given branch |
As to the example scripts If you backburner pulling them, Heathen Engineering can have a think and ask our community what would they like to see in a simple demo of the API around Spacewar (480) and we can help build that out. I do think in hind sight that having the SteamSystem.cs ScriptableObject only deal with configuraiton and initalization is the way to go. So if the SteamSystem SO only dealt with config and initalization it would have the following features. Next would be the Game Server configuration and of course all of that buttoned up with UNITY_SERVER so that initalization done and what code is used is build setting specific and not something a dev needs to think to do in the config. Custom editor script on this to keep it clean and simple, menu editor script not just to create the SteamSystem object but also to link back to your repo, documentation, etc. For that matter the SteamSystem object and its behaviour should have [HelpUrl(...)] populated as well Finally the Steam Controller (call it what you like) but the behaviour. Keeping this little guy stupid simple my personal wants for that would be
|
My expectations are currently: (Where each number is a separate task)
|
Notes on each item I think "The Standalone folder should still exist, there will likely be other top level directories in the future ala 4 on this list." That said if its really near and deer to your or other peoples heart we can see what can be done here. I dont think you can direct package manager at a specifc sub folder or anything so its going to have to be a matter marking up the standalone bits so Unity doesn't complain about them in the package folders. Note Unity will complain if anything is missing its meta files and it will do taht cosntalty as it wont allow its self to create them. e.g. the LICENSE.md file must have meta file wiith it or Unity will gripe on each load that it cant modify the folder and that its missing meta files. I am 100% on board with Steamworks.NET remaining true to Steamworks SDK and not doing anything extra. That is one of the reasons we went with Steamworks.NET over Facepunch for our extensions. 100% on board with a completly new take on the exmple scripts and that is what I really meant with the "Heathen Extensions" that was just a pull from some of our tools as an example to show an approch you would see in other assets. Happy as noted to work on a from scratch example or rather many of them. I do agree; I think it should probably be a few focused examples aimed at teaching the API more so than demonstrating. 3-a) Steam Initalization 3-b) Sample Scripts
|
Re 1: There was some discussion about the folder structure here, #389 It did seem like it was possible to nest the package in a folder based on PixelWizard's version. 👍 I guess, the primary question around 1 is what's missing from this branch currently to call 1 complete, I thought I had tried it out in a Unity project, but I may not have gotten that far. https://github.com/rlabrecque/Steamworks.NET/tree/unity-package 1-a) Documentation Possibly just missing the LICENSE.md in the folder as well? Will read/reply to 2-4 later! |
Tested trying to install from his and yours and quickly nested my self on this fork and in all cases I was unable to install anything that was not set up in root. So if it is possible its not as strait forward as simply setting it up in root ... or im just thick :) Digging into it more trying out some of the git URL features that should work "https://github.example.com/myuser/myrepository.git?path=/subfolder" so let me give that a go the above does work ... I find it combersom but its servicable I do still think though it would be a cleaner process to go with root and use branches for other platforms ... or even if you wanted to make standalone the master https://github.com/heathen-engineering/Steamworks.NET.git#unity-package the above as an example would (so the docs say) pull from a given branch e.g. my preferance as a user is for clean repos that only have in them what is useful to the person pulling it Documentation on URLs and various options |
Great info! I agree that's not ideal, though a lot better than what we have now; I wonder if there's a way to get like a redirector of sorts. Like maybe having a package at the root that only includes the ?=path/com.rlabrecque.steamworks.net folder as a dependency or something? |
Hello, UPM support would be really great. If I may add some of my experience: We usually have our packages in situations like this in a Have you considered publishing to OpenUPM as well? (that way it would be even easier to add for a lot of people) Also: installed via |
I have looked at OpenUPM before it sounds like a great idea but something to look into after the basics of of a Steamworks.NET package manager structure is sorted out and applied to the repos. IMO getting a nice clean easy to understand structure set up is best for everyone. That is part of why I favor spliting the standalone stuff away from the package manager stuff by branch or similar not just a folder in the repo. In my ideal world as a user of the plugin I want a nice clean only has what I want in it repo or branch so when I pull it down to browse and learn there is nothing there but what is relivent to my use. |
So that would end up being Do you have any examples of other packages that are like this? Also what do each of these (?path=/, ?path=/com.rlabrecque.steamworks.net, and ?path=/package) look like in the Unity Package Manager and after import in your project files? I went with Definitely would want to look at OpenUPM more as well, that's probably an additional seperate step on my numbered list above.
I largely agree, but the balance I'm trying to strike is just that there's a rather surprising number of non-Unity Steamworks.NET users, I think the structure with the Unity Package, Standalone, and .github folders (and soon also the CodeGen folder) strikes the best balance. Ideally we can have clearer installation instructions in the primary README.md, then in the package directory have the README.md that ends up getting imported with the package inside Unity. The thinking is if we get most people installing it via the package manager (or even implicitly via other libraries which depend on the Steamworks.NET package), then it's very clean for the majority, they won't even see the Standalone folder, etc. 👍 |
I also wonder how the |
Same as with Unity's packages. when you use OpenUPM you add their registry to the scopedRegistries in manifest.json
and then you can add your package with |
Package Manager imported objects dont import into the project's Asset folder which is what is particularly nice about it By hidden folder I mean any folder ending in ~ Unity will ignore e.g. Samples~ Packages Will show
I get it and yes using a subfolder will mean package manager doesn't pull in the other bits. My thought was as a user using Git Desktop or similar and pulling the repo down and digging around as many are want to do. All that said from Unity's point of view and how we will be using it ya I'm fine with the package manager being in a sub folder or whatever as long as it has all its bits in there and they all have metadata thats the only real requirement to get that "net gain" from all this effort. Another advantage of moving it to a different branch or folder whatever suits is that the root doesn't need the meta files and LICENSE can be a .txt as opposed to .md for the root. As noted previously I dont think many people have a default program set up to read .md Unity's insistance that it be a .md is a bit anoying :) no reason to make non-Unity users suffer ;)
Looks like UPM handles this just fine; haven't tried it yet but documentation wise I dont see a roadblock with subfolder or branch or both being used. |
This renames the package folder to "UnityPackage" and updates the README with the Unity PackageManager path that should be used for this structure
Just a bit restructuring to see how it will look on the GitHub page |
Hmm wasn't my intention to close this, looks like it happened when I merged unity-package into master and closed it :/ |
I can recreate if you need, let me know |
Updated the repo to make it freindly to Unity package manager.
Part of this is to remove the editor script dealing with writing the steam_appid.txt file. While handy it can get in the way of other modifications and its not really saving a user much effort. Note that a package is treated as immutable so we dont want to put anything in a package that might need to be edited by the end user.
The main change you will see to the repo is the addition of the package.json and re structuring of licnese into an md so the package manager can understand it. We also added an assembly def Steamworks.NET.Runtime which is configured to only work on valid Steam platforms which makes the #ifdef statements in your source redundent for platform specific compilation but no harm. This also makes it possible for other assets to reference Steamworks.NET properly. Also as a package manager compatable package its possible for other developers to create a dependency with it via its name "com.rlabrecque.steamworks" and the version they want to be dependent on.
Finally a minor update to the readme to include instructions on how to install it via the package manager.
Note the package manager can also support "samples" these are additional downloads the user of your package can pull in on demand. Also note that samples are the immutable exception that is they are pulled in as "Samples" into the main Assets folder and can be modifed by the end user without issue.