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.

Work in Progress / Tokamak Physics - Preliminary demo

Author
Message
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 16th Feb 2004 17:39 Edited at: 16th Feb 2004 20:25
If you haven't seen elsewhere, I've been working on getting the Tokamak physics system working with DBPro.
You can check out a topic on LLRGT on the subject by going here:
http://www.dannywartnaby.co.uk/rgt/index.php?board=22;action=display;threadid=2277

I'm not ready to release the wrapper yet. It still needs cleaned up a bit and I need to fix a few of the functions.

I've put together a REALLY QUICK demo though to see it in action.

You will need to download the Tokamak physics DLL from their site:
http://www.tokamakphysics.com
You need to place the file "tokamakdll.dll" that will be found in the lib folder into your system32 folder.

You can grab the demo from here:
http://www.ericksonline.com/DB-Tokamak-PrelimDemo.zip
It is approx. 2 megs

The demo just repeatidly drops a bunch of random objects onto a fixed sphere and box. Nothing big, but it is enough to see what is coming

I also wanted to again give credit to Sweenie from BB. Without his original wrapper code, I would have got nowhere with this. Even still, it isn't too bad for my first C++ project

Let me know what you think.

WOLF

Hoooowwwwllll!!!!
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 16th Feb 2004 19:29
sweet!!!!


can't wait for the wrapper!!!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 16th Feb 2004 19:44
Wow, this is great, release the wrapper soon

Ran no slower then 190 FPS

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 16th Feb 2004 20:50
AWESOME!!!, 600 FPS!!! , nice job mate goes for sweenie to



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
Juso
22
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 16th Feb 2004 20:56
Very nice and 663 fps , but what about adding "control camera using arrowkeys" to give better views
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 16th Feb 2004 21:20
what kinda monster computers have you guys got??? 600+ fps... i get 70! which is pretty neat on my system anyways cool demo and well done wolf, p.s. the cameara control is a pretty good idea...

Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 16th Feb 2004 21:34
Yeah... I should have added something like that. I'm not going to now though.
Hopefully, the next download will be the wrapper

I get 190 FPS.
Keep in mind that this is with 2 physics calculations done per time advance, not 1.

Hoooowwwwllll!!!!
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 16th Feb 2004 21:59
I wonder how the collision is handled so quick , is there a difference between physic collisions and other collisions?



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 16th Feb 2004 22:16
It is just math based based with 3 different shapes: sphere, box and capsule. No clue on how they do it so fast. Maybe it is just that WE are used to working with DB, not C++

Hoooowwwwllll!!!!
Sonic
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: UK
Posted: 16th Feb 2004 22:18
The potential is awesome!

I got 190 FPS but noticed that most objects just passed through, only about 20% actually collided with the sphere/block. Was that the intention?

"My ignorance amuses me..."
http://www.victory-road.co.uk
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 16th Feb 2004 22:44
No...
That is one problem with Tokamak that I have found. It has to do with an old colision detection problem. If velocities are too high an object can pass through what it is intended to colide with. There are a couple of things that can be done within Tokamak to improve help take care of the problem.
Try to run it again and see if you get the same results.

Hoooowwwwllll!!!!
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 17th Feb 2004 00:06
Good job, Wolf I'm getting upwards of 500 FPS on this end.


http://www.jeku.com/audio/
Ancient Chinese proverb: Man who runs behind car gets exhausted.
Sonic
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: UK
Posted: 17th Feb 2004 01:15 Edited at: 17th Feb 2004 01:55
Yeah I ran it a few times - always the same kinda thing. No one else has mentioned it - is it Chip/card related you think??!!

EDIT: Ran it after a reboot (or 2) and it ran just fine

"My ignorance amuses me..."
http://www.victory-road.co.uk
Xsniper
21
Years of Service
User Offline
Joined: 29th Dec 2002
Location:
Posted: 17th Feb 2004 03:29
Wolf,
This is looking great man! Keep up the good work! This will be an extreme benefit to the dbp community if you can get that wrapper solid. ^_^

