Forum rules - please read before posting.

Suggestion: Menu option to "Convert installation to UPM package"

edited February 2021 in Technical Q&A

My biggest gripe with AC has always been the fact that anytime you change one line of your own code, Unity recompiles all AC code as well. Now it appears that the deterministic compilation in modern versions of Unity 2020.2 now treats assembly definition files as advertised (not only in the IDE that works with the resulting VS projects, but finally also in Unity itself), so adding the two assembly definitions files (as described by @stranger here https://adventurecreator.org/forum/discussion/6894/optimizing-compile-time/p1) now makes more sense than ever.

As mentioned on that thread, one problem might be updating existing AC installations. While moving to UPM packages seem to be the way for all Unity assets eventually, I suggest AC starts with an opt-in approach by adding a "Convert installation to UPM package" or "Move AC to Packages folder" menu item under the Adventure Creator menu.

Clicking this menu item would:

  • Move the AdventureCreator folder from Assets to Packages
  • Create the package.json (and the two .asmdef files)
  • Update a setting in Project Settings/AC that Resources.cs uses in runtime to resolve paths

This way AC gets to try life as a UPM package, all AC updates should work fine regardless of where the files are located, and best of all - faster iteration times 👌

Comments

  • edited March 2021

    Noted.

  • Any news on weather this (or some other conversion to UPM package) is coming down the pike?

    Thanks!

  • edited June 2021

    I'm not convinced that upgrades would be seamless. The best outcome would be for Unity to allow assets to be available as packages directly on the Asset Store, in which case I would treat that as a viable option.

    I would consider making optional changes to Resource.cs etc behind a scripting define symbol, however, to ease the above should you attempt this manually.

  • Oh, a scripting define symbol would be super appreciated!

    And separating the Editor from the Runtime scripts into two different folders would make it super easy to create the required .asmdef-files. Note that these files should still provide faster compilation, even if they are keps in the Assets folder.

    I also think it's bit of a missed opportunity that it's currently impossible to create a package that depends on AC since AC cannot be separated from the game itself. This really limits the options of making clean expansions of the AC asset.

    Regarding upgrades, I manually moved all other assets that hasn't yet ported into packages, and have yet to experience any problems during upgrades.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.