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 / [STICKY] Dark Physics Techniques

Author
Message
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 11th Aug 2006 12:08
So much potential for all kinds of scenarios now we have Dark Physics. If you have any code snippets demonstrating a certain technique and would like to share it with everyone please post it here with a description
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Aug 2006 13:55
I agree that it would be good to have a library of isolated techniques. I noticed a Wind/Cloth one and a jumping capsule earlier. They are good because there is no confusion, just one technique.



Medieval Coder
18
Years of Service
User Offline
Joined: 31st Dec 2005
Location:
Posted: 11th Aug 2006 14:57
Title: Simulating Winds
Description: Changes winds and goes from states such as idle to a strong North Wind or East Wind.
Positive Z is North, Negative Z is south
Positive X is West, Negative X is East
Postive Y is Up, Negative Y is down
Also here is a list of the winds I put in:
North
North-East
North-West
South-East
South
South-West
Idle State
----------
Here is my first DP program...

For some reason the south and east winds dont really do so well, im not really sure why...

Rem Positive Z is North, Negative Z is south
Rem Positive X is West, Negative X is East
Rem Postive Y is Up, Negative Y is down


I attached a .exe for those who want to see it but cant.

Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 11th Aug 2006 15:35 Edited at: 11th Aug 2006 15:37
Title: Applying Continuous Collision Detection

Description: This code snippet demonstrates how continuous collision detection can be used. It is a way of dealing with very fast moving objects. This program requires the Dark Physics update.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 11th Aug 2006 15:59
Title: Pre processing meshes

Description: This program demonstrates the benefits of taking a large mesh, calculating the physics data and saving it to file. This file can then be loaded in bypassing the calculations - it save a large amount of loading time. This code is already included in Dark Physics but I thought I'd highlight it as it is important to use with your game levels.

ESP
18
Years of Service
User Offline
Joined: 2nd Aug 2006
Location: London, England, U.K.
Posted: 11th Aug 2006 16:00
Hi Mike,

phy set rigid body ccd 101, 1

Am I using an out of date DarkPhysics?

I get a `could not understand command` error.

Robin
ESP
18
Years of Service
User Offline
Joined: 2nd Aug 2006
Location: London, England, U.K.
Posted: 11th Aug 2006 16:07
Hi Mike,

Are you assuming we have the media/objects somewhere?

Robin
ESP
18
Years of Service
User Offline
Joined: 2nd Aug 2006
Location: London, England, U.K.
Posted: 11th Aug 2006 16:17
Hi Medieval Coder,

Media?

Robin
JerBil
20
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 11th Aug 2006 16:55 Edited at: 11th Aug 2006 16:57
EDIT: Sorry I didn't notice it needs the update...

Mike this syntax is not recognized in continous collision:

phy set rigid body ccd 101, 1

Ad Astra Per Asper
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 11th Aug 2006 17:11
Use any model you can find to test the mesh processing. As for the CCD command it will come in the update. The update is being uploaded now and once a few more people from TGC have tested we are good to go.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Aug 2006 17:47
in the boyancy demo I have added this gosub.

put a gosub _make_boat after gosub _water_setup

and put this code at then end.


if I graphic card that could do fx's I could see what was happening.

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 11th Aug 2006 18:52 Edited at: 11th Aug 2006 19:05
Back with another bit to change a demo, this time the beams demo, I knock out; make a sphere bit, and added this into the do loop.

and the other way using force

now one beam pulls away the other drops down.


Dark Physics makes any hot drink go cold.

Attachments

Login to view attachments
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 13th Aug 2006 20:12
hello all was messing around with the particle collisions and the settings for them are better than what is explained or shown
check out this tweak


like it says if you change the 54.17 (just under the block)to 55 (on the surface of bottom of block)a beam of particles pushes the other particles backwards , which means not only do the setting of 0 hit itself, it hits other particles, and scenery as well

Ink all over the screen...and dang it! Signature still does not show.
Black Mesa
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location:
Posted: 15th Aug 2006 00:48
Here is something I came up with the help of HowDo for making and recreating boxes.

Press R to re-create



Your mod has been erased by a signature
Redmotion
21
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 16th Sep 2006 11:31
This shows user control of a kinematic object linked to dynamic objects, joints and a use for creating joints on the fly:

When the sphere at the end of the rope touches the box on the floor you can press and hold W to attach to it (using a fixed joint) then use the cursor keys and Q and A to drag the box to another location. Pressing W again to release it.



BLACKMESA:SOURCE - mod for HL2 - Texture Artist
BIRTHSTAR:FRONTLINE - Texture & Environment Artist
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 16th Sep 2006 14:51
very nice red motion ... it is cool to move the "crane box" back and fourth like a swing an then releasing the box at the apex sending it flying

General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 31st Oct 2006 22:29
Movement of dynamic objects through character controller



The main advantage of doing it this way, is that anything in DP will react with it (Ragdolls, Cloth, Dynamic particles etc)

Hope this is usefull

General Reed

AMD Athlon 64 3200+, 1GB ram, Geforce 6600 GTX, 80GB HDD
Vist www.scratchyrice-dev.co.uk
Freddix
AGK Developer
22
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 22nd Dec 2006 11:45
@General Reed: your snippet was really useful for me in my project
Thanks

All we have to decide is what to do with the time that is given to us.
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 31st Dec 2006 15:00 Edited at: 31st Dec 2006 17:11
Hi everyone. I have a new technique as a replacement for the character controller. Here it is:


The main diffrence between this one and the last one, is that it includes calculation of mass, so the player cant simply walk through a huge mass
Enjoy!

-General Reed

Beware, Killing chavs is not a crime, but is the only way to cure the earth
Vist www.scratchyrice-dev.co.uk
JerBil
20
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 4th Jan 2007 20:26
Here is a tip about using get collision data.


If your code has been checking objects c against d
and you later make objects that were checked as c
with higher object numbers than d, detection will
be reversed.

You will need to change program code following detection,
but d against c will still function properly.

or, to put it another way...

Ad Astra Per Asper

Login to post a reply

Server time is: 2024-11-24 10:56:34
Your offset time is: 2024-11-24 10:56:34