Release mode screws up character movement (added video)

yuriythebest

19-08-2008 22:56:33

got a strange problem- I managed to get my app to compile in release mode and everything is the same except for the higher fps count and also the characters movement is somehow 'damaged'. In the remote debugger everything looks ok but the character can't move almost anywhere without instantly getting stuck even on almost flat surfaces.

mCharacter= mPhysScene->createCharacter("character",Vector3(0,130,0),"type: capsule, dimensions:10 50 10 , mass:0 "); //characters don't care about mass

mCharacter->createNode();
//mCharacter->mSlopeLimit(
charNode= mCharacter->getNode()->createChildSceneNode();
charNode->attachObject(charEntity);
charEntity->setMaterialName("Examples/BumpMapping/MultiLightIvan");
charNode->translate(Vector3(0,-22,0));
charNode->yaw(Degree(90));




myCharacterMovement *mCharMove=new myCharacterMovement();
mCharacter->setMovementVectorController(mCharMove);
ivanStartPos= mCharacter->getGlobalPosition();



class myCharacterMovement: public NxOgre::CharacterMovementVectorController{
public:
void move(NxVec3 &out, NxVec3 &moveVector, NxQuat &direction, NxVec3 &g, float t, NxOgre::Character*){
NxReal mySpeed=150.0;
out=((direction.rot(moveVector)*mySpeed)+g)*t;
}

};


I also tried adding slopelimit at different values but that didn't help either.

xadh00m

20-08-2008 08:27:21

Maybe its related to this:

http://www.ogre3d.org/phpBB2addons/view ... 7&start=45

If you use Bleeding I´m not sure if the CharacterControl is working yet.

yuriythebest

20-08-2008 21:27:39

not sure how to find out my nxogre versoion buit it's old. in changes txt the final entry is for 0.9-38

anyhow here is the video- note that wherever you see the character go into a running animation I am pressing a left/right key. When a character is in running animation but not changing position it's stuck. jumping gets him unstuck but I can't move much without getting stuck.

http://www.youtube.com/watch?v=4wXzLfW9BLo

radsun

21-08-2008 08:41:24

It's getting stuck in release when you stopped or all the time when you collide with the ground?

You have v0.9, there is characterController.
In 1.0 it isn't working yet

yuriythebest

21-08-2008 09:34:33

It's getting stuck in release when you stopped or all the time when you collide with the ground?

You have v0.9, there is characterController.
In 1.0 it isn't working yet


gets stuck all the time. I did get the character to run when I created a perfectly flat surface but even then the motion was jittery. Seems even an almost invisible slope causes him to get stuck. In debug mode everything works perfectly. Btw to make the release mode all you need to do is just recompile nXogre for release and in the project properties remove the "_d" thingies from the names and copy the release dll's to the release bin? Maybe I missed something?

So what should I use instead of characterController?

betajaen

21-08-2008 09:46:47

Btw to make the release mode all you need to do is just recompile nXogre for release and in the project properties remove the "_d" thingies from the names and copy the release dll's to the release bin? Maybe I missed something?

Eh? It's never been like that for release.

Also; you should check out the rather large Character Controller post that is a few posts down from this one; there was a bug found in the code that may be related to yours. The last but one page - I think.

radsun

21-08-2008 09:48:41

In new version of nxphysic there is something called auto-stepping
Without auto-stepping, it is easy for a box-controlled character to get stuck against slight elevations of the ground mesh. In the following picture, the small step would stop the character completely. It feels unnatural because in the real world you would just cross this small obstacle without thinking about it.

This is what auto-stepping enables us to do. Without any intervention from the player, the box correctly steps above the minor obstacle as shown below:

Meaby it's in ver0.9 :wink:

yuriythebest

21-08-2008 10:45:54

betajaen- what am I doing wrong what is the correct way?

radsun- how do I access auto-stepping? I did a search on the forums for "auto-stepping" and "auto stepping" but apart from this thread didn't find anything?

radsun

21-08-2008 10:59:45