FoxBlitzz
21
Years of Service
User Offline
Joined: 19th Nov 2003
Location: United States
Posted: 17th Feb 2004 03:58
It's pretty nice, but I found that some objects fell through other objects. I got a FPS of 210. However, I did see a few events in which the reactions of the physics aren't quite realistic. If this was as good as the physics as those seen in the N64 game Rocket: Robot on Wheels, I'd be amazed.

HP Pavilion | Intel Pentium 4 CPU 2.40 GHz
512 MB Ram | NVIDIA GeForceFX 5600 AGP, with 256 MB Ram
AlecM
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Concord, MA
Posted: 17th Feb 2004 04:36
Tokamak is capable of everything in that little n64 game.

Wik
21
Years of Service
User Offline
Joined: 21st May 2003
Location: CT, United States
Posted: 17th Feb 2004 05:23
300-500 fps

usually 415


WOLFY
22
Years of Service
User Offline
Joined: 28th Aug 2002
Location:
Posted: 17th Feb 2004 05:34
Objects falling through other objects is a touchy problem. As I said before there are some things that you can do to make it less likely. Tokamak basicly works like this:
Main loop:
-Get time (how long since your last iteration)
-Advance the physics engine
-Update DB objects locations and rotations to the physics engine.

If an object falls through another object, the movement of the object in relation to the timestep (velocity) was too great. The falling object passed completely through the other object's colision bounds in a single timestep, so no colision is detected. One thing that can be done is to increase the iterations in the "advance physics" command. If you have 2 iterations, not only will it check for colisions at the objects position at the end of the timestep, it will figure it out half way in between it's old and new location. If you have 4 iterations it will figure it out 4 times. I have the iterations set to 2 in this demo. The cost is that it takes longer to calculate.

As far as objects not seeming to react correctly....
You can set MANY properties of the object up. Some of those things include Material Type, Mass, and inertial properties. Basicly, you can get them to react however you want (if you play around with it enough).

WOLF

HOOOWWWLLL!!!
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 17th Feb 2004 08:58
Very nice. Can't wait for you to finish it.


"Computers are useless they can only give you answers."
The Big Babou
21
Years of Service
User Offline
Joined: 10th Feb 2003
Location: Cyberspace
Posted: 19th Feb 2004 08:02 Edited at: 19th Feb 2004 08:04
I thought such physic calculations are processed by the CPU. Now I can change my CPU Multiplier "on the Fly". I made a Test with a Multiplier of 5.5x (which equals an Athlon XP around 900+ or 732MHz), and got around 280 FPS. I thought pretty good and tried a Multiplier of 16x (equals an Athlon XP 2600+ = 2133 MHz). to my surprise, I got around 280 FPS again. But it should have been much faster. Does anyone know why it isn't faster?

... they call it a royale with cheese ...
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 19th Feb 2004 08:13
hmmm.... perhaps your video card can't render the scene any faster than 280 fps, so even if the physics system can go faster, everything is bottlenecked by the graphics pipeline?

I have a feeling that's the problem, because DBPro won't continue after a "sync" command until the video card is done drawing the scene.

the good news is that this means the physics system is fast enough to work on an Athlon XP 900+ system without substantial slowdown

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 19th Feb 2004 09:15
That really is awesome...

I only got 42 FPS ( old Vid Card )...

One thing I did notice with it, is that when the prisms hit the sphere, they bounce off fine, and the spinning is fine, but, if you watch one of them, they seem to slowly stop spinning, as if they're moving through water...

It's alot more noticable when objects bounce off of the far side of the sphere, and start spinning, then slowly stop spinning, whereas in the real world, they would continue to spin.

I don't know if this is an issue with the Wrapper for DBPro, or the Physics engine itself, I just thought I'd let you know...

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 19th Feb 2004 15:46
The physics system does not update until you tell it to. The DBPro command will be "TOKs_Advance Time, Steps"
Time: the amount of time that passed since the last update
Steps: How many "passes" that you want the system to take. If set to 1, it will figure out where the object is at the end of the time amount. If set to 2, it will not only check the end point, but it would have checked half-way to the endpoint. The advantage of a higher step amount is that there is less chance of missing collisions. The cost is that it will take more processing time to figure out.

