Search Unity

AI Planner - v0.1.1-preview Release!

Discussion in 'AI & Navigation Previews' started by TrevorUnity, Aug 30, 2019.

Thread Status:
Not open for further replies.
  1. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    288
    We will have a variety of smaller samples soon. We already have these internally, but they require more documentation. Re: the link you've provided -- I believe if you can map the steps over to the planner that you should be able to re-create that example with the AI Planner.
     
  2. Blargenflargle

    Blargenflargle

    Joined:
    Feb 24, 2019
    Posts:
    3
    Awesome! This is very good to hear. People are mentioning that the planning algorithm is ECS so it should be fast. Is there any metric you can give us on approximately how fast it is? I know this is an awkward question to answer (especially at an early stage) but since it is essentially A* would it be comparable? For instance, this person claims you could handle "a few hundred thousand" agents under ideal circumstances in ECS: https://forum.unity.com/threads/100-000-entities-traversing-navmesh.534526/

    Is GOAP comparable to A*? Or is GOAP significantly heavier than A* since you have to build out the possibility space every time before you navigate it? Sorry if this is rambling. I'm very excited about your work.
     
  3. Zennythedreamer

    Zennythedreamer

    Joined:
    Mar 8, 2019
    Posts:
    3
    Hi! first of all want to say that this AI planner is awesome, I've been playing around with the "Otto" project and this seems like a good system to implement into a game I'm making for my senior project. I've followed the instructions in the package documentation and have been using Otto as a guide but have reached a roadblock when trying to create my agent class and was hoping someone could point me in the right direction. I get no errors when I build the assembly and have tried the debug option and it shows that all the files are being generate.
    However when I try to implement my own agent class I get the following errors. upload_2019-11-22_11-20-48.png
    After a while I also get the error - "Copying assembly from 'Temp/Unity.Entities.StaticTypeRegistry.dll' to 'Library/ScriptAssemblies/Unity.Entities.StaticTypeRegistry.dll' failed". Using unity version 2019.2.0b2 for otto and this project.
    If someone could tell me what i'm missing or point me in the right direction, it'd be greatly appreciated. Thanks!
     

    Attached Files:

    Last edited: Nov 22, 2019
  4. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    288
    The planning algorithm isn't ECS, but rather ECS-friendly. More importantly, it is jobified (i.e. threaded), so that it would be future-proofed to work with ECS. We have not done any rigorous performance comparisons, but it is something we hope to do and to compare it to other approaches and/or other planners.

    The planner algorithm is not A*, but rather a bounded heuristic-based graph search. However, they do share the same computation complexity order. It's hard to compare it with the forum post you mention because it isn't an apples-to-apples comparison and would require a deeper dive into that implementation.

    GOAP makes use of A*, but has a predicate-based state representation. So, to your question about it being heavier, the answer unfortunately is one of "it depends". The choice of state representation and the calculations you do in the heuristic are what factors in.
     
  5. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    288
    For your own EnemyAIAgent are you attempting to re-use the same domain that Otto uses or are you creating a new one? Do you have an assembly definition (i.e. asmdef) that your EnemyAIAgent.cs file is contained within?
     
  6. Zennythedreamer

    Zennythedreamer

    Joined:
    Mar 8, 2019
    Posts:
    3
    I attempted to create a new domain for my project. As for your second question, I'm not entirely sure what you mean but I've attached screenshots of the script and my AI.Planner folder in hopes of answering the question. upload_2019-11-22_18-35-10.png
    upload_2019-11-22_18-36-29.png
    It seems like the script continually tries to recompile once the domain has been generated.
     
  7. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    104
    Now entities package was release, waiting for the new releases :).
     
  8. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    288
    I think there is a bug in the ConditionalCompilationUtility that we use. Can you try adding the defines to your project settings directly:

    PLANNER_DOMAIN_GENERATED
    PLANNER_ACTIONS_GENERATED

    If that doesn't stop the continual compilation loop, then go into Packages/com.unity.ai.planner/Runtime/Utility/ConditionalCompilationUtility.cs and add a return at the beginning of the static constructor (line 52)
     
  9. forcepusher

    forcepusher

    Joined:
    Jun 25, 2012
    Posts:
    197
    Hello. Are there any plans to implement prediction of other agents actions ? I think it would be related to planning multiple agents that affect the same domain together.
    Example: Player intentionally drops an item on the ground that has very high reward. All NPCs that can see the item start moving towards it to grab it. NPCs have no idea that player have done that intentionally to set up a booby trap. If they considered a player as an agent participating in a domain simulation, they would know he'll take the item back.
     
    Zennythedreamer likes this.
  10. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    27
    Explicit support for modeling other agents is not currently in our roadmap, as the forms and uses of such predictive models are rather domain/game-specific. It's unlikely that we'd be able to provide a universal solution, particularly as the scale of the problem can vary greatly. For example, should the model predict (1) the effects of the other agent's current action, (2) the effects of each stage of the other agent's current plan, or (3) the possible set of plans the other agent may switch to in the process of interacting with other agents/the game/etc? From the perspective of agent A, should the model of agent B include B's model of agent A, forming a recursive modeling loop? It depends on the application, as well as the ability to tractably solve such problems at sufficient scale, unfortunately.

    That said, I believe we have an opportunity to release small samples which illustrate various strategies for handling the uncertainty of other agents' actions, including that of human players. I'll give a brief overview of how you might tackle this problem with our current tools:

    In our trait-based language, you can model another agent as an object with an "Intent" trait, which can hold data such as an enum of possible intents (e.g. steal an object, attack an agent, hide, etc) as well as other metadata you might want to include. Then, you can condition the effects of your agent's actions to add additional effects of other agents accordingly (see: ICustomActionEffects).

    If you want to share intent across agents, you might consider a blackboard or some other solution in which agents can publicly post intent to be consumed by other planning agents. If you want some uncertainty over intent---such as when modeling a human player---you may consider associating each intent with some probability and assign probabilistic outcomes to each action (e.g. 30% player consumes a potion, 70% attacks an agent). You can take this one step further by creating a module which attempts to infer player intent, adjusting the intent probabilities accordingly.
     
  11. PaulUsul

    PaulUsul

    Joined:
    Nov 20, 2012
    Posts:
    22
    Really loving the well thought out and thorough responses!

    What's the eta on versions that work with 2019.3 and 2020? Last release was august 30? are you aiming for a smaller release cycle or around a 100 days? what's currently blocking you now that entities are out and is it a systemic or solvable problem/actor?

    How many people are you on the ai planner project and what kind of cool things are coming? 69 work days since last release must be quite a lot of features and fixes :D

    It looks like entities 0.3.0 just came out too :)
     
    vx4 likes this.
  12. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    27
    We are putting the final touches on the next release right now, actually. Should be out within a week. :)

    The release cycle window is largely dependent on the scale of the new features. This next update has changed the package quite considerably, as we wanted to improve the authoring experience quite a bit. Internally, we've been working with customers in order to receive feedback, try new features, fix bugs, etc. The following release will likely be smaller in scale and have a shorter timeline.

    The planning team is 2.5 engineers, currently (keep your eye on the Unity job board in 2020 :D). We're also involved with other projects within the AI team, not all of which have been publicly discussed, so expect even more exciting news from the team in the coming year!
     
    Djayp, PaulUsul, vx4 and 1 other person like this.
  13. PaulUsul

    PaulUsul

    Joined:
    Nov 20, 2012
    Posts:
    22
    That's great news and sounds really good! I can't wait to see more :D super exciting!!
     
    vx4 likes this.
  14. amirebrahimi_unity

    amirebrahimi_unity

    Unity Technologies

    Joined:
    Aug 12, 2015
    Posts:
    288
    Djayp likes this.
Thread Status:
Not open for further replies.