I downloaded 0.9 and look:
void CharacterParams::parse(Parameters P) {

for (Parameters::iterator p = P.begin(); p != P.end();p++) {
if (Set("dimensions", (*p), mDimensions)) continue;
if (Set("up", (*p), mUpAxis)) continue;
if (Set("slopelimit", (*p), mSlopeLimit)) continue;
if (Set("stepoffset", (*p), mStepOffset)) continue;
if (Set("skinwidth", (*p), mSkinWidth)) continue;
if ((*p).first == "type") {
if ((*p).second.substr(0,1) == "b" || (*p).second.substr(0,1) == "B") {
mType = CT_Box;
}
else {
mType = CT_Capsule;
}
}
}

}

I'm not using 0.9 but i think it's mStepOffset param, you need to change it while creating character.

yuriythebest

21-08-2008 12:03:52

ok I have modified my character creation code like so:

mCharacter= mPhysScene->createCharacter("character",Vector3(0,130,0),"type: Box, dimensions:10 50 10 , mass:740, mStepOffset:1");

I've tried setting all sorts of values to mStepOffset like 0.0, 0.1, 0.5, 1.5, 100, -100 but it didn't do anything. playing around with mSlopeLimit didn't help either. In debug character moves fine.

betajaen

21-08-2008 13:15:33

Did you try fixing that bug which was published in the other thread. If it works in Debug and not in release, it sounds like an un-initialized variable; which sounds like that bug.

yuriythebest

21-08-2008 13:40:18

Did you try fixing that bug which was published in the other thread. If it works in Debug and not in release, it sounds like an un-initialized variable; which sounds like that bug.


I'm confused regarding what the character constructor is. Is it in the nxogre source code files? I tried initializing that variable like so:

Character= mPhysScene->createCharacter("character",Vector3(0,130,0),"type: Box, dimensions:10 50 10 , mass:740, mMove_MinDistance = 0.001");

but that didn't help.

betajaen

21-08-2008 13:48:41

Common, Yuri. Get with the times; the constructor in NxOgreCharacter.cpp

yuriythebest

21-08-2008 14:04:54

ok I opened NxOgreCharacter.cpp, and in Character::Character I added

mMove_MinDistance = 0.001;

then I compiled it in release config, got the usual complaint about cakebox yet was reassured that the libs are built, copied the new NxOgre.dll to the release dir of my app. However the result is still the same.

xadh00m

21-08-2008 14:28:54

Thats very odd...

Can you check the code in cake under similar conditions.
Did you played with the mass value? Much less than 740 for example (just guessing).

yuriythebest

21-08-2008 15:03:01

Thats very odd...

Can you check the code in cake under similar conditions.
Did you played with the mass value? Much less than 740 for example (just guessing).


yup tried setting mass to 0 and 1 but that didn't change anything. I guess the only logical step is to get the latest version from svn in hopes that this problem will go away.

nargil

21-08-2008 17:36:43

AFAIK the latest svn version doesn't have any character system at all.

Sorry - I was wrong :>

yuriythebest

21-08-2008 17:39:26

AFAIK the latest svn version doesn't have any character system at all.

so what version should I download?

nargil

21-08-2008 17:47:38

just try 1.0 http://svn.nxogre.org/branches/1.0/

yuriythebest

21-08-2008 21:12:09

just try 1.0 http://svn.nxogre.org/branches/1.0/

ok I tried compiling that but it says

error C2039: 'thickness' : is not a member of 'NxHeightFieldDesc'

betajaen

21-08-2008 21:45:57

Join us in the 21st century and use PhysX 2.8.1

yuriythebest

21-08-2008 23:28:30

Join us in the 21st century and use PhysX 2.8.1

ok I installed nvidia physX 2.8.1, changed the environment variable to point to:

D:\NVIDIA PhysX SDK\v2.8.1

I don't have to compile physX right?

then I was able to successfully compile nxOgre 1.0 except I got these warnings:

