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 / Demos in Dark Physics

Author
Message
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:18 Edited at: 31st Jul 2006 11:18
I'm going through testing all the example programs this morning and making sure everything is working properly. While I do that I'll post a few screenshots and code so you can get an idea of how Dark Physics integrates with DB Pro.

In the Character Controller example a level from FPS Creator is loaded and from there you can walk around with full sliding collision etc. Here's an image and code for it:



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:25 Edited at: 31st Jul 2006 11:25
In one of the cloth demos we get to see how cloth and rigid bodies interact with each other. A simple scene is created and you can then move a ball around and see what happens.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:39
There are lots of joint types in Dark Physics including 6 Degrees of Freedom joints. These can be used to construct pretty much any joint imaginable. They are really flexible and the ideal method for when you need more control over a joint. Here's some code demonstrating attaching 2 objects together using a 6DOF joint. It basically allows for free movement on the object at the bottom.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:42 Edited at: 31st Jul 2006 11:42
We have several demo programs showing more complex uses of joints. One of them creates a machine with moving parts that has a chain of spheres attached to.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:45 Edited at: 31st Jul 2006 11:45
Many tutorials are included in Dark Physics covering all kinds of topics. One of them describes how to make a bridge using a collection of rigid bodies and joints. The tutorial guides you through from an empty program to constructing a full working bridge.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:49 Edited at: 31st Jul 2006 11:50
One of the joint demo programs shows how to create a door. Whenever any rigid bodies hit the door with some force it will swing open. You can also make it so that with a certain amount of force the joint will break and the door falls off.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:51 Edited at: 31st Jul 2006 11:51
You can make all kinds of interesting structures using joints and in one of the demos a ferris wheel is created.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:54 Edited at: 31st Jul 2006 11:54
In this example we show how you can combine revolute and fixed joints along with motors.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:56 Edited at: 31st Jul 2006 11:56
In another example of using joints we show how they can be used to construct tables.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 11:59 Edited at: 31st Jul 2006 12:00
With the particle commands you can create your own emitters and customise them how you like or use some prebuilt emitters. In this example program a fire emitter is used.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:04 Edited at: 31st Jul 2006 12:04
In this demo program a collection of spheres are dropped into a container made using rigid bodies. It also demonstrates how simple it is to switch on the PhysX accelerator by modifying the parameters used in the call to phy start.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:08
In another of the programs that harnesses the PhysX accelerator we create 4 walls using a large amount of rigid bodies. A further collection of rigid bodies are created and then dropped into the scene. This program shows how utilising the hardware results in double the frame rate over software alone.

Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:11 Edited at: 31st Jul 2006 12:12
If you have the PhysX accelerator you can take utilise the fluid command set in Dark Physics to create some impressive simulations. This program creates a container, pours in some fluid and then drops a few barrels into the container.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:25 Edited at: 31st Jul 2006 12:25
The ragdoll commands in Dark Physics can be applied to meshes to create things such as characters, ropes etc. In this example we look at how the commands are used to create a rope with a ball attached to the end of it. The rope is released into the scene and smacks into a pile of bricks toppling them over.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:32 Edited at: 31st Jul 2006 12:33
For certain situations using a regular rigid body box, capsule or sphere may not be appropriate. In such a case there are further options available to you including being able to represent your object as a convex meshes. In this example program we see how we can use convex meshes to create a more accurate representation of our objects.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:35 Edited at: 31st Jul 2006 12:35
It's also possible to have dynamic meshes within Dark Physics. It's not advisable to use this too often as it's very computationally demanding but in a few situations it may be useful. This example program shows how things are handled.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:38 Edited at: 31st Jul 2006 12:39
There are several ways of applying forces to objects in Dark Physics. In this example program we look at applying global and local force and see how this affects our objects.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:42 Edited at: 31st Jul 2006 12:43
It is often useful to separate your objects into groups. In this example a simple scene is created with 3 ground objects and a row of boxes directly above. The ground objects on the left and right use the default group. The ground object in the centre uses group. The row of boxes uses group 3. Collision is disabled between groups 2 and 3. As the boxes fall down they collide with the ground objects on the left and right but fall through the one in the centre.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:44 Edited at: 31st Jul 2006 12:44
It's possible to construct all kinds of things using the most simple of shapes. In this example a pipe is created with a collection of rigid body boxes dropped into it.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:47
Kinematic objects can be used when you want direct control over an objects movement. They can be used in situations where you might want a moving lift or platform. Implementing them is fairly simple. All it takes is to create a rigid body and then set it's kinematic property on. After that you can control it's position and rotation.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:49 Edited at: 31st Jul 2006 12:49
By default the centre of mass for a rigid body is aligned to the centre of the object. In certain situations it may be necessary to adjust the centre of mass as your object may be top heavy for example. This example program demonstrates how setting the mass affects the behaviour of objects.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:53 Edited at: 31st Jul 2006 12:53
Sometimes you may want to move a rigid body around by using forces for example. In this program the camera is facing downwards into a simple scene that has a ground object and box. The box is moved around with the arrow keys. In a game this kind of code might be used for an overhead or side on scroller game where the box is replaced by a ship.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:55 Edited at: 31st Jul 2006 12:56
In this example we see some pencil models loaded in, they are represented as dynamic capsules and dropped into a simple scene.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 12:57
When using static or dynamic meshes in your game there is some overhead in the initial calculations. This can be avoided by pre processing your meshes and saving the data out to file which can be loaded back in at a later stage. This example program demonstrates how this process can work.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 13:01 Edited at: 31st Jul 2006 13:01
If you are using lots of dynamic objects in your game there may be times when you want to temporarily remove them. This can be achieved by forcing rigid bodies to go to sleep and adjusting their collision groups.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 13:04 Edited at: 31st Jul 2006 13:04
You can control how rigid bodies react with each other by adjusting their materials. This example program demonstrates how altering the restitution ( bounciness ) of a material affects an object. One object is set up so that it has a high bounce, another with less bounce and the final one with virtually no bounce at all.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 13:15
Many commands are included in Dark Physics for finding out information on rigid bodies such as their velocity and momentum. This example shows how you can extract information.

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 13:47 Edited at: 31st Jul 2006 13:47
Back to convex meshes. This time the demo highlights the differences between representing your object as a static convex mesh and a static rigid body box.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 13:51 Edited at: 31st Jul 2006 13:52
In the torus example a hollow torus model is loaded and a dynamic rigid body mesh created for it. A collection of rigid body spheres are then created and placed inside the torus. It creates for an interesting effect and you can imagine how this kind of thing can be used in some kind of arcade game.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 13:54 Edited at: 31st Jul 2006 13:55
In the twisted pipe example a bunch of spheres are pushed through a static mesh with minimal code.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 14:02 Edited at: 31st Jul 2006 14:02
In another rigid body demo we see how you can make a water wheel and how it interacts with other rigid bodies.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 14:12 Edited at: 31st Jul 2006 14:13
There are several vehicle demos included with Dark Physics along with a full tutorial guiding you through the process of using a vehicle. I wanted to show the vehicles in the most simple way for one example so for this all I've done is the most basic code. I think it helps to see things like this though as you can concentrate on the most important side of things and then expand out.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 14:15 Edited at: 31st Jul 2006 14:16
The next vehicle demo takes things further and adds in a decent scene to drive around. It also shows how you can take further control over the driving.



