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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    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

    Unity Technologies

    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