I think I may have discovered the source of the objects falling through the sphere that some people were getting. In that demo, the objects are initialized in random locations. I have to do some more testing, but I believe that when an object is placed within the collision bounds of another object, not only will it screw up the collsion checks for those objects, but possibly everything initialized after it. Some people may have just been un-lucky when they tried it. Like I said, I have to run some tests to find out for sure, but I think that might be what is happening.

Quote: "One thing I did notice with it, is that when the prisms hit the sphere, they bounce off fine, and the spinning is fine, but, if you watch one of them, they seem to slowly stop spinning, as if they're moving through water..."

There are dampening factors that you can place on your objects which cause what you are talking about. In the real world, the friction of the air WILL slow down the rotation of an object. Maybe not to the extreme shown in the demo, but it will. Anyway, the point is that it is all configuarable

Hoooowwwwllll!!!!
The Big Babou
21
Years of Service
User Offline
Joined: 10th Feb 2003
Location: Cyberspace
Posted: 19th Feb 2004 16:58 Edited at: 19th Feb 2004 17:00
sad thing. some cubes n spheres and my good ol' Radeon only manages 280 FPS.

Quote: "the good news is that this means the physics system is fast enough to work on an Athlon XP 900+ system without substantial slowdown "


theres always a way to see things in a positive way

Edit: good work Wolf. really nice

... they call it a royale with cheese ...
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 19th Feb 2004 22:35
Oh my god... very, very, very nice! I get 50fps, and on this old system that's very good. GOOD JOB WOLF .

--Mouse: Famous (Avatarless) Fighting Furball

I am the chainsaw paladin.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 19th Feb 2004 23:29
Quote: "There are dampening factors that you can place on your objects which cause what you are talking about"


Alrighty, thanks for clearing that up

Again, great work, thanks for taking the time to do this for the community.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 20th Feb 2004 04:18
Oh... a quick question... can Tokomak either create physics objects from DBP objects, or load up .x files to use as physics objects? If it can't it has no real use as a collision system

--Mouse: Famous (Avatarless) Fighting Furball

I am the chainsaw paladin.
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 20th Feb 2004 04:57
I suppose you could just use hidden primitive shapes for collision, and then apply the results to your onscreen objects.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 20th Feb 2004 15:23
Tokamak can NOT make collision bounds out of DBP objects or .x files. The hardest part about setting up the system is getting the collsion bounds set up. I disagree that it has no use though, it just takes a little bit of work initially.
There are 3 basic object shapes that Tokamak uses: Sphere, Box, and Capsule. Using a combination of those, you can make just about any boundry that you want.
If you make a shpere in DB, you use the command:
MAKE OBJECT SPHERE objectNo,Radius
Tokamak has no idea that you created the object, so you have to set it up there too. The command is:
TOKrb_AddSphere(RigidBodyNo,Radius)

That is all there is to it. More complicated DB objects such as .x models need a combination of shapes to make up collsion bounds.
Tokamak also has the capability to use a collision system other than it's own. You have to pass the collision data (normal of collision, amount of penetration) to Tokamak and it responds. It is a very flexible system.

