CrowdAgent must set the movement through RigidBody

Discussion of proposed new features.

CrowdAgent must set the movement through RigidBody

PostPosted by Commandor » 17 Nov 2016, 15:54

CrowdAgent must set the movement through RigidBody. Because for the gameplay you need to game object contained both CrowdAgent and RigidBody and CollisionShape.
Without this it is impossible to build a logic game based on physics and NavigationMesh.
:!:
User avatar
Commandor
New user
New user
 
Posts: 5
Joined: 11 Nov 2016, 09:15

Re: CrowdAgent must set the movement through RigidBody

PostPosted by cadaver » 17 Nov 2016, 19:14

I don't necessarily think the navigation components should try to do this on their own. It's non-obvious how they should do it. Applying forces? Applying velocity? Depending on the properties of the objects and the "feel" you are after, this might be done differently.

For kinematic rigidbodies, the node position update that the CrowdAgent does by itself should be already good to go.

You could try turning off auto position update from CrowdAgent (see CrowdAgent::SetUpdateNodePosition) and handle updates just in the manner you want by subscribing to E_CROWD_AGENT_REPOSITION event from the scene node owning the CrowdAgent.

However you'll have to note that there are two completely separate simulations (crowd and physics) and they don't feed information to each other, so they may not operate very smoothly. From what I remember Unity had similar problems with simultaneous navigation and physics.

Also you could consider just doing pathfinding queries and having your own steering system that acts according to the results.
User avatar
cadaver
Urho3D author
Urho3D author
 
Posts: 1802
Joined: 16 Jan 2014, 14:52
Location: Finland

Re: CrowdAgent must set the movement through RigidBody

PostPosted by Commandor » 17 Nov 2016, 19:27

cadaver wrote:
For kinematic rigidbodies, the node position update that the CrowdAgent does by itself should be already good to go.




Thank you, I'm just trying to "Is Kinematic". This works, but missing a collision with objects whose mass is equal to 0.
User avatar
Commandor
New user
New user
 
Posts: 5
Joined: 11 Nov 2016, 09:15

Re: CrowdAgent must set the movement through RigidBody

PostPosted by Nerrik » 17 Nov 2016, 23:45

have you tryed
body->SetTrigger(true);
and
agent->SetUpdateNodePosition(false);
?
There are some more calls to handle that
~with agent->GetTargetVelocity you also can make a ~body->ApplyImpulse and so on if you need 100% bullet.
2 extern libarys are as good as some coder can merged. :P
User avatar
Nerrik
New user
New user
 
Posts: 13
Joined: 03 Apr 2015, 16:17

Re: CrowdAgent must set the movement through RigidBody

PostPosted by Commandor » 18 Nov 2016, 06:07

body->SetTrigger(true);

It will not work, because an object with the mass 0 is a wall, for which the object should not go.

2 extern libarys are as good as some coder can merged. :P

Unreal Engine not have this problem, bun they use both librarys. ;)


I was faced with another problem: if I need a game bonus that can only collision with the player and not bots or collision with a tree on which runs into the bot, and it falls, they are also involved in the construction of the grid. Probably it is necessary to add to the Node or RigidBody or CollisionShape option, which excludes construction of the navigation mesh for the game object. Note: for bonuses I set body->SetTrigger(true); ;)
User avatar
Commandor
New user
New user
 
Posts: 5
Joined: 11 Nov 2016, 09:15

Re: CrowdAgent must set the movement through RigidBody

PostPosted by Eugene » 18 Nov 2016, 14:41

Unreal Engine not have this problem, bun they use both librarys.

Did you investigated how do they achieve this and what limitations do they have?
User avatar
Eugene
Some active
Some active
 
Posts: 62
Joined: 06 Jun 2016, 06:30
Location: Russia

Re: CrowdAgent must set the movement through RigidBody

PostPosted by Commandor » 18 Nov 2016, 15:55

No, I did not examine their code for details. For most tasks UE4 is very big.
It would be very convenient if some useful features from UE4 would be implemented in Urho3D. :)

By the way, I noticed that the NavArea in Urho3D works differently, not like in UE4. In UE4 I can set the height of the volume in which to build a navigation mesh. In Urho3D it does not work.
User avatar
Commandor
New user
New user
 
Posts: 5
Joined: 11 Nov 2016, 09:15

Re: CrowdAgent must set the movement through RigidBody

PostPosted by Nerrik » 18 Nov 2016, 19:02

Without some source its hard to help ;)
User avatar
Nerrik
New user
New user
 
Posts: 13
Joined: 03 Apr 2015, 16:17


Return to Feature Request

Who is online

Users browsing this forum: No registered users and 0 guests