Character movement improvement.
Posted: Fri Apr 15, 2011 8:56 am
First of all, this project is really cool, and I'll certainly donate if I decide to use it, and maybe I'll donate anyway even if I don't.
I've been working on a DBP competition submission for 6 weeks or so, and I've started to realize that my own basic physics simulation is not enough to handle increasingly more complex events, so I've been considering a 3rd party library.
One thing I've noticed in the demo is that the character teleports onto the top of a box if you try to walk over it, and the box is small enough. I can't tell if this is also the case with the terrain, as the terrain is very smooth, but if there is a sharp incline on the terrain, will the player also teleport up the terrain incline?
One way to solve this issue would be to find the position that the player would be in if he/she teleported on top of the box/terrain, and then apply the appropriate impulse to move the player toward that position, instead of just teleporting the player there and ignoring all physics laws.
I don't know how to find the correct impulse to apply. Do you have any tips for this, or another method to solve this problem?
Thanks in advance for any assistance.
Edit: I see now that 0.16 is slated to have a more robust character controller. That's good to know, although any broad strokes you can give me for how to solve this issue would be good, as this project has to be ready for DBP in June. Unless of course, CharacterController updates are planned to arrive soon.
Edit: Modify TerrainDemo.cs to use this formula:
"heights[i, j] = (float)(50 * (Math.Sin(x / 4) + Math.Sin(z / 4)));"
After doing so I realized that there are actually several problems with character movement on the terrain.
The player does seem to speed up when moving over a steep surface, as I suspected.
The player can get traction on very, very steep inclines. You can prevent yourself from falling down the side of a near vertical cliff, as long as you push against the cliff.
I've been working on a DBP competition submission for 6 weeks or so, and I've started to realize that my own basic physics simulation is not enough to handle increasingly more complex events, so I've been considering a 3rd party library.
One thing I've noticed in the demo is that the character teleports onto the top of a box if you try to walk over it, and the box is small enough. I can't tell if this is also the case with the terrain, as the terrain is very smooth, but if there is a sharp incline on the terrain, will the player also teleport up the terrain incline?
One way to solve this issue would be to find the position that the player would be in if he/she teleported on top of the box/terrain, and then apply the appropriate impulse to move the player toward that position, instead of just teleporting the player there and ignoring all physics laws.
I don't know how to find the correct impulse to apply. Do you have any tips for this, or another method to solve this problem?
Thanks in advance for any assistance.
Edit: I see now that 0.16 is slated to have a more robust character controller. That's good to know, although any broad strokes you can give me for how to solve this issue would be good, as this project has to be ready for DBP in June. Unless of course, CharacterController updates are planned to arrive soon.
Edit: Modify TerrainDemo.cs to use this formula:
"heights[i, j] = (float)(50 * (Math.Sin(x / 4) + Math.Sin(z / 4)));"
After doing so I realized that there are actually several problems with character movement on the terrain.
The player does seem to speed up when moving over a steep surface, as I suspected.
The player can get traction on very, very steep inclines. You can prevent yourself from falling down the side of a near vertical cliff, as long as you push against the cliff.