Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / DarkPhysics - Player movement acceleration problems

Author
Message
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 26th Sep 2007 01:55
Hi,
I am working on the player physics part of a game of mine and I recently started to rewrite that engine to use a "real" dark physics body instead of the character controller, which I had lots of trouble with to work the way I wanted.
So using my old Newton FPS engine that I wrote for the darkAI competition, I started to convert the newton code into DarkPHysics code for use with this new game.

However I have trouble with the acceleration and deceleration of the player body.

Here is my code:


If anyone have any ideas on how I can improve the acceleration and deceleration of the player, that would be great.

Basically, I want the player to instantly move at the speed given when a movement button is pressed, and when the movement button is released; instantly decelerate to 0.0 so the player halts.

And while I'm at it:
Anyone know how it would be possible to walk up stairs using the above code/method?
I found it hard to walk up the stair, because if the velocity is too high, the player will just bounce on the first stair step and fly over the stair. If it is too low the player is unable to move up the stair.

Thanks for your interest.

I allways afraided from a clowns. aww..
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 27th Sep 2007 02:03
Problem Solved.
Apparently I did the math wrong.

I will post a new code snippet soon in a different thread (I wish there would be a way to edit thread titles) when the player module is finished.

Remaining things are:
* Crouching will scale player and not just reposition camera so it will become possible to actually crawl under stuff
* Camera bobbing for walking, jumping and running

I am also going to add a few more things but I would like to keep some stuff unique to my game.

I allways afraided from a clowns. aww..

Login to post a reply

Server time is: 2024-09-08 00:51:54
Your offset time is: 2024-09-08 00:51:54