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 / [Dark Physics] Modfied sphere won't fall over.

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Aug 2006 15:29
Hi All,

Could be I just haven't read doc right, how do I get a scale sphere to fall flat if its possible.

doing this



or do I need to set something else, thet react ok just won't fall flat like i was think.

I'm not getting you down am I, Ho Look! another fancy Door?
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Aug 2006 15:37
Are you trying to make it so that it doesn't bounce when it hits the ground?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Aug 2006 15:46
both hit the ground the fall over ( makeing a penny fall machine)

heres all the code



just been making work without media hope I got them only two.

I'm not getting you down am I, Ho Look! another fancy Door?
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 3rd Aug 2006 16:08 Edited at: 3rd Aug 2006 16:08
If you're making coins, wouldn't you be better off using make object cylinder and phy make rigid body dynamic mesh ?

Cheers,

Cloggy
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Aug 2006 16:13
That was they way I was going to go but they have no faces there hollow, so I am using scaled spheres to look soild.

I'm not getting you down am I, Ho Look! another fancy Door?
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Aug 2006 16:13
There's 2 demos which will be useful to you. Check out the Rigid Body\Restitution demo which shows how you can control the bounciness of objects by modifying their restitution. The second demo to look at is the Rigid Body\Mass Position which can be used to control how objects fall over. You can make it so that the weight in an object is aligned to a certain area and in doing so get the effect you want.

As for using dynamic meshes - I'd stay away from this unless it's a last resort. While it can work well it will inevitably slow things down.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Aug 2006 16:20
Cheers Mike will look at those demos

Quote: "As for using dynamic meshes - I'd stay away from this unless it's a last resort. While it can work well it will inevitably slow things down. "


If I am using them, where am I and what are they.

I'm not getting you down am I, Ho Look! another fancy Door?
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Aug 2006 16:21
It was just something that Cloggy suggested. You're not using them in the code you posted
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 3rd Aug 2006 16:22
The problem with them not falling over though is that you are adding them to the physics engine as spheres, it has no idea that they are flat. Use your method to produce flat spheres but use dynamic mesh instead of dynamic sphere. Only problem is that is quite slow.

Cheers,

Cloggy
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Aug 2006 16:28 Edited at: 3rd Aug 2006 16:31
Ah I see or make disc.x model and use box (I think)


er meshes slow er I just lay the table for tea.(might a bit quicker on a P4 )

I'm not getting you down am I, Ho Look! another fancy Door?
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 3rd Aug 2006 16:32 Edited at: 3rd Aug 2006 16:32
You could make a disc model create the physX entity using phy make rigid body dynamic mesh ID, file$

This will create a .mesh file containing the physics representation of the model. ( you would only do this to create the .mesh file).

In your game you the load the model and load the .mesh fiel using the command phy load rigid body dynamic mesh ID, file$

This then creates the entity much faster as it doesn't need to do any calculations.

Cheers,

Cloggy
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Aug 2006 16:37
If you do choose the method of using dynamic meshes then definitely go for the route Cloggy says. It will be much easier loading in the files in this way. Alternatively perhaps try using convex meshes. Whichever option you choose I'd recommend hooking up to the debugger so you can get a better idea of how the simulation is seeing the world.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 3rd Aug 2006 16:45
cheers Mike will try that later on, have to now go and earn me money for the night so play has to stop

part tried Cloggy route but must have mess up as it giving me the send don't send error.

heres what I did.

phydone start as zero the becomes a one, might try convex if got time before I go.

(that will look really wried in four day time)

I'm not getting you down am I, Ho Look! another fancy Door?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Aug 2006 22:47 Edited at: 3rd Aug 2006 22:47
The most efficent way should be to make dynamic capsules. However, when I tried this, the rigid body seems to be confused by the scaling. Maybe somebody can help me out with this one, and tell me why the capsule is so big. Code below, and a screenshot from the debugger. I took the shot sideways on, which should show a thinner rigid body shape.

The really odd thing is that the vertical velocity you applied to the sphere suggested it was much lighter, it rocketed into the air. That would mean it was much lighter, which a capsule would be!








Attachments

Login to view attachments
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Aug 2006 22:59
Something odd going on with the capsules there. I tried changing the make code to:



Everything falls down and lands on its side.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Aug 2006 23:02
I also changed this to reduce the bouncing:



Been watching things in the debugger and this is maybe closer to what you want.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Aug 2006 23:06
I updated the capsule creation code to take into account scale. When using capsules everything is much smaller now but it's still just a little too big. How about this - I can add in commands where you specify the size of the rigid body manually so you get complete control? Would that work for you?
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Aug 2006 23:10
Even with making the sphere half the size so it fits through it still acts like a sphere rather than a capsule. So in this case I think either use a box or wait for me to add in a few custom commands where you get further control for extra precision.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Aug 2006 06:19
Thank for all your hard work while I've been at work, will carry on doing this way, will look for your custom commads set when its ready.

tried that debug thing but could not get to do what BatVink made it do.

wonder what I did wrong?

Now to check out what you been upto.


