CharacterDemo with DetourCrowd support

Show what you made with Bullet Physics SDK: Games, Demos, Integrations with a graphics engine, modeler or any other application
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

CharacterDemo with DetourCrowd support

Post by Flix »

I've modified the "official" CharacterDemo to include a very basic DetourCrowd support.
Video:
Image
CharacterDetourCrowdDemo.zip
P.S. I've used both the Bullet Character Controller and Detour Crowd for the first time, so please don't expect too much :?.
You do not have the required permissions to view the files attached to this post.
c6burns
Posts: 149
Joined: Fri May 24, 2013 6:08 am

Re: CharacterDemo with DetourCrowd support

Post by c6burns »

Thanks a bunch for sharing!
Seba1
Posts: 5
Joined: Sat Nov 05, 2011 10:20 am

Re: CharacterDemo with DetourCrowd support

Post by Seba1 »

Hallo

Video is cool. I would like to compile the code at home but I have a little problem ( I think this is little problem ). I use Bullet physics 2.82 and Detours Library ( last version) and trying compile your Crowd demo. Run and...

Image


Can anybody help me?
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: CharacterDemo with DetourCrowd support

Post by Flix »

Seba1 wrote: I use Bullet physics 2.82 and Detours Library ( last version) and trying compile your Crowd demo [...]
The Detour and DetourCrowd libraries are not necessary, because their source code is included in the Demo. Have you tried using it, instead of the last version of the Detour library ? Does the demo work with it ?

The strange thing about it is that a new version of the Recast/Detour library could make the navigation mesh (.bin file) unusable, but from your console it seems that the problem is related to the fact that the btBvhTriangleMeshShape of the .obj file is being added twice (see: btCollisionWorld::addCollisionObject(...)). Now I've no time to double check the code I posted right now, but I think I used something like:

Code: Select all

btRigidBody* groundBody = localCreateRigidBody(0,tr,groundShape);
that, in turn, includes the addRigidBody call.

So: have you modified the code so that you add the groundShape to the world twice ?

BTW: I usually compile and test my code on Ubuntu Linux 64 bit only (without SSE support), but this shouldn't make any difference here, I suppose.
Seba1
Posts: 5
Joined: Sat Nov 05, 2011 10:20 am

Re: CharacterDemo with DetourCrowd support

Post by Seba1 »

Hallo

I comment this line yesterday

//m_dynamicsWorld->addRigidBody(groundBody);

becouse bullet class - DemoApplication::localCreateRigidBody(..)

Adding this body

Now load objects OK but:

New error in
btVector3.h (bullet physics)
Line 300 btAssert(!fuzzyZero());

and Crash.

I try to find problem now (I'll try an older version of bullet)


p.s You use bullet 2.82 (r_2704)?
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: CharacterDemo with DetourCrowd support

Post by Flix »

Seba1 wrote://m_dynamicsWorld->addRigidBody(groundBody);
Yes, that line shouldn't exist in the source code in the first place, and I'm surprised I forgot to remove it! :oops:

Please note that if you had compiled the Demo in release mode it would have run without any assert: so thanks for having spotted this :D ! (I usually compile in Debug mode linking to the release version of the Bullet library (otherwise it runs too slow), and that's the reason why I did not get the assert).

For the other error, it should be related to a btVector3::normalize() call inside CharacterDemo.cpp.
You can try commenting out the one used for updating the orientation of the CPU characters (this can be done very easily by commenting out the line: #define UPDATE_ORIENTATION_TOO) and see if it works.

However the demo should work in release mode without problems with the unmodified code I posted (try it if you can't fix all the asserts).

P.S. I'm using a Bullet SVN version cloned some time after the 2.82 release, but that should not change things as far as I can understand.
Seba1
Posts: 5
Joined: Sat Nov 05, 2011 10:20 am

Re: CharacterDemo with DetourCrowd support

Post by Seba1 »

I'm using bullet version 2.81 and is ok (works demo) so that there is no assert. The problem is only with the assert to the latest version 2.82 (divide by zero).

You are planning to make a new code of your demos (I've seen your videos - interesting).

Are you planning an RPG game?
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: CharacterDemo with DetourCrowd support

Post by Flix »

Seba1 wrote:I'm using bullet version 2.81 and is ok (works demo) so that there is no assert. The problem is only with the assert to the latest version 2.82 (divide by zero).
This is very strange, 'cause I'm pretty sure I'm using version 2.82 and for some odd reasons I can't have any btAssert displayed when a add an object twice to the world, even if I compile everything (Bullet included) in Debug Mode. I guess this is something that happens only on Linux, or maybe there's still something I'm missing :cry:.
Seba1 wrote:You are planning to make a new code of your demos (I've seen your videos - interesting).
Nope, I've already posted most of the code in this forum, and I think this is enough (the videos use a slightly modified engine, and its code is too cucumbersome to be posted here: I tend to post only something strictly related to the basic Bullet library usage, so that it can be more useful to others; moreover I cannot share all of the models I've used in the videos, and their physic coding has been closely tailored around them).
Seba1 wrote:Are you planning an RPG game?
Nope.
Seba1
Posts: 5
Joined: Sat Nov 05, 2011 10:20 am

Re: CharacterDemo with DetourCrowd support

Post by Seba1 »

Thanks for answer

I care only for information on how to make the effect of doors


http://www.youtube.com/watch?v=9yGKibaGJeg

(you use sensors?). How to create in recast ?



p.s - (3d game with vehicles too extensive)
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: CharacterDemo with DetourCrowd support

Post by Flix »

Seba1 wrote:I care only for information on how to make the effect of doors
http://www.youtube.com/watch?v=9yGKibaGJeg
(you use sensors?). How to create in recast ?
There is absolutely nothing on the Bullet side (the door in the video is just a kinematic object that can be in 2 different places). So the rest is about Recast, and you can see the related post here: https://groups.google.com/forum/#!topic ... bi0aCEcPkI.