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 / Character Controller - Can I Position Or Jump?

Author
Message
gbison
8
Years of Service
User Offline
Joined: 15th Dec 2010
Location: USA
Posted: 27th Dec 2010 19:44
Hello all,

I'm trying to learn the use of Dark Physics for a 3rd Person RPG enviroment. One of the main features I wanted out of DP was the character controller ability which I have either missed a boat load of documentation on or theres no real control methods for it.

I wanted a simple way to apply physics and gravity to my world without writing a book to do so, plus the collision is already done on the controller. So I created my demo world and my character. Everything seemed to work perfectly, collision was good, gravity was there, I could traverse hills and the like with a minimal amount of code. Then I decided to add in the other movment commands for my character, the first was jump and this is where it struck me, I cant reposition my character controller, theres no syntax for it. How in the world am I suppose to implement a jump command using the DP Character Controller? Is there away I can apply force to this? If not directly can a rigid body be attached to it, that I could apply force to?

Is it possible to make a character a dynamic object so that gravity and the like will still apply, yet I could write the code to manipulate it however I need?

In my searches I have found that alot of people are having trouble with DP, so that being said, is it worth my time and effort to learn, seems like according to many users its broken or lack luster in what it can do? I guess my question is that if this is the case, what other options do I have for a physics engine that can give me the control set I want?

Thanks so much.
HowDo
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Dec 2010 15:33
welcome to the forum.

Now it looks like you done a lot of reading on the forum and have found most of your answers, quickest way to work out how to make the Character Controller to jump is to use force, now it may or may not, work how you would like it to.

Best way is to take a copy of the Character Controller demo and add bits too it and see what happens, this is how I worked how to get strafing.

I think you might find some code on here that makes it jump but might take some finding, as the title to the post does not always mean what was asked.

There are some limitations but most can be worked around.

Do post again if you need more help and if I have tried doing it then it may be me that answers.


Also if you like PhysX help files like they are for DBP the put Blue in the search box at the bottom and set to look in this forum only, you'll find a post to download the help file htm and how to set it up.

Happy coding.

Dark Physics makes any hot drink go cold.
gbison
8
Years of Service
User Offline
Joined: 15th Dec 2010
Location: USA
Posted: 28th Dec 2010 16:13
HowDo thanks for the response. I'm testing various things today in order to see what can be applied to the controller. I'll post shortly with my results.
gbison
8
Years of Service
User Offline
Joined: 15th Dec 2010
Location: USA
Posted: 28th Dec 2010 18:54
Well Im back for a little update. First the bad news is I can't seem to get any force, linear or angular movement based off the rigid body commands against the controller. None of these seem to have any effect at all. Tried working with Kinematic as well and this doesn't seem to have any physics applied to it in the interim, almost like static. Im assuming everything has to be done manually to it.

That being said, I was curious if deleteing and recreating the controller in real-time would give the same effect as say position object. It does similarly in that it will recreate the controller obviously on the axis specified, so in theory I thought if I could map the controller to the physical object coordinates that basically I can make it follow suit. Well I used the demo for times sake and implemented a jump scenario using this method. It worked, albeit roughly and Im assuming deleteing and recreating controllers must be processor intensive, Im not sure of the code behind the controller itself, so thats speculation. None the less it worked for the demo, but theres got to be a better way.

[If Spacekey() = 1
x# = Object Position X(2)
y# = Object Position Y(2)
z# = Object Position Z(2)
y# = y# + 1
PHY Delete Character Controller 2
PHY Make Box Character Controller 2, x#, y#, z#, w#/2, h#/2, w#/2, 1, 1.5, 45.0
Endif]
DigitalFury
9
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 28th Dec 2010 22:07
@gbison -

Quote: "That being said, I was curious if deleteing and recreating the controller in real-time would give the same effect as say position object."


Not exactly the best idea. Created and deleting something again and again isn't good for the performance.

The best solution I found was to:
- Make a Character Controller
- Make a Dynamic Box the a little bit smaller so the collisions of the character controller registers.
- Use linear damping and set the material to have no bounce.
- Position the dynamic box at the position of the character controller.
- Restrict the dynamic box from rotating on any axis.
- Press space and add a force to the dynamic box on the y axis.
- Position the character controller's y position to the dynamic boxes y position.

The only thing that might be a problem is that the character controller might bounce a bit. You can control that in the loop or set the dynamic boxes properties.

It is on my to-do list to write a working character controller and I might even post it on my tutorials thread, but right now I am working on other things. You can check it out later and I might have a full example + tutorial up.

Let me know if you have any questions.

DigitalFury
gbison
8
Years of Service
User Offline
Joined: 15th Dec 2010
Location: USA
Posted: 28th Dec 2010 22:55
Ok I understand most of that, what Im not clear on is how you are going to keep the dynamic box with the character controller? I guess moving them together in essence, if that is what you are trying to say? Need a little more help...lol
DigitalFury
9
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 29th Dec 2010 20:56
@gbison -

Quote: "I guess moving them together in essence, if that is what you are trying to say?"


Yep.

This should clear somethings up: (pseudo code)

- Make a Character Controller
- Make a Dynamic Box the a little bit smaller so the collisions of the character controller registers.


- Use linear damping and set the material to have no bounce.

- Position the dynamic box at the position of the character controller.
- Position the character controller's y position to the dynamic boxes y position.


- Restrict the dynamic box from rotating on any axis.


- Press space and add a force to the dynamic box on the y axis.


As I mentioned before I might right a tutorial on this soon if u would like to wait a while.

It doesn't work perfectly yet. I had a lot of trouble getting the character controller to jump correctly. Just takes a lot of tweaking.

Let me know if you need anymore help.

DigitalFury
BillR
16
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 30th Dec 2010 01:54
I would be interested in learning more also,
so when you have time I think a tutorial would be great!
MrValentine
AGK Backer
8
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 8th Feb 2011 13:06
Before this gets locked... I think I better add something to keep this post going as it seems everyone vanished lol...

I need to know more related to how the character object falls... gravity doesnt help...

also if you did not already see this... General Reed's tutorial on here
http://forum.thegamecreators.com/?m=forum_view&t=86379&b=30

was very helpful... but I hope to figure out the gravity controls...

what I want is more controlled drop... rather than a sudden drop...

cheers in advance

TGC Products: Dark Game Studio–DarkCLOUDS-Enhancement Pack-3D WorldStudio-Animated Sprite Pack-FPS Creator X9 free upgraded to build-Dark Data-DarkNet-Unity-EZRotate

Login to post a reply

Server time is: 2019-09-16 17:51:52
Your offset time is: 2019-09-16 17:51:52