Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Generated packages in version control

Discussion in 'AI & Navigation Previews' started by MichaelRomer, Nov 15, 2021.

  1. MichaelRomer

    MichaelRomer

    Joined:
    Mar 1, 2021
    Posts:
    2
    Hello together,

    I am developing an application using the AI planner, semantic traits and git version control.
    The AI planner and traits package perform code generation which results in new packages being generated in the Packages directory inside the unity project: generated.ai.planner.plans, generated.semantic.traits, ...

    Initially, I decided to exclude those from the version control, as in theory generatable/buildable files should not be included. An additional benefit is that it does not matter if re-generation of the traits/AI planner is forgotten when commiting the changes.

    However, this leads to another problem. When pulling/cloning the project on another machine the packages are re-generated with new GUIDs in the .meta files. This leads to missing references, as the generated trait scripts cannot be found due to their new GUID. This does not happen to traits that are already provided by the traits package (e.g. the location trait).

    Therefore I am assuming that there must be some way to define the GUIDs in such a way that they are kept on other machines. Unfortunately I dont know how unity packages provided through the package manager deal with this problem.

    This leads to my question: is there a better solution than just commiting the generated packages including the.meta files?

    Greetings
    Michael
     
  2. Djayp

    Djayp

    Joined:
    Feb 16, 2015
    Posts:
    114
    I would commit a zip with the meta files only and replace them once the packages are generated.
     
  3. amirebrahimi_unity

    amirebrahimi_unity

    Joined:
    Aug 12, 2015
    Posts:
    400
    Similar to the above you could commit the .meta files only for the generated files and just revert any changes to those on new clones. Might require a reimport after though.
     
    MichaelRomer likes this.
  4. MichaelRomer

    MichaelRomer

    Joined:
    Mar 1, 2021
    Posts:
    2