AI Planner - v0.1.1-preview Release!

Hello, everyone! Today we are releasing our latest update to the Unity AI Planner, version 0.1.1-preview. Here’s a few of the high-level changes you can expect in this release:

  • Enhanced inspectors for domain editing.
  • Assets for holding domain data.
  • Code generation into separate assemblies.
  • Reduced main thread computation.
  • Reduced managed memory allocations.

You can grab this release via the package manager starting today. The package documentation should be published shortly. Feel free to use this thread for feedback or questions. As a note, we have a few known issues you may run into:

First, due to the package’s heavy reliance on the entity command buffer (from the entities package), you may experience small, repeated allocations on frames when planning occurs. This issue will be fixed in a future release of entities.

Secondly, we are aware that when using the planner package for prolonged planning, Unity can allocate large amounts of native memory. We’re investigating this and will issue a minor fix update in the coming weeks.

Moving forward, we will continue to focus on the authoring workflow, planner performance, and scene configuration tools. Furthermore, we’ll be considering extensions to our trait language to help model an even wider range of planning problems. We’ll be previewing some of these features in the coming months, so be sure to check back here!

Thanks, everyone, for your helpful feedback! We look forward to seeing the many creative ways you use the package!

Demo Project - Otto: GitHub - Unity-Technologies/otto: Otto sample project for the AI Planner

11 Likes

exciting news! thanks, taking a look now.

Thanks for good work, waiting for you update.

Not working currently on 2019.3.0b1, throws a bunch of

MissingMethodException: void UnityEngine.UnityAPICompatibilityVersionAttribute..ctor(string,string[])

Downgraded and it seems to work now.

Package documentation are now available.

3 Likes

Otto Does not work with 2019.2.3f1

Assets\AI.Planner\Workaholic-Custom\CustomNavigateEffects.cs(3,18): error CS0234: The type or namespace name ‘Domains’ does not exist in the namespace ‘AI.Planner’ (are you missing an assembly reference?)

Do you have an Assets\AI.Planner\AI.Domains.Dll in your project?

Assets\AI.Planner\Workaholic-Custom\CustomNavigateEffects.cs(3,18): error CS0234: The type or namespace name ‘Domains’ does not exist in the namespace ‘AI.Planner’ (are you missing an assembly reference?)
2019.2.2~2.3 Same error

Yes the DLL is in there, it is what is currently in Otto

https://drive.google.com/open?id=12a_T8w_rPdyttXwxcbKB4YRTNQKLTyVJ

Assets\AI.Planner\Workaholic-Custom\CustomWorkEffects.cs(3,18): error CS0234: The type or namespace name ‘Domains’ does not exist in the namespace ‘AI.Planner’ (are you missing an assembly reference?)

Assets\AI.Planner\Workaholic-Custom\CustomWorkEffects.cs(8,85): error CS0246: The type or namespace name ‘StateData’ could not be found (are you missing a using directive or an assembly reference?)

Failed to load ‘C:/Users/vinci/Desktop/otto-master/Assets/Models/Otto/Animation/Item_GrabPocket.anim’ because it was serialized with a newer version of Unity. (Has a higher SerializedFile version)

This last one is weird because the Git hub says Otto was updated to 2019.2.2f1 but I am opening with 2019.2.3f1

Some how

From this screenshot it looks like the DLLs aren’t importing correctly because it shouldn’t show it as a Native DLL (it’s managed). What is the file size of the DLL? It should be around 26KB.

Well I got it working, I forgot that if you download a zip from GIT it will strip big files.

Otto must be download via command line or via something like source tree.

Plus I had to rebuild the library. But Otto is working! Even 2 at the same time!

I’ve started a thread within the GitHub community to encourage the ability to disable downloading of .zip files for owners of repositories, but haven’t heard back from anyone at GitHub yet. Unfortunately, this causes many issues. In the future, I think we will include samples with the package. Otto is a bit too large to be a sample, which is why we didn’t include it.