Also Tokamak has a terrain system. I am not sure of the details yet (I haven't dug into that part yet) but it is there.


A usefull tool that could be written is a shape setup system.

Hoooowwwwllll!!!!
Rob K
Retired Moderator
22
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 20th Feb 2004 15:36
The best way to think about Tokamak is that TOKAMAK creates the objects and simulates the physical interactions between them.

DBPro's objects just act as markers for the tokamak objects.


BlueGUI-Windows UI Plugin
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 20th Feb 2004 18:48
It'll be interesting to see how this works out when you get to hinges and (crosses fingers) limbs.

BTW, tried the demo out on my 1 Mhz AMD with a crappy GeForce 440MX and got 415-427 frames on average. I was, to put it mildly, stunned. It would be nice to have some interactive features in the demo such as controlling the number of objects, gravity, etc. Things that would affect the simulation as a whole without requiring the user to edit the properties of each object.
--
TAZ

Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 20th Feb 2004 20:45
There are 4 types of joints:
Hinge
BallSocket
BallSocket2
Slide

I have then implemented already, but have only tested the hinge commands so far.

I thought I would be able to release the first version of the wrapper today. Unfortunately, I'm still fighting through a rotation problem. I'm going to be prett busy over the weekend, so it will probably be available early next week.

Hoooowwwwllll!!!!
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 20th Feb 2004 21:12
Even my TNT2 gets 90fps. Collision didn't work the first time I ran it, but I read Wolf's explenation of random positioning, so I tried it again. Then it worked fine.

Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 20th Feb 2004 21:27
Oh well. If you can't make the Tokamak system load up objects and convert them into collision maths itself... which obviously isn't to be expected... it's not going to be useful for my current project (I believe it's exactly 12,501 seperate rather detailed interior and exterior 3d objects being dynamically loaded from). That dosen't make your programming job any less impressive, of course . And I'm sure this'll come in handy for me in the future.

Cheers!

--Mouse: Famous (Avatarless) Fighting Furball

I am the chainsaw paladin.
Xanatus
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Germany
Posted: 23rd Feb 2004 23:54 Edited at: 24th Feb 2004 01:38
when is finally the new demo commin?

[edit] oh, didnt saw your program announcement...

REDOXODER
22
Years of Service
User Offline
Joined: 11th Oct 2002
Location:
Posted: 1st Mar 2004 18:10
very good job wolf

does you car demo will be released soon ?? (view in rgt forum)
doc and source code ...




thx
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 3rd Mar 2004 21:25
that's really cool, i get 340fps while there are objects falling, 350 when none falling on screen

http://www.larinar.tk
AMD athlon thoroughbred 2200, 512Mb ram, 40Gb HD, ati saphire radeon 9600 atlantis w/128mb ddr ram, good creative-labs soundcard, cd-rw + dvd drives.
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 3rd Mar 2004 21:39
The car demo I believe has been postponed until Wolf has some new rotation commands delt with.

Trying is the first step towards faliure.
The Basics of DBPro Tutorial, on my site now!
Athelon XP 1600 Plus (1.4ghz) - ATI Radeon 9600 Pro - 256mb RAM
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 3rd Mar 2004 22:58
Yeah...
The car demo is on hold until I get some rotation issues worked out.
The problem is not with the wrapper but with one bug in DBPro.
DBpro uses Euler angles for rotation. The commands themselves are not buggy as some people like to think. Euler angles are just hard to understand.
I've written the wrapper to also work with Euler angles, so you can easily just dump the angles from DBpro to the wrapper and all of your objects are oriented properly. Easy as pie.
The one problem comes when you use the PITCH, ROLL, TURN commands in DBPro. When you use those commands it screws up the Euler angles that DBPro returns. It is a bug and hopefully will be fixed in U6.
I don't want to wait for that though
I'm in the process of writing another dll to not only fix the PITCH, ROLL, TURN problems, but also make everyones life a LOT easier dealing with rotations.
It will feature (so far):
-Global Rotation (the way people expect it to work)
-Local Rotation (getting around the bug in DBpro)
-Rotation around a given vector (all kinds of stuff you can do with this)
-Matrix information for Euler rotation (for all you advanced users)
The dll will not be free, but will be VERY cheap. Hopefully it will solve a lot of headaches for a lot of people. If there is anything else that you would like to see DB rotations capable of, let me know. I'll try to add it to the upcoming dll.

In the mean time I am also going to continue working on the wrapper. Right now I am working on some documentation. I have the simulation and animated body commands finished now. Next on the plate for the wrapper is static mesh support (usefull for terrains).

Ron ~ WOLF

Hoooowwwwllll!!!!

Login to post a reply

Server time is: 2024-11-22 01:38:52
Your offset time is: 2024-11-22 01:38:52