Attachments

Login to view attachments
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 14:21
One of the tutorials covers how to get feedback about collisions that take place. Here's the code for it

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 31st Jul 2006 14:27
Good news is all demos and tutorials have been tested and no problems to report Taken about 4 hours to go through all of them. May post some more code and screenshots from other examples later on. For now returning to documentation and going over the command listings.
UDun
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: France
Posted: 31st Jul 2006 17:07
Great ! Thanks for these demos. It's very interesting. We can see how it seems easy to use Dark Physics with few commands.

I can't wait

Coding is dangerous for health ...
Indie Rock 13
20
Years of Service
User Offline
Joined: 1st Sep 2004
Location:
Posted: 31st Jul 2006 17:19
Woo, so that means it will indeed come out tomorrow right? *crosses fingers*


(these demos are just teasing us...)

Check out my music page: Kill for Quid (myspace)
I'm happy to make music for any game!
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 31st Jul 2006 17:29
Quote: "Good news is all demos and tutorials have been tested and no problems to report "


That is indeed good news!

Those demos looks awesome! Can't wait to try them out!

Bmad6
19
Years of Service
User Offline
Joined: 25th Aug 2005
Location: Virginia, United States
Posted: 1st Aug 2006 05:23
I think these demos look great, but I have one suggestion:

for people (like me) who are considering buying DarkPhysics but haven't yet ordered (preordered, i guess) it, why don't you make some (if not all) of these demos into exes?

These already help people who want to learn DarkPhysics by providing examples, but they could also help TGC sell more copies of DarkPhysics if you made them into exes, so that people could see what it's like before buying it.

Not that I'm questioning how awesome DarkPhysics is.

Programming is the art that fights back.
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 1st Aug 2006 10:14
Will be demos and videos posted on the web site when things are up and running.
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 1st Aug 2006 10:33
When is it coming out? Today? Pleeease say today! I just got some really sweet looking stuff. Actually,I'm gonna make a thread about it!(not here!,but in the dbp forum!) Ok,I'm gonna stop freaking out now.

About -10 min. if tgc is nice

well,it'll be released apparently at 1:00am for me. But who cares,I've stayed up all night plenty o' times
Habatar
20
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 1st Aug 2006 12:00
Yes, Today is the day.

Login to post a reply

Server time is: 2024-11-24 12:25:11
Your offset time is: 2024-11-24 12:25:11