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 / Alternative to Character Controller

Author
Message
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 5th Sep 2006 20:57 Edited at: 6th Sep 2006 03:47
I'm using the trial version of the DP dll. But they disabled the use of the character controller. Since I have never used DP ever in my life I have no idea how to control my characters using the great physics of DP. So, how would I go about in controlling a phy enabled character?
Thanks for your time.

Edit: if the DLL expires, why put restrictions on it?
Hawkeye
21
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 6th Sep 2006 03:13
Well, you could try manually setting the velocity vector depending on which directional keys are being pressed. It'd be ugly, but it would work. Sorta.


I am but mad north north-west; when the wind is southerly I know a hawk from a handsaw - Hamlet, Hamlet
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 6th Sep 2006 03:45 Edited at: 6th Sep 2006 04:58
err. how would I do that? As I said, I'm extremely new to all of this DP stuff. I've been looking in the help files for velocity vector, but am not finding anything. But thanks for the idea.

Edit: I have half of it done. I can go foward and backwad

imekon
18
Years of Service
User Offline
Joined: 3rd Jul 2006
Location:
Posted: 6th Sep 2006 18:39
If you use local force then it applies it in the direction you're facing.

To move forwards:



To move backwards



To strafe left



To strafe right



To jump (actually fly straight up!)



Then all you need is some of the standard code used in FPS demos to make the mouse do the rotation and you're all set. Though your character will feel like he's being drive by "jet propulsion"...

"Reality Bites"
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 6th Sep 2006 23:27
how do you turn left and right>?


WarGoat
20
Years of Service
User Offline
Joined: 19th Sep 2004
Location: Montreal
Posted: 7th Sep 2006 00:52 Edited at: 7th Sep 2006 00:52
Wow that's nice. I didn't know DP had those command.


Windows XP,pentium IV, 3.0 MGZ, 1024 mb memory, 256 mb ATI Radeon PCIE X700 Pro 'sett squadron back on the assault'
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 7th Sep 2006 01:06
I solved this yesterday with my marble madness style control. Take a look at my post, there are 2 now which have the code. The latest one would be of more use to me if you try it . Look at phsics collision problem ( or close to that ) The typo is correct so you should find it easily. My original code is in "are there any profficient Physics coders out there?"

It works well for what I want. Not for a person's movement though.

Check out Project Desert Storm

http://forum.thegamecreators.com/?m=forum_view&t=83458&b=8
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 7th Sep 2006 01:12 Edited at: 7th Sep 2006 01:13
Guys, can you please tell me how you turn left and right?

Here is what I have so far:



EDIT: FOrgot to mention it goes craaaazy when you let go of the arrow keys/


dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 7th Sep 2006 07:07
Well, I found code on the thread mentinoned on Dvader's thread.
And Object 4 is a sphere for anyone who cares.

But when I change it to a cube (a tall one), it starts rotating as if it's on a harnest or something, or just floating in mid air. So, I need to fix that. But yah.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 7th Sep 2006 10:07
There's a demo included called Movement in the Rigid Body folder that may help. The main code is:

Iain
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: UK
Posted: 7th Sep 2006 21:42
I used that example to solve the problems on mine and my brother first person shooter, thanks for that mike, but now i have a new problem lol, now the there seems to be no gravity, im assuming this is due to the command

phy set rigid body angular velocity player1sphere,0.0, 0.0, 0.0

How can i get the gravity working again?
monotonic
18
Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 8th Sep 2006 00:35
Just change this line:

phy set rigid body linear momentum 2, 0.0, 0.0, 0.0

to be something like this:

phy set rigid body linear momentum 2, 0.0, -Gravity, 0.0

Where Gravity is your constant gravitational force, but this will result in linear gravity i.e. your entity will fall at the same speed no matter how long it has been falling for, to solve this just increase the gravity variable by calculating the acceleration.

I know the voices aren't real, but they have good ideas!
Iain
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: UK
Posted: 8th Sep 2006 00:54
Thanks, tried it but it still doesnt work, im assuming this is to do with the physics being on it, any more ideas?

Here is my code.

dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 10th Sep 2006 05:47
Same here, I don't want my character to do this:

Attachments

Login to view attachments
Iain
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: UK
Posted: 9th Oct 2006 04:21
Anyone worked this out?.
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 9th Oct 2006 06:24
Unfortunately no....

Your mom has been erased by a mod from you telling too many "your mom" jokes.
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 31st Dec 2006 16:58
Hi everyone. Ive worked it out. Here are a set of functions, to replace the character controller ones for now.
http://forum.thegamecreators.com/?m=forum_view&t=86379&b=30&p=0

I hope this is usefull

-General Reed

Beware, Killing chavs is not a crime, but is the only way to cure the earth
Vist www.scratchyrice-dev.co.uk
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 1st Jan 2007 07:28
I don't use character controllers. Do you have control of kinematic object with the trial version?


Come see the WIP!
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 1st Jan 2007 07:54
Actually, I know exactly what you can do. You can use a static box, and reposition it every loop based on the input. You need timer based movement, of course.

And, you'll need a secondary collision system running in the background. Repositioning a static body every time won't give you collision detection. Using Sparky's with spheresliding is perfect for this. I use Sparky's in the background for accurate collision detections, and it's extremely fast.

This also solves the problem of detecting DP collisions, because you can check object collisions with Sparky's, and collision bodies are rotated correctly. This also allows you to skip the whole crazy DP collision queue.

I experimented with a static box, but the results weren't quite as good as with a kinematic box. However, it did work. Basically, you can position the static box however you wish, including applying your own gravity and jumping. I ran into one minor issue, the box move any dynamic object aside, no matter how big. This can easily be solved. All you have to do is precalculate the object sizes. If it is bigger than a certain size, you add that object to the same collision group as all of your buildings (except you should use box collision, as they are far more efficient than mesh), and have an array filled with those objects that you'll update each loop.

Next, you have to make sure that the sphere you are casting is slightly bigger than the static box. That way, the character will slide around all of the big dynamic objects.


Come see the WIP!
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 1st Jan 2007 08:27
That's great, but the only reason we needed thses was because it was a trial. Since the trial is over, there isn't a great need for these. But thanks anyway!

Take heed, never take advantage of the things you need, never let your self be overcome by greed. Walk a strigh line, pick up your speed and try. Everyone deserves a piece of the pie By: Shaggy
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 1st Jan 2007 16:11
Thats ok, because i find them more usefull than the commands build in for character controlling. Mainly because they dont push the other objects around.

Beware, Killing chavs is not a crime, but is the only way to cure the earth
Vist www.scratchyrice-dev.co.uk

Login to post a reply

Server time is: 2024-11-24 14:58:27
Your offset time is: 2024-11-24 14:58:27