Game Development Community

Torque and tokamak physics

by James Freeman · in Torque Game Engine · 03/30/2004 (4:30 am) · 19 replies

Hi,

after playing around with the torque demo yesterday, i'm quite impressed with what it has to offer, but i was wondering about the possibility of adding the tokamak library to the engine - can someone who's seen the engine source comment on how easy/difficult this might be?

the tokamak website is http://www.tokamakphysics.com/ btw, just in case anyone's wondering what i'm on about =]

jb

About the author

Recent Threads


#1
03/30/2004 (5:04 am)
I actually think someone has implemented Tokamak with Torque, but I am not sure.

However Novodex, which seems to be a far faster physics engine, (www.novodex.com) have been implemented with Torque.

I only hope that novodex will release the code for the public to use..

Someone has also implemented ODE with Torque, but so far there seems to be quite some perfomance problems on that front!

- Rasmus
#2
03/30/2004 (10:26 pm)
I've integrated ODE using some code from the Resources and my own mods to allow it to be a DLL. Currently the integration uses Torques collision code. Someday someone will get it to work with ODE's :).

A possible solution to the speed of ODE:

The resource calls dWorldStep() in ODEWorld.cc while dFastStep1() is supposed to do the same thing, but faster. The drawback is that its a bit less stable (mathmatically speaking). Should just be a matter of tweaking numbers, though I havent tried switching the call.

The ODE team actually suggests a way to identify when to switch between the two calls to maintain stability but still get speed.

My concern with Tokamak is that its DLL only, so no Linux or Mac support.

Tyler
#3
03/31/2004 (1:51 am)
Tyler, what have you got working with ODE so far?

Can odd shades collide? (like cars)
How does it interact with terrain and players?
Have you tried switching the vehicle physics to ODE?
#4
03/31/2004 (2:49 am)
Hehe, I got ODE to work with the ODE collision, the thing was, it wouldnt collide with any of the other objects in the world (terrain, etc) as the trimesh collisions just wouldn't work. As far as I can tell, using the Torque's collision detection has no more affect on framerate than having a lot of objects (especially a lot of vehicles). But it only detects collision if the object is moving, so you can have a bunch of objects and it'll work just fine, as long as only a few are moving at once.

I have never really looked at Tokamak however. The Novodex demos were certainly stunning :D.
#5
03/31/2004 (9:20 am)
Ive tried sliding around the shapes that come with the Resource. Not much else. 5 or 6 of those sliding around the terrain bouncing off each other and buildings. With the resource, it only takes a few hours to get the basics up and working, so I would suggest trying it.

I just wanted to make sure that it was possible. It is. As it is, for my first little test game (just bought the engine), the physics were too realistic. I needed something more like the default simplistic physics. So I havent spent any more time on it.
#6
03/31/2004 (9:32 am)
IMHO, anyone wanting better physics with Torque, should all work together on ODE. With many mathmatically inclined coders integrating it, all performance issues will soon evaporate. Since the code itself is opensource, you can be assured hundreds, maybe thousands are working on the system itself, and will eventually perfect it.
If you choose one of the other proprietary systems, you will be spending countless hours getting it to work, with little help from other GGers, and finally wind up with a system that is either too expensive, not upgraded/expanded often enough, not OS independent, or some combination of such.
#7
04/23/2004 (6:15 am)
Hi to all, i already implement ODE in TGE, and i have almost all working, my dead bodies drop at ground, applying all forces. BUT i don't know, how i can send damage to dead body ? Some one can help ?
In ODE i almost do all except loading 3ds. When i do it my ragdoll will be finished.
#8
04/23/2004 (6:23 am)
Loading 3ds?
#9
04/24/2004 (2:06 am)
Yes. I already try to load real brushes to phys. world, but all became too slow. And i decide load some like phys. bounds. ODE can load mesh from vertex array and index array. 3ds is a perfect choise i think. Some one know how i can hurt already dead man ?
#10
04/24/2004 (3:31 am)
Lloyd, could you give more details on why you need to damage a corpse? I'm not sure if I understand what you are trying to do to the corpse. Corpses can respond to impulses.
#11
04/24/2004 (9:47 am)
Just an FYI, the trimesh support in ODE is fairly well broken, at least, so it was last time I used it.
#12
04/24/2004 (9:52 am)
Tocomak is pretty fast and flexible, and does do pretty stable rag doll physics. Been playing withit fora couple of months in a couple of games, not in TGE though. It's currently being integrated into our max plugins and max too, so you can use it in max instead of havok. That way you can set material friction in max and test it inside max and with the engine viewer in max before you test it in game.

you just have to make sure you build everything to scale or you can effect the physics.
#13
04/24/2004 (1:23 pm)
Just in case you missed it: www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5502

I'm not sure if that would be any help...
#14
04/26/2004 (8:20 am)
To adrian> but ODE is free.

corpse damage:
When player is dead, bullets pass thgrough corpse. My player have function where his taking damage, i trace when it's happend. When i alive, i take damage. When i dead, i already left in world, but no more recieve damage.

3ds:
ODE have function dTriMeshBuild. In this function i must send vertex and indices arrays, i recieve get this vertex from 3ds file, but i don't know how i can get this indices from 3ds.

Please help.
#15
04/26/2004 (8:25 am)
Tocomak is free too Lloyd and has a lot more depth to it than ODE as well as being faster than ODE. But last time I looked at ODE was last autumn.
#16
04/26/2004 (9:19 am)
I'm not sure if I understand what you are trying to do to the corpse. Corpses can respond to impulses.

I can't help but chuckle at that. Severely out of context, but still...

My main problem with Novocode and Tokamak is that they aren't cross-platform friendly (well, Novodex seems to be since they have a Linux license, but I can't afford the $$$ for it).

Luckily my top-down/rail shooter doesn't need advanced physics. But it would be cool. But not cool enough to go through the misery of incorporating ODE for a brief "ooh" and "ahh" between blasting enemies.
#17
08/13/2004 (12:59 pm)
Just an update: Novodex just released their physics engine SDK free to the public. Free for con-commercial use, and their latest development is Rocket, which is described as a physics scripting language, which might make integrating their engine much more simple?

http://www.novodex.com/downloads.html
#18
08/16/2004 (6:34 am)
A few comments:

Tokamak is Windows-only (as is Novodex - I think). Remember that GarageGames only publishes games that compile on both Windows and OS X, so if that's your aim you're better off with ODE.

Novodex Rocket is a generic scripting language specification for physics engines - it has plugins for ODE as well as a number of others.

[EDIT]
Sorry - got that a bit wrong. PSCL (Physics SCripting Language) is the physics-engine-independent language developed by Novodex and used in Rocket, which is a test suite that uses Novodex Physics and allows you to test and prototype your physics routines without having to write test applications yourself.

Also, Novodex Physics is cross-platform and is free for non-commercial use only
[/EDIT]


The new iterative "QuickStep" solver in ODE closes the speed difference between Tokamak and ODE (Tokamak is still faster in a lot of cases, but not by much).
#19
08/16/2004 (7:05 am)
Yeah thats why were not using tokomak even though our engine already supports it through a wrapper. We want to get our game out cross platform so we have our own physics. I think ODE is the only real alternative for someone wanting to develop a game across several platforms.

Quite a few people have been using tok and allthough its pretty good, it does seem to have friction issues that make it hard to produce good vehicle physics, nice for general stuff though.