cross platform physics

BlitzMax Forums/BlitzMax Programming/cross platform physics

Robert Cummings(Posted 2005) [#1]
Please post your recommendations for commerically-free (not necessarily open source) physics engines that are ideal for 2D gaming using BlitzMax.

Once enough suggestions and arguments have been proposed, we'll start up a new community project for it like what we did with SDL and FMOD.

Thank you.


Robert Cummings(Posted 2005) [#2]
Currently there are three in the running and these are: ODE, Newton and DynaMo.

ODE and Newton are perhaps overkill, and DynaMo has been used in the excellent BreakQuest (www.retro64.com)

All are cross platform but I suspect DynaMo might well be the easiest to impliment but this is what this thread is about: discuss the strengths and weaknesses and find a perfect-fit for BlitzMax 2D (which is also cross platform).


gman(Posted 2005) [#3]
ive done research on both ODE and Newton and both seem really capable and both can be used either in a simple or complex way. ive never heard of DynaMo until now. while looking into it i noticed its licensing was GPL which essentially means anything linking it in must be opensource. just something to keep in mind.


Shagwana(Posted 2005) [#4]
Is Tokamak not an option?. I am not clear if its cross platform tho.

An intresting quote from there website...

We are pleased to announce the release of a new license agreement for the Tokamak Game Physics SDK. You can now use Tokamak for Commercial and Non-commercial purposes FREE!



Matt McFarland(Posted 2005) [#5]
I was looking at these different sites and they all showcase greatness, but none of them mention BlitzMax. So how would any of these be used in a BlitzMax Program?


teamonkey(Posted 2005) [#6]
DynaMo doesn't seem to have collision detection built in. Also the GPL is evil if you ever want to sell your program - the Newton and ODE licences are both more "free" than the GPL or LGPL.

I've not used Newton for a while. It used to be slower than a slow thing but it looks like it's shaping up nicely now.

@Matt - you can link in C libraries easily enough.


Mindfield(Posted 2005) [#7]
ODE is a bit difficult to use according to Over the Edge Entertainment, who created the Super Monkey Ball-clone called Gooball. Of course the physics engine they currently use is nothing else than Ageia's NovodeX.


Robert Cummings(Posted 2005) [#8]
Thanks lads that narrows it down considerably.

The two physics engines in the running are now ODE and Newton. Please keep your comments rolling in.

ODE is pretty easy to use. We would not be wanting to use trimesh class (where most problems arise).

We will only really be interested in making objects out of primitives and then using these shapes to perform our physics. For example the world would be made up of many cubes and cylinders (spheres would be fairly pointless unless you could constrain them to 2D.


Will(Posted 2005) [#9]
I don't follow you - surely it will be circles and not spheres, squares and not cubes? This is 2D physics - is it worth porting 3D physics when we cant really display it? Additionally, if it is 3D, why would spheres be pointless?

Sorry if these are dumb questions.


Shagwana(Posted 2005) [#10]
I think he ment the 2d equivalant of the 3d objects :P

Dont forget triangles too! - I presume that should be possible!


Gabriel(Posted 2005) [#11]
and DynaMo has been used in the excellent BreakQuest (www.retro64.com)


I disagree with TeaMonkey's comments about commercial use of Dynamo, because - as you've pointed out - it's been done with a very successful game. He's right that you still need a good collision detection library though. Dynamo is collision response only. It's apparently a very short piece of code and very easy to use though.

And it's www.nurium.com not Retro64.


teamonkey(Posted 2005) [#12]
I disagree with TeaMonkey's comments about commercial use of Dynamo, because - as you've pointed out - it's been done with a very successful game.

Just because it's suitable for one game to use it, it doesn't mean it's suitable for any game to use it. In the case of BlitzMax you'll need to create a wrapper of some sort to use the library and there are associated licencing issues with that.

I've just downloaded the demo for Breakquest and after a cursory glance it looks like it's in breach of the LGPL - no copy of the LGPL licence, no source code or linkable object library in the distribution?

Also, DynaMo's written in C++. Best to stick with a plain C library if possible for ease of integration.

But Will's right. If it's just for 2D physics there's no point using a 3D engine as a 3D engine will be far more complex than a 2D one. The internals of a 2D physics engine will be completely different to those of a 3D one.


Robert Cummings(Posted 2005) [#13]
I've just downloaded the demo for Breakquest and after a cursory glance it looks like it's in breach of the LGPL - no copy of the LGPL licence, no source code or linkable object library in the distribution?
Hmmm... I do know he's contributed fixes to the codebase for DynaMo and he knows the author.

In any case... with LGPL, you can distribute without making your changes available:

The LGPL is designed to "permit developers of non-free programs to use free libraries" (quote from the LGPL)



Gabriel(Posted 2005) [#14]
Just because it's suitable for one game to use it, it doesn't mean it's suitable for any game to use it. In the case of BlitzMax you'll need to create a wrapper of some sort to use the library and there are associated licencing issues with that.

I don't see why. There are wrapper-mods for commercial libraries, and they manage to avoid contravening any licenses.

I've just downloaded the demo for Breakquest and after a cursory glance it looks like it's in breach of the LGPL - no copy of the LGPL licence, no source code or linkable object library in the distribution?


Perhaps that indicates that the author(s) of Dynamo are even more flexible than it first appears. Perhaps they're prepared to negotiate licenses with different terms, or even give them away, if they get a free plug or whatever. It had a copy of the LGLP license when I downloaded it a few months ago though.


Vectrex(Posted 2005) [#15]
well I've just started using Newton through Ogre3d (ogreNewt wrapper) and it's very nice and easy too. Keep in mind I've never really used ODE.
Anyway it's a C lib so wrapping is easy, built in coldet, fast convex hull collision for dynamic object which automatically builds the hull given an object, per poly materials, custom joints (for 2d contraints), bounancy, working trimesh... other stuff.

As for 2d you really still have to give the physics engine 3d primitives because it can't detect against an infinitely thin plane on it's side, but it IS slower using 3d in 2d but really it's fast enough not to care (plus are there any 2d only physics engines?). Plus when the 3d engine arrives you could reuse it without much hassle.

here's a few forum topics
http://newtondynamics.com/forum/viewtopic.php?t=1821
http://newtondynamics.com/forum/viewtopic.php?t=860 (OLD)

I also found something called AmazonPhysics for just 2d stuff (unfinished but opensource)
http://www.freedevs.net/forums/viewtopic.php?p=1734&sid=7bcc0987b93668548e69edc8d215925f


Vectrex(Posted 2005) [#16]
oh! I almost forgot this great 2d softbody physics engine! I'd love to see this blitzed up :)
http://www.cis.cornell.edu/boom/2005/ProjectArchive/physical/


teamonkey(Posted 2005) [#17]
There are wrapper-mods for commercial libraries, and they manage to avoid contravening any licenses.

Not in the official Blitz distribution there aren't. :)


IPete2(Posted 2005) [#18]
One Eyed,

I wonder if there is any use in suggesting that instead of using a commercially based one, we create a physics pack for BMax, doing it all in code - in BMax - then it will be truly cross platform.

There are a couple of good books on the market which are for other languages but could be generally readable and the maths can be applied here. I also think that the talent is already here to create such a mod or code library.

IPete2.


Matt McFarland(Posted 2005) [#19]
So let me get this straight.

Someone (or a group of someones) creates an SDK in C++ (usually) that is also called a "library"

The library is filled with commands that people can use if they include the SDK into their programs.

The commands make physics easy, so people can focus more on game development rather then hair-pulling math?

Is this what it's all about?

Also, whats with everyone saying that BMax can use these C++ Libraries? Because if they can why is it that you guys are talking about making a "Bmax wrapper?"


Dreamora(Posted 2005) [#20]
Because you can't use C++ objects in BM


Robert Cummings(Posted 2005) [#21]
IPete2,

There's rumours that Mark is sort of doing some physics for Blitzmax's 3D module. As for 2D and doing it ourselves, I agree that for 2D, it's preferable :)

I would probably interested in looking at Torque2D's way - you can make a list of points and the vector is used to collide with stuff. Has to be convex though or something. Whats good is thay don't bother with different types like rects or ovals - everything is vector, and that is simple/clever.

The physics are also pretty cool with mass, friction and the ability to attach one physical object to another, then rotate it (wheels) and also apply a certain amount of "damping" so it acts springy.


taxlerendiosk(Posted 2005) [#22]
There's rumours that Mark is sort of doing some physics for Blitzmax's 3D module.

I recall Mark saying "pub.ode will be available soon" at one point. Since he's said all along the 3D module will take quite some time, I expect ODE is going to be a separate module.


Matt McFarland(Posted 2005) [#23]
So no 2D physics?


gman(Posted 2005) [#24]
just an FYI, thierry-myke made a Newton mod located:

Newton Mod

that Haramanai tried out with the Irrlicht mods.

http://www.blitzmax.com/Community/posts.php?topic=51140&hl=irrlicht%20newton


Matt McFarland(Posted 2005) [#25]
Doesnt look like its for 2D Games :(


gman(Posted 2005) [#26]
i just remembered a _really_ cool demo i downloaded. it seemed to be 2D physics related and is coded in BMAX by {cYanide}. you can find the thread here. you might drop him a line and see how its going.


Shagwana(Posted 2005) [#27]
I just found this thread while looking for something else, could be of intrest. I like what i see a lot!

http://www.blitzbasic.com/Community/posts.php?topic=44391