Getting only Axis on where to move.

Without knowing the details of what you changed or the navigation system API I'm not able to say why it's not calling SetDestination.

To get started I recommend that you do not use the Movement Pack and just get a basic task working from scratch. This will better show you the flow of creating a new task, and you can then be sure that you can get something working. Just start with having the vehicle move to a static point in the scene and expand from there.

After you have a handle on that you can implement the abstract Movement class within the Movement pack similar to what the NavMeshMovement class does and then create your own Seek, Wander, etc classes. You should not just modify the included NavMesh Seek task as that is not setup to use your own navigation system.
 
Without knowing the details of what you changed or the navigation system API I'm not able to say why it's not calling SetDestination.

To get started I recommend that you do not use the Movement Pack and just get a basic task working from scratch. This will better show you the flow of creating a new task, and you can then be sure that you can get something working. Just start with having the vehicle move to a static point in the scene and expand from there.

After you have a handle on that you can implement the abstract Movement class within the Movement pack similar to what the NavMeshMovement class does and then create your own Seek, Wander, etc classes. You should not just modify the included NavMesh Seek task as that is not setup to use your own navigation system.
I don't know how to do logic for the rank to hide chase etc. So all I need behaviour designer for is to tee it where to go and what to look at. Simple.
 
The Movement Pack isn't integrated with the navigation system that you are using. If you tell me what system you are using I can add it to my integration list but I'm not sure when I will be able to get to it. In order to integrate a new navigation system with the Movement Pack you will need to code using the strategy of my post above.
 
The Movement Pack isn't integrated with the navigation system that you are using. If you tell me what system you are using I can add it to my integration list but I'm not sure when I will be able to get to it. In order to integrate a new navigation system with the Movement Pack you will need to code using the strategy of my post above.
I'm using unity nav mesh. Destination is a Vector3, and I make my vehicle navigate the nav mesh by changing the user inputs for turnInput and AccelInput, both ranging from - 1 to 1, as if those were input axis. That's it.
 
What do you mean by Unity NavMesh? The built in NavMeshAgent? The NavMesh Component package?

The Movement Pack works with the NavMeshAgent, but not the NavMesh Component package.

Destination is a Vector3, and I make my vehicle navigate the nav mesh by changing the user inputs for turnInput and AccelInput, both ranging from - 1 to 1, as if those were input axis. That's it.
For this you will need to take an approach similar to what I did for the Ultimate Character Controller integration. You'll need to create a script that moves the agent based on the destination and translates that to the agent controller that you are using. This is completely independent of the behavior tree though. For the NavMesh integration with our character controller it doesn't even know that you are running a behavior tree and this is how you should do it as well. This is a good article:


This will take some scripting though to work with the agent controller that you are using.
 
What do you mean by Unity NavMesh? The built in NavMeshAgent? The NavMesh Component package?

The Movement Pack works with the NavMeshAgent, but not the NavMesh Component package.


For this you will need to take an approach similar to what I did for the Ultimate Character Controller integration. You'll need to create a script that moves the agent based on the destination and translates that to the agent controller that you are using. This is completely independent of the behavior tree though. For the NavMesh integration with our character controller it doesn't even know that you are running a behavior tree and this is how you should do it as well. This is a good article:


This will take some scripting though to work with the agent controller that you are using.
No. By nav mesh I mean nav mesh. The blue polygons, not NavMeshAgent.
On nav mesh I calculate path to destination. My tank is also controlled same way as player does. Ai calculates the input axis and passes them to tank.
 
If you are calculating the path manually using the NavMesh you will need to translate the pathfinding result to your tank controller. This is outside of the behavior tree and depends on your tank implementation.
 
If you are calculating the path manually using the NavMesh you will need to translate the pathfinding result to your tank controller. This is outside of the behavior tree and depends on your tank implementation.
As I said. My tank can already move etc. My tank just needs to know where to move or where to turn. It needs the destination. That is done by behaviour tree.
 
Since you aren't using the NavMeshAgent you will need to create your own task that determines the destination. The Movement Pack tasks require a NavMeshAgent if you are using Unity's navmesh.
 
Since you aren't using the NavMeshAgent you will need to create your own task that determines the destination. The Movement Pack tasks require a NavMeshAgent if you are using Unity's navmesh.
But I changed the movement scripts setdestination method, to Change my ai destination. It is never called.
 
Just changing SetDestination isn't enough - the Movement Pack scripts require a NavMeshAgent so if you don't have a NavMeshAgent then it's going to run into a lot of problems. You need to create your own task for this situation.
 
Just changing SetDestination isn't enough - the Movement Pack scripts require a NavMeshAgent so if you don't have a NavMeshAgent then it's going to run into a lot of problems. You need to create your own task for this situation.
I have no idea how to create the tasks. And if I have to write the whole ai decision making myself, then is there even any use for the behaviour tree or it would be just a waste of time, if I have to recreate everything either way.
 