I'm not getting you down am I, Ho Look! another fancy Door?
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 4th Aug 2006 07:03
Is the way that Cloggy described faster on loading time? Because when I tried to load my dynamic mesh,it went dreadfully slow. I vowed never again use a mesh that took so long to make. So does this make it faster? And does it slow down the game in anyway? And another question! Is there a way I can make something like the rigid body system in newton,and save the physics model. I know games like halo 1 do this,but the halo 1 physics models were just a bunch of spheres.

Woohoo. DP is finally released!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Aug 2006 07:23 Edited at: 4th Aug 2006 07:26
Not able to say yet Benny53 as i am still getting me head around this new powerfull code, at least there the weekend so I will have more time to try thing out.

Now for an update on me penny falls, got it part doing what I was after they now bounce off the pins on the way down but end up nailed into the sliding platfrom instead of resting on it and being drag flat.



plus am I using the phy make material commands in the correct way.

if you have the AI or phyics code you will find the stripe image that comes with them to use as the background.

edit
Worked out how to use the debug thingy simple when you use phy enable debug[b]

I'm not getting you down am I, Ho Look! another fancy Door?
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 4th Aug 2006 10:15
Benny53, check out the Dark Physics\Demos\Rigid Body\Processing demo for info on how to improve loading times.
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 4th Aug 2006 12:39
HowDo,

Hope you don't mind, but I've made some slight modifications.

I have created a mesh for the coin, and a physics .mesh file to go with it. Also I have changed the pins to be rotaed boxes rather than cylinders as this seems to work better.

The only problem now is that when the coins fall (which works perfectly) they do not seem to push coins that have already fallen, rather they appear to move inside the fallen coins! (a bit of a problem with a penny falls machine)

Maybe Mike could have a look at this and see if there is a problem that can be corrected.

BTW the attached zip need to be extracted into the project directory.

Cheers,

Cloggy

Attachments

Login to view attachments
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 4th Aug 2006 13:21
Cloggy, can you show me the updated code you're using please. I can try it out later.
Cloggy
19
Years of Service
User Offline
Joined: 31st Oct 2004
Location: Rayleigh, Essex
Posted: 4th Aug 2006 14:03
Oops, Sorry Mike.

Here it is.



Cheers,

Cloggy
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Aug 2006 16:49
Well boys and girls I've got it (with help from Mike and Cloggy) to almost work they way I want just the part on how to stop the coins melding together.



I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Aug 2006 17:34 Edited at: 4th Aug 2006 17:38
Now I've have load limit on something get to about 60 coins and it stops with object alrad exits? (57 coins)


heres the code in case I have changed it more than the one above.


I'm not getting you down am I, Ho Look! another fancy Door?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Aug 2006 22:30
Your coins start at 41, the background sphere is 99.

99 - 41 = 58 coins!!!



HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Aug 2006 22:34
cheers BatVink, sums aren't me best subject.

Right off we go again.

just a thought do you think someone should start a material list thread.

I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th Aug 2006 02:05
Ok how do I do this
this is how I would do it with a normal object

turn object left oldid-1, wrapvalue(object angle x(oldid-1))+.1


so how do I do it using physics, not like object angle x.

phy set rigid body kinematic rotation oldID-1, wrapvalue(object angle x(oldid-1)),0,0

I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 6th Aug 2006 12:01 Edited at: 6th Aug 2006 14:33
HI again have a new problem that I can not see if there a command for.
problem

each time I drop one of the disc it always falls the same way, I 've tried randomize timer() but that does not change anything , do I have to add random number to something else.

the code.


I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 6th Aug 2006 14:35
general interest what frame rate do you get with 200 coins on screen and what setup do you have.

eg P3 382ram xppro radeon 9000 pci

I'm not getting you down am I, Ho Look! another fancy Door?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 6th Aug 2006 20:23
Save making a new thread I am using this one so now I have put in pick object which now lets you click on any of the three boxes at the top to drop a coin.



I'm not getting you down am I, Ho Look! another fancy Door?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Aug 2006 09:45
Quote: "just a thought do you think someone should start a material list thread"


Had a similar converation with GeeCee a while ago, it would be a good idea.



HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 7th Aug 2006 15:29
Hey what happend I move one above the the phyiscs stuff in my code and an object that was a very dark blue has become a bright pink.

Why ?

this is how it was before and a dark coloured object.

now with the line fix object pivot id move to before the physics.


heres the working code.


I gather its do the dBPro code frist then the Physics but way was it such a big change in looks.

I'm not getting you down am I, Ho Look! another fancy Door?
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 7th Aug 2006 15:40
One thing about pivots - they are not supported in Dark Physics. It's best to make sure the model is correctly orientated before loading into DB Pro.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 7th Aug 2006 15:42 Edited at: 7th Aug 2006 15:48
Mike can that be done by saving it out as a dbo then loading back in.

And so he went away and tried it and found the answer was yes.( I think.)

I'm not getting you down am I, Ho Look! another fancy Door?
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 7th Aug 2006 15:47
The pivot data will be saved into the DBO object but that wont solve the problem. If you can get this correct in the modeller it will be easier to work with.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 7th Aug 2006 16:03
Mike Will have to invest in a modeller package as the coin object I acquired from Cloggy (cheers Cloggy).

I'm not getting you down am I, Ho Look! another fancy Door?

Login to post a reply

Server time is: 2024-04-20 12:18:32
Your offset time is: 2024-04-20 12:18:32