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 / [DP]Gravity and Character Controller

Author
Message
Lani
17
Years of Service
User Offline
Joined: 14th Aug 2006
Location:
Posted: 5th Sep 2006 13:23
Hiya, I´ve switched to the Dark Physics system for controlling my character (and it´s much better than manually detecting his movement), however I have a few problems with gravity and my character.

Namely, that he falls extremely slowly, as if made of cotton. Unless I am moving him, in which case he seems to fall at about the right speed, but it´s hard to judge since in that case he´s still going forward, which I don´t like.

So I was wondering if there´s a way to detect if the character controller is "falling", and if so - how?

If not, I would like some advice on how to make gravity affect the character, since I haven´t yet found anything in the documentation on it.

Thanks!
imekon
17
Years of Service
User Offline
Joined: 3rd Jul 2006
Location:
Posted: 5th Sep 2006 13:41
This seems to be a part of the character controller that doesn't work as well as it should. I found the new 1.01 update adds a command to do with character displacement which has an effect only if you're character is moving!

"Reality Bites"
Lani
17
Years of Service
User Offline
Joined: 14th Aug 2006
Location:
Posted: 5th Sep 2006 14:58
Hmm maybe I need to rephrase

I have a Character set up with a character controller, and an .X file level as a rigid body (for collision).

If I, for example, walk off a ramp into the air, the character (correctly) falls.. however, he falls incredibly slowly. For some reason, it seems that if I move forward at the same time (phy move character controller player_object, charspeed#), the character falls faster, which I don´t understand.

So does anyone have any info on gravity and character controllers (such as do I need to set up the character in any other way than as a character controller box) for gravity to work? I tried phy set character controller displacement ID, x#, y#, z# with various values for y# (negative aswell as positive, just to test) but it didn´t do anything...

If anyone think they may be able to help, but need more info, I´ll be happy to provide it. Cheers!
Lani
17
Years of Service
User Offline
Joined: 14th Aug 2006
Location:
Posted: 5th Sep 2006 16:30 Edited at: 5th Sep 2006 16:33
Ok, I gave up on configuring it automatically, and just added a manual gravity (ie just before updating physics, it moves the character controller downwards an arbitrary value).

Still, there´s a few unanswered questions still (I´ll answer them myself if I discover how, but leave them open otherwise).

Namely, is there a way to discover whether a character is falling or not?

And why is the normal gravity so weak, and how to fix it? (guess it could simply be because my scene is relatively large?)
Cash Curtis II
18
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 5th Sep 2006 17:33
You can use raycasting. If you raycast from the top of the model to a set value below the model and there is no collision, then the model is falling. Then apply your gravity. I'd also disable control of the character when it's falling.

I'd use timer based control for the gravity. Otherwise, the rate of gravity will depend on the framerate, which can greatly affect gameplay.


Come see the WIP!
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th Sep 2006 17:43
Also, you should not just move the character down, you should have a float grav#. If you are on the ground, then set grav# to zero.
Otherwise, increase grav# by about 0.1
Move the character down by grav# amount. This will give a smooth curve when jumping/falling.

There are three types of people, those that can count and those that can't.
JerBil
19
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 5th Sep 2006 18:00
Set up character controller like I did in a program I'm working on:


Then you can use code like this for up and down.
Note that the speeds are multiplied by the setup value, so you have plenty of speed.


Ad Astra Per Asper
Cash Curtis II
18
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 16th Sep 2006 15:00
TGC, is there a solution to this yet? If we could just move a character controller down then that would totally fix everything. The command "phy move character controller" should just have a 'down' parameter.


Come see the WIP!

Login to post a reply

Server time is: 2024-03-29 13:13:41
Your offset time is: 2024-03-29 13:13:41