2 Likes

How did you rebuild the library? I have cloned the project from the command line and have confirmed my Domains file is present and is 26kb, but I still get:

Assets\AI.Planner\Workaholic-Custom\CustomNavigateEffects.cs(3,18): error CS0234: The type or namespace name ‘Domains’ does not exist in the namespace ‘AI.Planner’ (are you missing an assembly reference?)

Close the project, go to the root folder, where the assets, project settings and library folders are. . . . delete the library folder. Re open the project

Ok next problem. . . when I upgrade a project that had the older planner version in it I was not able to create all the scriptable assets, so I removed all the old stuff.

It started complaining

Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
Copyright (C) Microsoft Corporation. All rights reserved.

error CS2011: Error opening response file ‘C:\ASC\DragonsLore\game\Assets/AI.Planner/csc.rsp’

It also did not generate a new AI.Planner folder

In a fresh project I do see the AI section in the menu and how it generates the assemblies ( if a folder is already corrected)

But it does seem like this missing response file has broken my old project =(

Update: I reverted that file and it allowed the package to complete installation and create all the assets. BUT I still have to have that file, does anyone know where it is being set?

Liking the new interface.

I noticed in the documents we need a new class

public class YourAgentClass : BaseAgent<YourAgentClass, DomainObject, StateEntityKey, StateData, StateDataContext, ActionScheduler, Heuristic, TerminationEvaluator, StateManager, ActionKey>
{
}

However ActionScheduler is tied to the namespace AI.Planner.Actions.WorkaholicAgent, so in fresh projects without Otto the document example doesn’t compile

Update

Ok so generating assemblies after the domain is set up will create a namespace to an agent’s actions which can be used in your BaseAgent class.

I highly recommend everyone recreate Otto in their project, it is very informative.

We got rid of the csc.rsp files, since the assemblies are now compiled outside of the project. You should just be able to remove csc.rsp. However, you might also need to check if you have any _DOMAIN_GENERATED or _ACTIONS_GENERATED, etc. in your build settings defines. Remove those.

That definitely helped. I think some other assets got lost somewhere as I have a number of "Missing Prefab"s in the scene, and everything is black except for the UI (bars, etc) and Otto, who does not have any textures. However when I hit play, he animates, and the AI Planner does run. I recall what the scene looked like previously so I pretty much get the gist of what is happening, but I’m not sure if anyone else ran into this.

In any case, I can see the AI Planner planning and guiding Otto’s actions, which is cool. Also I agree, the new interface is improved. Looking forward to people posting their processes on YouTube.

Seems like the repo did not pull all the large files properly. If you do a git status what does it show? Have you tried doing a git lfs fetch?

Well I have been rebuilding Otto in another project, it seems I must have missed something When I run I get

My Otto object first throws this.
ArgumentException: Object AI.Planner.Domains.DomainObject does not exist within the state data Domain Object: (<< 2 >>)

Then it spams this

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.AI.Planner.DomainLanguage.TraitBased.BaseAgent`10[TAgent,TObject,TStateKey,TStateData,TStateDataContext,TActionScheduler,THeuristic,TTerminationEvaluator,TStateManager,TActionKey].Update () (at Library/PackageCache/com.unity.ai.planner@0.1.1-preview/Runtime/Agent/BaseAgent.cs:273)
Workaholic.Otto.Update () (at Assets/Scripts/AIPlanner/Otto/Otto.cs:32)

Which fails in BaseAgent:Update()
{

m_Controller.Update();

m_JobHandle = m_PlannerScheduler.Schedule(default);
// FIXME: Ideally, we don’t complete immediately, but without doing this the entity debugger throws errors
m_JobHandle.Complete();

}

m_Controller is not defined.

Not sure where I went wrong.

If the controller is null, it likely failed during the initial state creation (PlanningDomainData.GetInitialState). How are you setting up your initial state info in the new project?