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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Official AI Planner version 0.2.4 released

Discussion in 'AI & Navigation Previews' started by TrevorUnity, Nov 5, 2020.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,075
    @TrevorUnity Do u mean dots AI package like dots behavior tree?
     
    vx4 likes this.
  2. haraldger

    haraldger

    Joined:
    Nov 5, 2021
    Posts:
    10
    @TrevorUnity I am getting the following error on a seemingly simple domain:

    "ArgumentException: A component with type:BuildBarracksFixupReference has not been added to the entity."
    (BuildBarracks is one of my defined actions)

    I can't really figure out whether I am doing something wrong, it all looks good to me.

    I know you said the package hasn't been in active development for a long time but is there any chance at all there might be some way to resolve my compilation errors? Currently writing a bachelor thesis on the AI Planner package :/
     
  3. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    Hi, @haraldger! I've seen this error a few times. Typically, it means one of the earlier planning jobs failed. Are you seeing any other errors? Are you using custom preconditions or custom action effects? That tends to be where these failures crop up.
     
  4. haraldger

    haraldger

    Joined:
    Nov 5, 2021
    Posts:
    10
    Hi @TrevorUnity! Thanks for your response.

    I'll post a screenshot of the other error message I got below. There are also some warnings that I think are unrelated because I haven't seen them before, but the two error messages are what I have been getting lately.

    In terms of custom actions and preconditions, I haven't included anything custom. All my actions, problem definitions and termination criteria are very basic and simple ones, basically just following along the provided instructions in the AI Planner documentation.

    upload_2022-2-9_10-37-5.png

    Let me know if there's anything else I can provide that might help, code etc.

    Cheers!

    PS. I have noticed a couple of other issues quite frequently that I'd be happy to share as well.
     
  5. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    Hmmm. It's hard to tell from this what the issue might be. Can you share the BuildBarracks code, either here or over DM?
     
  6. haraldger

    haraldger

    Joined:
    Nov 5, 2021
    Posts:
    10
    @TrevorUnity Sharing here so others might benefit!

    A screenshot of the BuildBarracks action in the unity editor. I'll upload the code file as well.
    upload_2022-2-12_12-48-26.png

    Do let me know if there are any other files I can provide.

    Again, thanks for taking the time to help. Greatly appreciated!
     

    Attached Files:

  7. haraldger

    haraldger

    Joined:
    Nov 5, 2021
    Posts:
    10
    Stack trace seems to point to the following line 143. Not sure what < m_StatesToExpand[jobIndex] > does, but yeah.

    upload_2022-2-12_12-53-6.png


    Here is the declaration on line 28.
    upload_2022-2-12_12-55-42.png
     

    Attached Files:

  8. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    Without going too much into the details, that array represents the set of states on the horizon of the plan graph which are selected for forward simulation, in which potential actions are computed applied to said states, extending the plan graph. The array should not be empty, however. This particular error is new to me.

    Are you able to see any states in the plan visualizer when this error occurs? Is the plan considered complete (check the root state's complete status)?
     
    Metron likes this.
  9. haraldger

    haraldger

    Joined:
    Nov 5, 2021
    Posts:
    10
    @TrevorUnity Hi.

    The below is what the plan visualizer gives when I run the program. It seems to me that basically no plan is generated at all, and it is immediately marked as complete.

    upload_2022-2-16_14-49-2.png

    This has me thinking that there may be something I am doing wrong in my plan/termination definitions, although I have no idea what. Not sure why that would throw an argument exception, though.

    Cheers

    EDIT for some context, the building spot and citadel objects are two objects that are part of my scene, nothing that has been generated by the planner or anything like that.
     
  10. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    Apologies for the delayed response; I was OOF last week.

    That could be it, certainly. There are two causes for states to be marked complete: (1) the termination criteria is fulfilled, or (2) no valid action can be taken in the state. If you look over the actions in you've specified in the plan definition, is there any action whose preconditions are completely satisfied by this state?
     
  11. haraldger

    haraldger

    Joined:
    Nov 5, 2021
    Posts:
    10
    @TrevorUnity Sorry for also delayed response.

    Currently I only have one action, and it doesn't have any preconditions. This is what it looks like:
    upload_2022-3-2_20-34-13.png

    It's a very simple model, I didn't make it very far before getting errors D:

    This is the plan definition:
    upload_2022-3-2_20-35-16.png

    And there are no initial objects of type Barracks, so the plan wouldn't be terminating immediately on start up.

    Weird thing is that it was working at one point, but then (seemingly) inexplicably stopped working. My AI was actually building barracks! I don't know what I did and can't pinpoint exactly when it changed. I did have a lot of trouble with duplicate files however. I remember that the auto-generated code would generate duplicates, and I would have to manually delete the files. Maybe that helps? In case I messed something up and deleted something crucial. But then after that I re-did the entire project from scratch without deleting any files just to make sure that wasn't the issue.
     
  12. haraldger

    haraldger

    Joined:
    Nov 5, 2021
    Posts:
    10
    And just to re-iterate on some of my earlier posts, here is the error log I'm getting whenever I fire up the program:
    upload_2022-3-2_20-39-51.png
     
  13. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    This is very strange, indeed. Your action definition and state data indicate you should be able to build a barracks at the free building location. It's promising that it worked at an earlier point. When you recreated the project, did you delete the generated code ("AI Planner Plans" and "AI Planner StateRepresentation" in your packages directory) and regenerate it from the authoring assets?

    If you're handy with a debugger, you can also try setting a breakpoint in the job code for the action Build Barracks. A great place to start is in the execute method, after the action's valid argument permutations are computed (looking for >1 valid set of arguments).
     
  14. haraldger

    haraldger

    Joined:
    Nov 5, 2021
    Posts:
    10
    @TrevorUnity So when I recreated the project I didn't delete any of the generated code. But I didn't have to, because I got this very error immediately before any duplicates had had a chance to be generated.

    I'll give the debugging a try, although I'm not sure exactly what I'm looking for?
     
  15. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    I'd still recommend deleting the generated code for a fresh try. Occasionally, I have come into a situation where I've generated code with some set of preconditions/effects, then change one or more and forget to regenerate, causing issues down the line when the removed (in asset) parts linger in the generated code silently.

    Ah. I'll explain what you should look for. Without going too much into detail, given a target state, each action job first computes every valid permutation of action arguments (correct traits, satisfies precondition constraints), then for each permutation generates a resulting state (what the state should be after the action). I suspect your issue is somewhere in this process.

    By setting breakpoints in the action job, you should be able to quickly see if any valid argument permutations are found. If valid arguments were not found, the issue is likely at the point of querying the state and checking preconditions (in
    GenerateArgumentPermutations(...)). However, if valid arguments exist, the problem is likely in the forward simulation (in ApplyEffects(...)).
     
  16. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    415
    So AI team were busy making DOTS Navigation which is being on hold now. Will you guys resume work on AI Planner now? If not can you give us some insight into what are you working on?
     
  17. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    The AI teams are working on a few new projects, though it's too early to share information on them quite yet. I can confirm that the AI Planner is not part of these new initiatives, though some of the tech and many of the learnings we gained during development are heavily influencing the new tools.

    Regarding timing of future announcements on these fronts, I wouldn't expect any public news for six months to a year. Until then, you can track roadmap changes and request new features/tools through the public Unity roadmap portal: https://unity.com/roadmap/unity-platform
     
    DannyWebbie likes this.
  18. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    415
    I see, thanks for update
     
  19. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    732
    Unity really needs to open source and let us devs help make these things based on what unity wants, having these features announced in 2018 then put on hold 4 freaking years later, with likely no new updates for another year... Engines are made faster than some of these features it's ridiculous.
     
    TrevorUnity and vx4 like this.
  20. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    Is there a way to make AI Planner part of new initiatives?
     
  21. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    The best place to provide feedback on tools and features you'd like to see is the public roadmap, linked in my original comment. I'll note that under each sub-area, you can submit ideas/requests in the "Under Consideration" section. Relevant areas to our projects:

    https://unity.com/roadmap/unity-platform/navigation-game-ai
    https://unity.com/roadmap/unity-platform/3d-characters-and-animation
    https://unity.com/roadmap/unity-platform/gameplay-ui-design
    https://unity.com/roadmap/unity-platform/dots
     
  22. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    We can't account for all of Unity's codebase, but if you are using any of our packages (AI Planner, Traits, NavMeshComponents), you can copy the package files to a custom folder and import the package from disk, allowing you to make arbitrary changes to the code.
     
  23. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,083
    Bad thing about feedback site is that we can not see feedbacks of others and can not like them or vote for them

    So this looks like scream in a hole :)
     
  24. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    I understand that perspective. I quite enjoy hearing what other people have to say and often learn something in the process. Next time I meet with the relevant persons who manage the public roadmap, I'll raise the issue.

    That said, requests and comments made on the public roadmap portal are absolutely seen internally, from product managers operating at the top of the business down to specialized engineers such as myself. It is one of the up-and-coming means of receiving this kind of feedback from our users, and I would encourage its use despite the limitations on discoverability and the one-sidedness of the input.

    Of course, also keep having discussions here in the forums too. :)
     
    JesOb, DannyWebbie and Anthiese like this.
  25. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,006
    @ericbegue added GOAP in his PANDA.BT, I think it's the official version now.
     
    TrevorUnity likes this.
  26. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    732
    It would be nice to have a response though, even Microsoft manages to reply with visual studio recommendations even if rejected or merged to another pre-existing idea.
     
  27. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    hi,is there any update for 2023.
     
  28. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    Hello, vx4! We're not ready yet to announce or unveil anything just yet. That said, development on our next project has been proceeding quite well, and we are hoping to move from internal to public testing in the first half of 2023. We'll make an announcement here as soon as it's ready.
     
    Qhuhuit and Ruchir like this.
  29. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    179
    thx for the update and amazing work.
     
  30. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,457
    Wow, thanks so much Trevor and AI planner team for this amazing package. I just learned about AI planner recently from a collegue and would like try it out. I attempted to install 0.30 preview of AI planner in unity 2021.3.9 LTS and got these errors.

    There are so many dependencies related to burst, jobs, entities, etc. Can you suggest what is the latest version of unity that AI planner works in and what versions of the various packages are needed.

    Many thanks.
     

    Attached Files:

  31. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    415
    @TrevorUnity Any news? Really curious what are you guys coocking behind the closed door...
     
    filod, dannyalgorithmic and vx4 like this.
  32. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    201
    Can you share some infomation like the scope of the project ? (a behavior tree/utility ai/planner or something else?) if not, can you elaborate why unity choose such "Close Door" strategy ?
     
  33. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    Sorry for the prolonged silence, everyone. As you may know, there have been many changes at Unity over the past year, which has unfortunately impacted our proposed release path and timeline. Despite our project's development staying on track, we've been asked to bump the experimental release to the fall, with an associated presentation at Unite 2023 in November.

    My team is still hard at work on the new tool, which will target gameplay and behavior, much like the other tools we've worked on over the years. While we're waiting for the eventual release, we've been packing in as many QoL, user-friendly UX, and cutting edge experimental features as we can. I admit this all is quite vague. I wish I could provide more details, but until we have comms approval, it's going to be quiet here for the time being.
     
    optimise, PaulMDev, Onigiri and 2 others like this.
  34. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    201
    THX for reply, will it be dots ready then?
     
  35. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    It will target GameObject workflows initially but should be compatible with hybrid ECS projects. We're in talks with the relevant teams about the potential for a pure DOTS backend, but until we have sufficient demand and investment for that path, it will likely remain a desired feature more than a committed one.
     
  36. filod

    filod

    Joined:
    Oct 3, 2015
    Posts:
    201
    hybrid sounds fine, or a frontend/api layer would also be a great choice, take your time and keep doing these amazing work!
     
  37. leanon00

    leanon00

    Joined:
    Apr 4, 2020
    Posts:
    2
    Hi, would it be possible to have a small update that would make the AI planner usable with a newer version of unity?
    Right now it is not usable with anything that uses a newer version of Entities :(. I was hopping to use it in my project in an unfinished state and update it once an official stable version is release.
     
  38. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,075
    Is the new tool called utility AI that I asked for years?
     
  39. TrevorUnity

    TrevorUnity

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    117
    I wish I had the time to attempt an update, but the truth is we're a little understaffed and have our hands full at the moment. I'm sorry to disappoint. :(

    I can confirm it is not utility AI, though I wish we could develop a package for it. I have yet to find a 3rd party utility AI system that I would recommend highly.
     
    vx4 and optimise like this.
  40. ldlework

    ldlework

    Joined:
    Jan 22, 2014
    Posts:
    46
    Would it be possible to get the source code for the AI Planner?
     
  41. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    10,078
    You can have it, just download through Package Manager like this:

    Capture.PNG

    Capture1.PNG

    Capture3.PNG
     
  42. ldlework

    ldlework

    Joined:
    Jan 22, 2014
    Posts:
    46
    Thanks for the quick reply, I appreciate it (I should've thought of that..)

    Another question I had was; can the authors helpfully link to any papers they read in developing their approach of a trait-based query system, etc?
     
    Ruchir likes this.
  43. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,006
    No worry, there are enough lightweight AI stuff out there. What did your team get moved to?
     
  44. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    732
    Did you have a road map for this package perhaps regular developers can finish where you left off. These kinda projects feel like community involvement rather than just unity staff would be great for the engine. Like a trusted developer programme for people to contribute.
     
    jasonboukheir3 and vx4 like this.