1>NxOgreUserAllocator.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreTriggerCallback.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreTimeController.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreTesting.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreSoftBody.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreSleepCallback.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreResourceManager.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgrePose.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreManualMeshUtil.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreJointCallback.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreForceField.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreExtendedTypes.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreEffectsSystem.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreDeletionCallback.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreContainer.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreCompoundActor.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreClothRaycaster.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreCloth.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreCharacterMovementModel.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
1>NxOgreCharacterModel.obj : warning LNK4221: no public symbols found; archive member will be inaccessible


however the nxOgre compiled fine. next I changed the include directories for release mode in my main application so it looks like so:



however upon trying to compile it I got these errors:


1>d:\Ivans big soviet adventure\mainApp\mainApp1\mainApp1\include\BaseApplication.h(41) : error C2039: 'CharacterMovementVectorController' : is not a member of 'NxOgre'
1>d:\Ivans big soviet adventure\mainApp\mainApp1\mainApp1\include\BaseApplication.h(41) : error C2504: 'CharacterMovementVectorController' : base class undefined
1>d:\Ivans big soviet adventure\mainApp\mainApp1\mainApp1\include\BaseApplication.h(43) : error C2039: 'Character' : is not a member of 'NxOgre'
1>d:\Ivans big soviet adventure\mainApp\mainApp1\mainApp1\include\BaseApplication.h(43) : error C2061: syntax error : identifier 'Character'
1>mainApp1.cpp
1>d:\ivans big soviet adventure\mainapp\mainapp1\mainapp1\include\BaseApplication.h(41) : error C2039: 'CharacterMovementVectorController' : is not a member of 'NxOgre'
1>d:\ivans big soviet adventure\mainapp\mainapp1\mainapp1\include\BaseApplication.h(41) : error C2504: 'CharacterMovementVectorController' : base class undefined
1>d:\ivans big soviet adventure\mainapp\mainapp1\mainapp1\include\BaseApplication.h(43) : error C2039: 'Character' : is not a member of 'NxOgre'
1>d:\ivans big soviet adventure\mainapp\mainapp1\mainapp1\include\BaseApplication.h(43) : error C2061: syntax error : identifier 'Character'
1>.\src\mainApp1.cpp(29) : error C2143: syntax error : missing ';' before '*'
1>.\src\mainApp1.cpp(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\src\mainApp1.cpp(29) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\src\mainApp1.cpp(47) : error C2872: 'ParticleSystem' : ambiguous symbol
1> could be 'd:\nxogre10\1.0\nxogre\include\NxOgreParticleSystem.h(31) : NxOgre::ParticleSystem'
1> or 'd:\ogresdk145\include\OgreParticleSystem.h(60) : Ogre::ParticleSystem'
1>.\src\mainApp1.cpp(141) : error C2061: syntax error : identifier 'TriangleMeshShape'
1>.\src\mainApp1.cpp(141) : error C2661: 'NxOgre::Scene::createBody' : no overloaded function takes 2 arguments
1>.\src\mainApp1.cpp(141) : error C2143: syntax error : missing ';' before ')'
1>.\src\mainApp1.cpp(141) : error C2143: syntax error : missing ';' before ')'
1>.\src\mainApp1.cpp(151) : error C2061: syntax error : identifier 'TriangleMeshShape'
1>.\src\mainApp1.cpp(151) : error C2661: 'NxOgre::Scene::createBody' : no overloaded function takes 2 arguments
1>.\src\mainApp1.cpp(151) : error C2143: syntax error : missing ';' before ')'
1>.\src\mainApp1.cpp(151) : error C2143: syntax error : missing ';' before ')'
1>.\src\mainApp1.cpp(180) : error C2660: 'NxOgre::Scene::createCharacter' : function does not take 3 arguments
1>.\src\mainApp1.cpp(181) : error C2227: left of '->createNode' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(183) : error C2227: left of '->getNode' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(183) : error C2227: left of '->createChildSceneNode' must point to class/struct/union/generic type
1>.\src\mainApp1.cpp(213) : error C2227: left of '->setMovementVectorController' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(214) : error C2227: left of '->getGlobalPosition' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(284) : error C2440: '=' : cannot convert from 'Ogre::ParticleSystem *' to 'NxOgre::ParticleSystem *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\src\mainApp1.cpp(286) : error C2664: 'Ogre::SceneNode::attachObject' : cannot convert parameter 1 from 'NxOgre::ParticleSystem *' to 'Ogre::MovableObject *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\src\mainApp1.cpp(287) : error C2039: 'getEmitter' : is not a member of 'NxOgre::ParticleSystem'
1> d:\nxogre10\1.0\nxogre\include\NxOgreParticleSystem.h(31) : see declaration of 'NxOgre::ParticleSystem'
1>.\src\mainApp1.cpp(287) : error C2227: left of '->setEnabled' must point to class/struct/union/generic type
1>.\src\mainApp1.cpp(341) : error C2227: left of '->addMovement' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(341) : error C2825: 'Character': must be a class or namespace when followed by '::'
1>.\src\mainApp1.cpp(341) : error C2039: 'DR_Backward' : is not a member of '`global namespace''
1>.\src\mainApp1.cpp(341) : error C2146: syntax error : missing ')' before identifier 'DR_Backward'
1>.\src\mainApp1.cpp(341) : error C2059: syntax error : ')'
1>.\src\mainApp1.cpp(345) : error C2227: left of '->getGlobalPosition' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(348) : error C2227: left of '->addMovement' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(348) : error C2825: 'Character': must be a class or namespace when followed by '::'
1>.\src\mainApp1.cpp(348) : error C2039: 'DR_Forward' : is not a member of '`global namespace''
1>.\src\mainApp1.cpp(348) : error C2146: syntax error : missing ')' before identifier 'DR_Forward'
1>.\src\mainApp1.cpp(348) : error C2059: syntax error : ')'
1>.\src\mainApp1.cpp(353) : error C2227: left of '->setRawNextMovementDirection' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(358) : error C2227: left of '->getGlobalPosition' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(402) : error C2227: left of '->addMovement' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(402) : error C2825: 'Character': must be a class or namespace when followed by '::'
1>.\src\mainApp1.cpp(402) : error C2039: 'DR_Jump_Up' : is not a member of '`global namespace''
1>.\src\mainApp1.cpp(402) : error C2146: syntax error : missing ')' before identifier 'DR_Jump_Up'
1>.\src\mainApp1.cpp(402) : error C2059: syntax error : ')'
1>.\src\mainApp1.cpp(404) : error C2227: left of '->setRawNextMovementDirection' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(483) : error C2227: left of '->getGlobalPosition' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(485) : error C2227: left of '->setPosition' must point to class/struct/union/generic type
1> type is 'int *'
1>.\src\mainApp1.cpp(501) : error C2039: 'getEmitter' : is not a member of 'NxOgre::ParticleSystem'
1> d:\nxogre10\1.0\nxogre\include\NxOgreParticleSystem.h(31) : see declaration of 'NxOgre::ParticleSystem'
1>.\src\mainApp1.cpp(501) : error C2227: left of '->setEnabled' must point to class/struct/union/generic type
1>.\src\mainApp1.cpp(508) : error C2039: 'getEmitter' : is not a member of 'NxOgre::ParticleSystem'
1> d:\nxogre10\1.0\nxogre\include\NxOgreParticleSystem.h(31) : see declaration of 'NxOgre::ParticleSystem'
1>.\src\mainApp1.cpp(508) : error C2227: left of '->setEnabled' must point to class/struct/union/generic type
1>OgreMaxModel.cpp
1>OgreMaxScene.cpp

betajaen

21-08-2008 23:55:29

Yuri. You know C++, you've been on the forums for a while now - so I don't expect these types of questions from you.

1. Your compiling NxOgre as static. It says on the top of the screen either Debug_Static, or Release_static. You want Release or Debug.

2. You do know there is no Character system in 1.0 right?

3. The other errors are just changes in interfaces - brush up your reading on the shortguide about the new render system and the differences between actor and body.

yuriythebest

22-08-2008 01:04:48

Yuri. You know C++, you've been on the forums for a while now - so I don't expect these types of questions from you.


well I was registered in these forums for a long time, yes, but registration time != experience. Knowing c++ is a relative thing- I am very weak when it comes to dealing with dependency issues and compiling dependencies and that sort of thing.

I really appreciate your help- hopefully someday I'll be good in all of this :)


1. Your compiling NxOgre as static. It says on the top of the screen either Debug_Static, or Release_static. You want Release or Debug.


ok compiled in Release, placed the new nxogre dll in the release folder in my app

2. You do know there is no Character system in 1.0 right?

ok now I am very very confused and/or worried. In the F.A.Q it says that 0.9 is the latest stable version- so in 1.0 have you decided to remove the character system altogether or is it just not implemented yet? What do I need to use to make stuff that behaves like characters in 1.0? Why did nargil tell me to use 1.0?

nargil

22-08-2008 01:24:48

sorry, wasn't sure about 1.0 having character system. Just looked fast into intellisense and saw the classes for characters there, also "+ CharacterSystem extended" in changes log confused me.

Maybe you create your character in pure physx ?

yuriythebest

22-08-2008 02:07:21


Maybe you create your character in pure physx ?


sounds very good, but..... how?

xadh00m

22-08-2008 09:55:56

If you can´t wait until betajaen announces '22 (which should reintroduce a basic CC)
just look into the Physx samples. There is at least one about character controls...

yuriythebest

22-08-2008 11:41:43

If you can´t wait until betajaen announces '22 (which should reintroduce a basic CC)
just look into the Physx samples. There is at least one about character controls...


that depends- when is the '22 release due?

betajaen

22-08-2008 11:58:09

I took out the CC code because of Agiea released the source to theirs and I wanted to implement it directly into NxOgre - one less DLL, and a slightly better embedded system.

I am now working on the CC and Skeleton code on a separate project for NxOgre; However, I am playing with the idea of just releasing '22 this month without the CC changes.

Prophet

22-08-2008 13:15:43

Do it! Do it! But don't rush it!

xadh00m

22-08-2008 14:21:50

I am now working on the CC and Skeleton code on a separate project for NxOgre; However, I am playing with the idea of just releasing '22 this month without the CC changes.

Hmm... do you see a way of releasing '22 with a basic CC which has at least the
functionality as the CC in 0.9? I think thats the last thing which let people keep
to 0.9 (as in our case). And I really want to change our project to Bleeding.
Maybe we could manage e.g. ragdoll support manually until you have it in NxOgre.

betajaen

22-08-2008 16:18:55

Can't. I've literally started on a new sub-project for the CC. I've just started on the skeleton code for it, and haven't even touched anything related to kinematic actors. I just don't have enough time for the end of the month to finish even a basic one. "Basic" also means to me; rewriting the PhysXCharacterController.dll and placing it in NxOgre, because that is one things I have to do - to finish the CC code.


There has been some talk to port the 0.9 CC over to 1.0, I'm all for it. As long as it can be applied as a patch.

yuriythebest

22-08-2008 21:26:09

ok perhaps it's a problem with timestepping

I've tried changing the scene creation code like so

mPhysScene=mHax->createScene("My Scene",mSceneMgr,"gravity: yes, floor: yes, time-step-method: variable");

mPhysScene=mHax->createScene("My Scene",mSceneMgr,"gravity: yes, floor: yes, time-step-method: fixed");

but that didn't help much

I was also intrigued by the interpoleration thing here:

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=6616

but I don't understand how to implement it


also- how do I know my version of nxOgre recognizes the params I give it- just for fun I added " sdfdf: 32434" to the createScene params and it didn't complain.

betajaen

22-08-2008 21:55:08

NxOgre is very forgiving about the params. If your unsure; remember the rule - drop the m, lowercase and convert camel case to hyphens. Look at the source of how it's implemented; if your really unsure.

Aiursrage2k

23-08-2008 11:24:47

Hello is your character simply falling asleep or is it actually getting stuck in the geometry.

It looks like in realease mode that the model actually gets a little stuck (penetrated into the collison geometry). Try playing around with the controllers skin width.