Writing a task which sets the destination isn't the decision making part - it's the functionality part. The power comes in from the behavior tree flow and the action tasks (such as calling set destination) is just one piece of that.

If you don't know how to create your own tasks there are a set of reflection tasks that you may be able to use. Reflection is slow though so I do not recommend using it. Beyond that you can use the Playmaker or Bolt integration to lean more on the visual scripting side. Unfortunately there isn't any other way with the custom solution that you are using.
 
Writing a task which sets the destination isn't the decision making part - it's the functionality part. The power comes in from the behavior tree flow and the action tasks (such as calling set destination) is just one piece of that.

If you don't know how to create your own tasks there are a set of reflection tasks that you may be able to use. Reflection is slow though so I do not recommend using it. Beyond that you can use the Playmaker or Bolt integration to lean more on the visual scripting side. Unfortunately there isn't any other way with the custom solution that you are using.
I have no idea what's playmaker or bolt. I just use visual studio. I've heard of raider getting some new stuff soon but that's all.
When opening the Movement script from wander task, the setdestination function is never called. I opened behaviour, checked if it's ever called there, nop. Isn't either. So I got no clue from where you call setdestination.

I'd still have to write my own intercept tasks, shoot tasks, conditions for changing tasks etc, so if I can't get destination from behaviour tree, where it gets useful?
 
If you prefer to use Visual Studio then creating new tasks are perfect and no visual scripting is needed. While Behavior Designer includes hundreds of tasks a lot of those tasks are just layers on top of the Unity API. The real power comes from creating your own tasks or using a visual scripting integration to help with that. Since you aren't using visual scripting you will need to create your own tasks.

Behavior Designer is actually the most useful when you create your own tasks. You allow Behavior Designer to determine the flow that these tasks are executed in, and that's where the decision making part is. The decision making part comes from the when, such as when to set the destination.

Since you have modified the wander task I am not sure why SetDestination isn't being called. If you create a fresh project and just import Behavior Designer and the Movement Pack you'll see that SetDestination is called within the demo scene.
 
I
If you prefer to use Visual Studio then creating new tasks are perfect and no visual scripting is needed. While Behavior Designer includes hundreds of tasks a lot of those tasks are just layers on top of the Unity API. The real power comes from creating your own tasks or using a visual scripting integration to help with that. Since you aren't using visual scripting you will need to create your own tasks.

Behavior Designer is actually the most useful when you create your own tasks. You allow Behavior Designer to determine the flow that these tasks are executed in, and that's where the decision making part is. The decision making part comes from the when, such as when to set the destination.

Since you have modified the wander task I am not sure why SetDestination isn't being called. If you create a fresh project and just import Behavior Designer and the Movement Pack you'll see that SetDestination is called within the demo scene.
I can upload it as a zip later today.
 
If the navigation system that you are using is on the Asset Store I can add it to my integration list but due to my workload I'm not able to debug custom scripts. If you're interested I have a consulting rate where I can work on custom tasks. For that if you email support@opsive.com I can give you the details.
 
If the navigation system that you are using is on the Asset Store I can add it to my integration list but due to my workload I'm not able to debug custom scripts. If you're interested I have a consulting rate where I can work on custom tasks. For that if you email support@opsive.com I can give you the details.
It isn't anything fancy.
I use navmesh raycast with infinite range at destination vector3, ( automatically finds the closest point to that destination on navmesh.
Then checks if it can reach it, if it isn't reachable, gets a different destination.
Then puts all the path.corners[] into a waypoint list, then using angles uses axis inputs on the tank.

For a vision it has a cone mesh trigger collider, while tank is in the collider, it gets blasted with raycasts every 10 cm on its bounding box. If it's visible, it gets added to teams known target and personal target list.
If its invisible for over 5 seconds, it is removed from those lists.

Tank aims the gun at target tank, does the same check with cone mesh collider and raycast bombardment, but within a single vertical line, if it hits the tank, it holds down the shoot button. Turret script does the rest.

Kinda basic.
 
With your own navigation system you will need to create your own tasks that use the API for that navigation system. In this case it's creating a new task and not using any of the Movement Pack tasks:


Deciding on a destination will be up to the task that you create.
but like, tactical pack. None of it can be used? Cause so far it seems so, not tasks, not the tactical groups, nothing of it seems usable. its a weird implementation of heavily relying on some tactical Agent struct thing which... I've ben trying to get rid of for several days now, really annoying. wasn't there more direct approach so tactical pack can be used for anything other than the demo?

Like, i can provide it with the list of visible targets, i just need it to tell me where to look, destination where to go. Quite basic.. i can do the rest, but no, its very hardcoded in to use its own system, arguably much worse one (considers targets to be infinitely small vector3 points) etc.
And i literally mean, i need it to do the bare minimum. Tell me where to look, destination where to go. Everything else just fucks up.... everything else and makes the whole pack useless.
 
Last edited:
Top