So what's the best Physics Lib for B3D these days?

Blitz3D Forums/Blitz3D Programming/So what's the best Physics Lib for B3D these days?

Chroma(Posted 2007) [#1]
What's everyone using? Newton, Tokamak, ODE? Pros, cons?

Since I'm tired of waiting on Max3D, I figure I'll just have to crank up B3D again and do the best I can.


_33(Posted 2007) [#2]
IMHO PhysX is currently the best thing there is. It's benchmarked and supposedly is the faster. It's possibly the one with the most features, from what I read from the PhysX site. You should go in the Userlib and check out the PhysX thread.

From what I read, Tokamak is overly complicated.

I've use Newton for a couple of months. You can do a LOT of stuff in newton, but it's a little clumsy sometimes when you have big scenes and lots of polygons to do collision tests with. I've had numerous problems with big models (50K tris) where some tris from the level wouldn't properly collide with the player model. But you can do seriously neat things with Newton.


Chroma(Posted 2007) [#3]
Anyone else have any input?

I wish someone had made a small 3d physics lib in B3D. Something for cars and the basic forces and rotation etc using blitz collision...


popcade(Posted 2007) [#4]
Verlet is somehow slow for pratical use, although I saw a decent example here but no source available.

For 3rd party thing, yes, PhysX is the best, if you want a mid quality, go JV-ODE or EasyTOK, a bit cheapr.


Stevie G(Posted 2007) [#5]

I wish someone had made a small 3d physics lib in B3D. Something for cars and the basic forces and rotation etc using blitz collision...



Verlet is definately not slow - I've had 50+ vehicles running solidly at 50fps and all done in blitz :

http://www.blitzbasic.com/Community/posts.php?topic=62881#703522

I may still release the source once my current project is finished. I guess that doesn't help much!

Stevie


Dirk Krause(Posted 2007) [#6]
@Stevie G - that would be great!


(tu) sinu(Posted 2007) [#7]
Im giving my vote to newton, i find it the best for my needs and i think Leadwerks also feels it's the best. He had many reasons for it, hopefully he can post here with them.


popcade(Posted 2007) [#8]
Well, the "decent example" is exactly Stevie G's post.... currently the BEST verlet usage I saw in the Blitz community.

I don't know if the source will be available finally, but the game is very good, I hope the game can be finished.

I saw a benchmark table in the plugins sections, if speed isn't the consideration, PhysX can do many plus things like cloth/force field without hardware.


Defoc8(Posted 2007) [#9]
well..from the testing i did a long while ago on my
800mhz machine - tokamak was way quicker.. things
may have changed..but im inclined to think that some of
these wrappers may have a part to play when it comes
to benchmarking - "easytok" implies a significant level
of abstraction...typically this results in less control, and
more calls.. though i could be very wrong.. ;) :p


Chroma(Posted 2007) [#10]
I would love to license StevieG's verlet source or use it if he makes it open source. Some really great things, in addition to what StevieG has already done, could be created with that verlet lib IMHO.


Vorderman(Posted 2007) [#11]
I personally like Tokamak - I can't say whether it's quicker or slower than the others, having only used ODE ages ago when I made that original wrapper, which was I suspect very slow compared to current systems, but Tokamak seems to me to be much more stable - I've never once managed to break the Tokamak simulation, but with ODE I managed it frequently. Again up-to-date ODE systems may well be much more stable.

Also, as I've said before (many times) Tokamak also has a really nice friction system that works well for car wheels, whereas ODE does not. I know people dispute this point but I've yet to see an ODE driving sim or demo that matches what I've managed easily(ish) in Tokamak in SRX.

Judging only from the demos Newton appears to suffer the same grip-spin problems as ODE when simulating a vehicle.

Stevie G's vertlet stuff is amazing, esp. with hundreds of little vehicles whizzing around.


Chroma(Posted 2007) [#12]
@Vorderman: In your opinion, what's the best Tokamak wrapper to use in Blitz3D these days?


Vorderman(Posted 2007) [#13]
From the headings in the B3D help section it's the "Tokamak command set by Bot Builder", and the decls file is just called Tokamak.decls.

I've been using it for a good few years, SRX uses it, and it has always worked perfectly with good low-level access where required.


Damien Sturdy(Posted 2007) [#14]
I like Toka, same system as vordermans using. I'ma gread ODE fan too, and JV-ODE is pretty awesome.

When using toka I was able to merge it with network code almost seamlessly. doing that with ODE was a little tougher.

Out of both ODE scores the best, but toka was so much easier and quicker to use, and at the time, more stable too- though I know ODE recently got a large stability/speed boost.


Chroma(Posted 2007) [#15]
Vorderman and Cygnus: Tokamak is up to version 1.0.3 now and it's open source. Is there a way to benefit from this and/or maybe we could write a new wrapper or something.

Also Vorderman: Could you post a quick and dirty demo using your Tokamak that has a few cubs falling and bouncing off each other/the ground?


Vorderman(Posted 2007) [#16]
I don't have any simple programs around but I do have this Ragdoll source code program that I posted ages ago - the .ZIP file you need is very nicely being hosted by Blitzsupport, link is at the bottom of the page.

http://blitzbasic.com/Community/posts.php?topic=47234#525147


Chroma(Posted 2007) [#17]
I'm actually having some great success with that source code Vorderman, thanks a bunch. I also had a hard time getting the ground to do collisions, probably because of my inexperience with Tokamak though.

It seems to me you just assign a collisionID to a rigidbody and then set the collisionresponse you want....but it's not quite working that way. :(

Press the Up Arrow to spawn a cube.

Here's the source:



Vorderman(Posted 2007) [#18]
I see your problem with the ground - try replacing the section in your code that creates the ground (the block under the heading ;TOKAMAK GROUND PLANE) with this:

;TOKAMAK GROUND PLANE
Global abground = TOKAB_Create()
geom = TOKAB_AddBox(abground,100.0,10.0,100.0)
TOKGEOM_SetMaterialIndex geom,1
TOKAB_SetPosition abground,0.0,-5.0,0.0
Global groundplane = CreatePlane()
PositionEntity groundplane,0,0,0


NOTE That I'm using TOKAB (animated body) rather than TOKRB (rigid body) for the ground, this is because animated bodies are fixed in place (they don't have a physical mass, just a collision geometry). If you create a normal rigid body ground it will just fall away into space same as the cubes.

Hope that helps.


Chroma(Posted 2007) [#19]
Thanks Vorderman. I really like Tokamak but it seems there's not many examples out there, and the BlitzCoder site is gone and I think there were a lot of examples on it.

I'm having a lot of problems getting a basic hinge joint to work. I messed around with it all night last night and had little success. I got the two boxes to link together but I can't get it to be a really tight hinge (like a door).