What is the best way to move a AI entity?

urosidoki

10-01-2011 21:04:51

Hi guys.

I have been working so hard in a little prototype game.
I have my AI working nice, but I am using a kinematic object. This means that I dont have gravity scene forces applying on this actors ( because are kinematic ).

I think there is a way to use dinamyc actors union with addForce( ... ) and NX_BF_FROZEN_POS_Y, the problem is that when I use this:

mActor->addForce( forceAgeia, NX_SMOOTH_VELOCITY_CHANGE );
my player always go further from the destiny position.
I am using steering behaviour to move player, but I dont know how can I configure correctly the addForce function to make the movement accurate. I would like the player moves constantly or at least that he stops just in the destiny point......is it possible?

Any suggestion?

PD: I dont want use character controllers for the AI because is expensive.

Kind regards

betajaen

10-01-2011 22:39:18

setLinearVelocity?

urosidoki

10-01-2011 23:15:30

Thanks for your response betajaen :)

I tried but still doesnt work :(, my entity doesnt move when I call that function.
What is supposed I need pass as parameter? the displacement vector? My steering behaviour return to me the displacement he need walk, I guess that is the correct parameter I need set in the setLinearVelocity, right?

Is it possible that the problem is that I am calling in all frames this function? The documentation say something about that....

Here you have some videos of my prototype :)

http://www.youtube.com/user/joseantonio ... ature=mhum

Regards

urosidoki

10-01-2011 23:32:19

Ok, I get it :)

Thanks!!

One question more, I would like to know your oppinion about something, is not directly related to the physics, but maybe you have some idea.

If I am going to move my AI with physics, what if two rigid bodies collide? I mean, the AI is moving around the world, but when they collide they can start to change the direction, so the result of the movement is weird. Do you have any suggestion?

Other problem I have now and before with kynematics actor doesnt appear is the jittering, when he is closest to the destiny point he start to jitter, any ideas?

Regards!