Good job but, performance killer.

Has anyone tried doing all of these suggested performance improvements and running 5-10 AI simultaneously for an Android app, specifically for Oculus Quest? My planned AI behavior tree is fairly simple, just Seek a destination, and play walk/death animations.
 
I wanted to give a quick update on my old post.

As I have progressed in my development I have switch over to a new AI Agent and locomotion system and I wanted to include this as another option for those who are looking for a solution for using the Character Controller with their own AI agents.

First I started from scratch and created my own AI implementation and used the Ultimate character controller's API to connect my AI to the Character Controller. See link for a guide on how to do this: https://opsive.com/support/documentation/ultimate-character-controller/artificial-intelligence/
(Note: If you look in the documentation the controller is structured so it can work with your AI implementations. Also I believe that making your own AI and then integrating it with both Behavoir Designer and the Character Controller is the intended use case from the developers. Please correct me if I'm wrong).

Next I replaced my old animation system with Motion Matching which is an alternative animation system to mecanim that enables fluid and responsive animation without the need of a state machine. If you haven't looked into Motion matching I'd recommend you check it out. Its super cool and best of all it is implemented with Unity's new job system and burst compiler so its supper fast and looks amazing!

Currently there are two options: Kinematica which is a free experimental package from unity and Motion Matching for Unity which is a paid plugin. I ended up using Motion Matching for Unity because its production ready (this may change when Kinematica is fully released).

Motion Matching for Unity: https://assetstore.unity.com/packages/tools/animation/motion-matching-for-unity-145624
Kinematica: https://docs.unity3d.com/Manual/com.unity.kinematica.html

Here is a video that shows my current results from using my own AI agent integrated with Behavior Designer / Character Controller and Motion matching. I have over 100 simply implemented AI units with an average frame rate of 50 to 60 ( The video shows 40 to 50 fps but that's due to my screen recording software :()

I feel that this approach is probably the best option if you are looking for both quality and large quantity of AI agents.
 
Last edited:
Has anyone tried doing all of these suggested performance improvements and running 5-10 AI simultaneously for an Android app, specifically for Oculus Quest? My planned AI behavior tree is fairly simple, just Seek a destination, and play walk/death animations.
Yes! And no! Let me explain...

so I made an zombie horde style game with around 50 zombie AI units using my own AI implementation that I integrated with behavior tree and UCC. This link will help show you how to do this. https://opsive.com/support/documentation/ultimate-character-controller/artificial-intelligence/

With that said I would not recommend using the AI setup in the character controller integration package. From my experience I found that Character Controller worked well for the player but with the AI it’s best to make your own AI implementation and intergrate it with the character controller. The oculus quest is Not very powerful and you want to optimize things as much as possible especially if you’re trying to hit that 70 FPS mark.
 
Last edited:
I wanted to give a quick update on my old post.

As I have progressed in my development I have switch over to a new AI Agent and locomotion system and I wanted to include this as another option for those who are looking for a solution for using the Character Controller with their own AI agents.

First I started from scratch and created my own AI implementation and used the Ultimate character controller's API to connect my AI to the Character Controller. See link for a guide on how to do this: https://opsive.com/support/documentation/ultimate-character-controller/artificial-intelligence/
(Note: If you look in the documentation the controller is structured so it can work with your AI implementations. Also I believe that making your own AI and then integrating it with both Behavoir Designer and the Character Controller is the intended use case from the developers. Please correct me if I'm wrong).

Next I replaced my old animation system with Motion Matching which is an alternative animation system to mecanim that enables fluid and responsive animation without the need of a state machine. If you haven't looked into Motion matching I'd recommend you check it out. Its super cool and best of all it is implemented with Unity's new job system and burst compiler so its supper fast and looks amazing!

Currently there are two options: Kinematica which is a free experimental package from unity and Motion Matching for Unity which is a paid plugin. I ended up using Motion Matching for Unity because its production ready (this may change when Kinematica is fully released).

Motion Matching for Unity: https://assetstore.unity.com/packages/tools/animation/motion-matching-for-unity-145624
Kinematica: https://docs.unity3d.com/Manual/com.unity.kinematica.html

Here is a video that shows my current results from using my own AI agent integrated with Behavior Designer / Character Controller and Motion matching. I have over 100 simply implemented AI units with an average frame rate of 50 to 60 ( The video shows 40 to 50 fps but that's due to my screen recording software :()

I feel that this approach is probably the best option if you are looking for both quality and large quantity of AI agents.
Cool. Do you still use GPU Instancer and GPU Instancer - Crowd Animations for the one in YouTube?
 
Next I replaced my old animation system with Motion Matching which is an alternative animation system to mecanim that enables fluid and responsive animation without the need of a state machine.

I am considering purchasing MxM myself and was wondering if you needed to subclass UltimateCharacterLocomotion to get it working with Kenneth Claassen's package. Can you give a bit more detail into how you integrated the package with UCC? I am worried that abilities that change Slot0ItemStateIndex (and other animator controller parameters) on UltimateCharacterLocomotion will have a hard time getting into MxM.

Thanks
 
I am considering purchasing MxM myself and was wondering if you needed to subclass UltimateCharacterLocomotion to get it working with Kenneth Claassen's package. Can you give a bit more detail into how you integrated the package with UCC? I am worried that abilities that change Slot0ItemStateIndex (and other animator controller parameters) on UltimateCharacterLocomotion will have a hard time getting into MxM.

Thanks

If you plan on using MxM for your AI agents I would not recommend adding the UltimateCharacterLocomotion component to these AI agents. The UltimateCharacterLocomotion component uses Unity's animation system Mecanim while MxM is its own separate animation system that completely replaces mechanim. So using both MxM and UltimateCharacterLocomotion on the same AI agent will be somewhat messy, plus the whole idea of using MxM is to move away from Unity's animation system which is the source of our performance problems.

With that said MxM can plug into any playable graph so if you want to combine it with UltimateCharacterLocomotion or combine it with mechanim you can. Requires a little knowhow of the playable system and will probably require some rework of the UltimateCharacterLocomotion script but its doable.

In my project the AI agent use only MxM and instead of using abilities from UCC I use MxM's event system to handle all of my event based animations like jump, fall, Die, NavmeshAgent Movement, ect.. for more on MxM events you can go here
or https://forum.unity.com/threads/motion-matching-mxm-animation-system-for-unity-released-beta.620713/

I would also suggest joining the MxM discord, there you can talk with the developers of MxM and they can probably answer your question in more detail. Here is an link https://discord.gg/

Hope that helps
 
Cool. Do you still use GPU Instancer and GPU Instancer - Crowd Animations for the one in YouTube?

The example I showed in my YouTube video does not use GPU Instancer or GPU Instancer - Crowd Animations. By just using MxM (Motion Matching for unity) and some simple occlusion culling I was able to get the result I wanted.

For me personally I only optimize when needed and at the moment my current implementation is running just fine but In the future I plan on building more intensive scenes and I may look into using GPU Instancer to help optimize my game. If I do I will make sure to post my results.

Also I should note that GPU Instancer - Crowd Animations is not compatible with MxM at the moment. It is still a good option if your using Mecanim but I’m not using mecanim so I’m no longer using it.
 
I wanted to give a quick update on my old post.

As I have progressed in my development I have switch over to a new AI Agent and locomotion system and I wanted to include this as another option for those who are looking for a solution for using the Character Controller with their own AI agents.

First I started from scratch and created my own AI implementation and used the Ultimate character controller's API to connect my AI to the Character Controller. See link for a guide on how to do this: https://opsive.com/support/documentation/ultimate-character-controller/artificial-intelligence/
(Note: If you look in the documentation the controller is structured so it can work with your AI implementations. Also I believe that making your own AI and then integrating it with both Behavoir Designer and the Character Controller is the intended use case from the developers. Please correct me if I'm wrong).

Next I replaced my old animation system with Motion Matching which is an alternative animation system to mecanim that enables fluid and responsive animation without the need of a state machine. If you haven't looked into Motion matching I'd recommend you check it out. Its super cool and best of all it is implemented with Unity's new job system and burst compiler so its supper fast and looks amazing!

Currently there are two options: Kinematica which is a free experimental package from unity and Motion Matching for Unity which is a paid plugin. I ended up using Motion Matching for Unity because its production ready (this may change when Kinematica is fully released).

Motion Matching for Unity: https://assetstore.unity.com/packages/tools/animation/motion-matching-for-unity-145624
Kinematica: https://docs.unity3d.com/Manual/com.unity.kinematica.html

Here is a video that shows my current results from using my own AI agent integrated with Behavior Designer / Character Controller and Motion matching. I have over 100 simply implemented AI units with an average frame rate of 50 to 60 ( The video shows 40 to 50 fps but that's due to my screen recording software :()

I feel that this approach is probably the best option if you are looking for both quality and large quantity of AI agents.
Thank you for sharing the great experience.
So you wrote your own CharacterLocomotion and used it instead of the one that comes with opsive?

Also when you used the gpu instancer crowd animation, did you do the same thing?

Can you perhaps sell those as extension integrations on the asset store?
 
The example I showed in my YouTube video does not use GPU Instancer or GPU Instancer - Crowd Animations. By just using MxM (Motion Matching for unity) and some simple occlusion culling I was able to get the result I wanted.

For me personally I only optimize when needed and at the moment my current implementation is running just fine but In the future I plan on building more intensive scenes and I may look into using GPU Instancer to help optimize my game. If I do I will make sure to post my results.

Also I should note that GPU Instancer - Crowd Animations is not compatible with MxM at the moment. It is still a good option if your using Mecanim but I’m not using mecanim so I’m no longer using it.
@Ace Thanks for sharing your approach. Would you mind describing your final complete solution in a little more detail. I am not sure what components from UCC, if any, you were still using on your NPC's?
'
 
The example I showed in my YouTube video does not use GPU Instancer or GPU Instancer - Crowd Animations. By just using MxM (Motion Matching for unity) and some simple occlusion culling I was able to get the result I wanted.

For me personally I only optimize when needed and at the moment my current implementation is running just fine but In the future I plan on building more intensive scenes and I may look into using GPU Instancer to help optimize my game. If I do I will make sure to post my results.

Also I should note that GPU Instancer - Crowd Animations is not compatible with MxM at the moment. It is still a good option if your using Mecanim but I’m not using mecanim so I’m no longer using it.
I would also be interested knowing how you approached this :)
 
Top