Search Unity

AI Planner

Discussion in 'AI & Navigation Previews' started by amirebrahimi_unity, Mar 23, 2019.

  1. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    223
    This was just fixed in the latest release (preview.7)
     
  2. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    223
    This is likely due to an aging entites, which the extant version of the planner depends on. This will change in the future, so that entities can be updated more frequently than releases of the planner. Also, we currently aren't developing on 2019.3 internally yet.
     
  3. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    223
    We did a small update, which was just posted, but the update to Entities 30+ will come with our next larger release because it required a re-working of the visualizer to support the changes that came with that version.

    At the time I posted that original comment I thought our next release was "right around the corner", but that turned out to be the many months of refactoring that we have done to improve the planner overall.
     
  4. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    223
    There is a bug in the extant version that does not create multiple worlds, so that many agents can run with the same domain definition. This has been completely refactored in our next larger release we are hoping to get out in August.
     
  5. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    223
    @JustinLarrabee and @zephyr831125, our intention was not to create class-based polymorphism where boxing and managed allocations normally occur. What you are currently looking at has been refactored in our next larger release (i.e. ~August), but the templates remain. This allows us to prevent boxing by referencing specific interfaces with constraints like 'struct'. It also makes the planner easier to extend with custom domains (e.g. deterministic or non-trait based).
     
  6. Justin_Larrabee

    Justin_Larrabee

    Joined:
    Apr 24, 2018
    Posts:
    84
    Thanks for the update, looking forward to trying the new release.
     
  7. threedots1

    threedots1

    Joined:
    Oct 9, 2014
    Posts:
    26
    Good to know.

    Given that the planner requires compilation of a DLL before runtime, what restraints does this place on using runtime generation of a world and objects?

    Our project contains a procedurally generated world with definitions of items and 'agents' being loaded from external files. The components that everything is made up from is hardcoded though.

    Will this affect the ability to use the planner?
     
  8. mplantady_unity

    mplantady_unity

    Unity Technologies

    Joined:
    Jun 19, 2019
    Posts:
    3
    What is compiled in the assembly is a model that is used to describe your world (type of resources, state of objects...) and how it can evolve. Even if your world and objects are generated it's based on rules and predefined components, so no issue to use the Planner!
     
  9. hamokshaelzaki

    hamokshaelzaki

    Joined:
    Nov 6, 2012
    Posts:
    16
    Hello, I tried several times to import the package on 2019.3.01a11 but

    Assembly 'Unity.Properties.Codegen' is a CodeGen assembly and cannot be Auto Referenced (Packages/com.unity.properties/Unity.Properties.Codegen/Unity.Properties.Codegen.asmdef)
     
  10. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    14
    The package does not yet support 2019.3. You'll find that even if you work around the auto reference issue, there are also errors with the versions of burst (preview.8) and entities (preview.30) we depend on, when using 2019.3. We're updating our dependencies in the next release (projected later this month), with better support for 2019.3 coming as well later this year.
     
    hamokshaelzaki likes this.
  11. hamokshaelzaki

    hamokshaelzaki

    Joined:
    Nov 6, 2012
    Posts:
    16
    Thanks for that,

    I already reverted back to 2019.2
    but I have another issue

    I have 2 simple actions with debugging lines, that's it, really simple, but I always have this

    ArgumentException: The entity does not exist
    Unity.Entities.EntityDataManager.AssertEntityHasComponent (Unity.Entities.Entity entity, Unity.Entities.ComponentType componentType) (at Library/PackageCache/com.unity.entities@0.0.12-preview.30/Unity.Entities/EntityDataManager.cs:370)
    Unity.Entities.EntityDataManager.AssertEntityHasComponent (Unity.Entities.Entity entity, System.Int32 componentType) (at Library/PackageCache/com.unity.entities@0.0.12-preview.30/Unity.Entities/EntityDataManager.cs:378)
    Unity.Entities.EntityManager.GetBuffer[T] (Unity.Entities.Entity entity) (at Library/PackageCache/com.unity.entities@0.0.12-preview.30/Unity.Entities/EntityManager.cs:1729)
    DomainDef.DomainDefUpdateSystem.StateEquals (Unity.Entities.Entity lhsStateEntity, Unity.Entities.Entity rhsStateEntity) (at Assets/AI.Planner/Generated/DomainDef/DomainDef.cs:171)
    Unity.AI.Planner.PolicyGraphUpdateSystem.LookupState (Unity.AI.Planner.HashCode stateHash, Unity.Entities.Entity stateEntity, Unity.Entities.Entity& matchedStateEntity) (at Library/PackageCache/com.unity.ai.planner@0.0.1-preview.7/Runtime/Planner/Planner.cs:764)
    Unity.AI.Planner.PolicyGraphContainer.UpdateRoot (Unity.Entities.Entity stateEntity, System.Int32 searchHorizon) (at Library/PackageCache/com.unity.ai.planner@0.0.1-preview.7/Runtime/Planner/Planner.cs:235)
    Unity.AI.Planner.PolicyGraphContainer.UpdatePlan (Unity.Entities.Entity stateEntity) (at Library/PackageCache/com.unity.ai.planner@0.0.1-preview.7/Runtime/Planner/Planner.cs:246)
    Unity.AI.Planner.Agent.Controller`1[TAgent].CompleteAction () (at Library/PackageCache/com.unity.ai.planner@0.0.1-preview.7/Runtime/Agent/Controller.cs:123)
    Unity.AI.Planner.Agent.Controller`1[TAgent].Update () (at Library/PackageCache/com.unity.ai.planner@0.0.1-preview.7/Runtime/Agent/Controller.cs:76)
    BotAgent.Update () (at Assets/AutoRoyale/AI/BotAgent.cs:18)


    I looked at the replied from page one with a similar log, but couldn't figure out a workaround.
    I did the initialization, domain and plan as following.
    And I'm running Controller.Update in the BotAgent.cs Update()
    1.JPG 2.JPG
     
  12. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    14
    So looking at your error trace, what stands out to me is

    DomainDef.DomainDefUpdateSystem.StateEquals (Unity.Entities.Entity lhsStateEntity, Unity.Entities.Entity rhsStateEntity) (at Assets/AI.Planner/Generated/DomainDef/DomainDef.cs:171)


    Is this line (171 in DomainDef.cs) accessing a buffer of type DomainObjectReference through the EntityManager? If so, did you set up your initial state on your agent script? The buffer is added to the state entity on the initial state creation.
     
  13. hamokshaelzaki

    hamokshaelzaki

    Joined:
    Nov 6, 2012
    Posts:
    16
    I did set it up in the inspector, is there anything else should be done in the code too? Referencing to Otto.cs there was no addition of a buffer to the agent. only reading from m_EntityManager.
    Am I missing something else?
     
  14. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    14
    Can you post a screenshot of your agent inspector with the initial state?
     
  15. Rhyusaky

    Rhyusaky

    Joined:
    Jan 22, 2016
    Posts:
    17
    It is not working on Unity 2019.2.1f1
    When I install, it give-me some errors related to namespaces like 'Generation'
     
  16. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    14
    The current version only supports 2019.1. Our next release will be compatible with 2019.2. We're planning to release the next version by the end of the month.
     
  17. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    100
    Are Unity AI and Machine Learning Tools for Behavior Generation at SIGGRAPH 2019 tech talk going to be available online?
     
    Last edited: Aug 26, 2019
  18. alexchesser

    alexchesser

    Joined:
    Sep 15, 2017
    Posts:
    24
    Hi there,

    I've just discovered the AI planner package today and think it is really exciting. In looking at a fresh checkout of `0.0.1-preview-7` it appears to throw a series of errors.

    Rather than paste them all I'll pick out a selection to see if there's something obvious (like an additional dependent package needed)

    Code (Boo):
    1. Library\PackageCache\com.unity.ai.planner@0.0.1-preview.7\Runtime\Data\DomainDefinition.cs(13,24): error CS0234: The type or namespace name 'Codegen' does not exist in the namespace 'Unity.Properties' (are you missing an assembly reference?)
    2.  
    Code (CSharp):
    1. Library\PackageCache\com.unity.ai.planner@0.0.1-preview.7\Runtime\Data\DomainDefinition.cs(15,24): error CS0234: The type or namespace name 'Serialization' does not exist in the namespace 'Unity.Properties' (are you missing an assembly reference?)
    2.  
    Code (CSharp):
    1. Library\PackageCache\com.unity.ai.planner@0.0.1-preview.7\Runtime\Utility\ToStringPropertyVisitor.cs(122,14): error CS0246: The type or namespace name 'ICustomVisit<>' could not be found (are you missing a using directive or an assembly reference?)
    2.  
    Code (CSharp):
    1. Library\PackageCache\com.unity.ai.planner@0.0.1-preview.7\Runtime\Utility\ToStringPropertyVisitor.cs(16,25): error CS0246: The type or namespace name 'StringBuffer' could not be found (are you missing a using directive or an assembly reference?)
    2.  
    I've watched the first couple of videos on youtube and am sortof poking around and experimenting to try and see what working with this feels like.

    Perhaps there is missing information in the manual https://docs.unity3d.com/Packages/com.unity.ai.planner@0.0/manual/index.html ?

    I am using unity 2019.2.2f1


    EDIT: apologies... I just saw the comment two posts above this one. You don't support 2019.2 yet :)
     
  19. growling_egg

    growling_egg

    Joined:
    Sep 2, 2012
    Posts:
    51
    Agreed, I think I need some sort of support group to help with my excitement for not-quite-yet available game dev tools.

    None of my friends are into game development but Otto haunts my waking dreams...
     
    amirebrahimi_unity likes this.
  20. threedots1

    threedots1

    Joined:
    Oct 9, 2014
    Posts:
    26
    Yeah I'm hanging to get my hands on this as well. Hopefully not too long now.
     
  21. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    223
    I'm told that this should be available towards the end of next week. Most likely this will come on Unity's YouTube channel, so check there.
     
    alexchesser, vx4 and growling_egg like this.
  22. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    14
    growling_egg, Djayp and alexchesser like this.