Character Control, Best Approach, I will take it from there.

xekon

24-07-2009 01:50:44

Is it bad to mix Physx with NxOgre?

Source
No, it's fine. Just don't use the userData in the PhysX classes, it's used by NxOgre for storage and identification.


Before I venture off to try and learn and implement something I know nothing about, I wanted to ask if its a good idea first.
My game is going to be a click to move type game. I am pretty much trying to make the control system near IDENTICAL to Diablo 2 and then modify it from there...

What I am wondering is if I could directly use the CharacterController that ships with PhysX SDK... and still use NxOgre for the things that are implemented?

At the same time I am wondering if I would be better off using the NxOgreKinematicController as a starting point since I will probably have to adapt whichever charactercontroller I go with. It seems like most charactercontroller use a direct input type system where you tell it where to go by pushing the move key that moves the object until you release that key, however for my game I need to be able to click on the ground and my character walk to that point, so at the moment I am very unsure what I need to do.

betajaen

24-07-2009 02:08:44

A really simple version of the kinematic controller would do. You can use the kinematic actor to represent your character (and other creatures/humans/etc).

- Moving is really easy; you just need a direction to move to Ogre::Vector3(mouse_clicked_pos - player_pos).normalisecopy().

- Collision detection against the player and the game world is a bit more tricky. Like the NxCharacter you'll have to use sweeping or intersections; Basically a larger version of the shape of the kinematic actor is kept aside. You use that to pretend the character has moved in a particular direction, you capture any hit results - if you get something, then you don't go in that direction.

- Gravity/Slopes is more difficult. It requires more collision detection but you need to check if the detection is beneath or above then decide if it's a wall/player or not then get a position based on a mixture the desired direction and slope hit position. For now I recommend you just make the world flat, then worry about slopes later.

You can have a look on how I did the Character in BloodyMess, but it's much more complicated than you want. For now, I suggest you create class, inherit KinematicActor and start making it move around based on mouse clicks.