A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Separate names with a comma.
Discussion in 'AI & Navigation Previews' started by TrevorUnity, Nov 5, 2020.
@TrevorUnity Do u mean dots AI package like dots behavior tree?
@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 :/
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.
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.
Let me know if there's anything else I can provide that might help, code etc.
PS. I have noticed a couple of other issues quite frequently that I'd be happy to share as well.
Hmmm. It's hard to tell from this what the issue might be. Can you share the BuildBarracks code, either here or over DM?
@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.
Do let me know if there are any other files I can provide.
Again, thanks for taking the time to help. Greatly appreciated!
Stack trace seems to point to the following line 143. Not sure what < m_StatesToExpand[jobIndex] > does, but yeah.
Here is the declaration on line 28.
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)?
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.
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.
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.
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?
@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:
It's a very simple model, I didn't make it very far before getting errors D:
This is the plan definition:
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.
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:
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).
@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?
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(...)).
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?
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
I see, thanks for update
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.
Is there a way to make AI Planner part of new initiatives?
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:
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.
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
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.
@ericbegue added GOAP in his PANDA.BT, I think it's the official version now.
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.
hi,is there any update for 2023.
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.
thx for the update and amazing work.
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.
@TrevorUnity Any news? Really curious what are you guys coocking behind the closed door...
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 ?
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.
THX for reply, will it be dots ready then?
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.
hybrid sounds fine, or a frontend/api layer would also be a great choice, take your time and keep doing these amazing work!
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.
Is the new tool called utility AI that I asked for years?
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.
Would it be possible to get the source code for the AI Planner?
You can have it, just download through Package Manager like this:
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?
No worry, there are enough lightweight AI stuff out there. What did your team get moved to?
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.