bepu physics and a space simulation

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Hypnotron
Posts: 2
Joined: Fri Mar 20, 2009 9:22 am

bepu physics and a space simulation

Post by Hypnotron »

Hello,

I'm working on a c# + directX game using the Truevision 3d engine for rendering. In short, I'm not using XNA. I just came across this website during my googling for continuous collision detection because I need such collision for a space sim that will have very fast moving objects as well as large scale objects (planets, asteroids, moons) and small objects like missiles that require continuous collision detection.

I don't really need orbital physics since my gravitation model will be simplified. I'm mostly just interested in accurate and hopefully fast collision detection. I already have my game world broken up into zones so that each star system is in it's own coordinate system.

Will bepu physics be a good fit for what i'm doing? What appeals to me about bepu physics is that it's .NET and hopefully easier for me to use than something like Bullet where the .NET wrapper hasnt been updated in nearly 2 years. Incidentally, TV3D has integrated Newton Physics library but that doesnt (yet?) have continuous collisions plus it's too tightly integrated for me to use it as I want. I really want an easy to use, fast, stable, accurate collision detection system (don't we all!!! lol)

Any help/advice would be appreciated.
Regards,
Mike
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: bepu physics and a space simulation

Post by Norbo »

It sounds like BEPUphysics would work for you, functionality-wise. I've already made a space shooter demo game using it (which I hope to release at some point as an example) with physical bullets/missiles, asteroids and collidable orbiting planets. The CCD methods available, especially linearContinuous, are very fast.

But, there are a few questions to keep in mind:

How large are the size ratios of your worlds? Are planets realistically scaled compared to player ships, or is a planet on the order of 100 units and a ship is 1 unit? As sizes increase, the collision detection system will become less and less accurate. If you don’t need stable resting contact against a planet, you can make these sizes pretty extreme (perhaps multiple thousands of units?), but at some point it will begin to fail.

Will objects tend to travel at very high velocity in groups? For example, would you have a very tightly bundled (almost touching) formation of spaceships all moving the same direction at some point? A sudden change in velocity of an entity in such a formation can ‘confuse’ the CCD a bit, causing what can look like a small teleport. I’m working on this issue, though.

Are you willing to include the XNA framework libraries? Currently, BEPUphysics cannot be used independently from XNA. I have a good chunk of the necessary math libraries already coded separately, but it is going to be a while before I can complete and integrate them to allow for XNA independence.
Hypnotron
Posts: 2
Joined: Fri Mar 20, 2009 9:22 am

Re: bepu physics and a space simulation

Post by Hypnotron »

I do have realistic scale planets and stars (although collision with stars is irrelevant since i'll have code that will just destroy a ship if you get to close). I overcome rendering issues related to floating point precision errors by using a floating origin. That is, everything is rendered relative to a camera that is placed at 0,0,0 during the render calls. But otherwise I use double precision vars for position within any given zone. If necessary I could make my zones smaller. I assume the confusion of the CCD you talked about is related to single precision issues?

Eventually my game will be commercial. Have you thought about how much a license will cost? Just a ballpark answer will suffice (e.g. less than $1000.00 USD w/ no royalties) and whether there is a source code licensing option.

I think what I will do next week when I have some days off is try out bepu physics in a single relatively small test zone and see if I can do some things that i have in mind such as a fastish moving carrier having a fighter fly through a docking bay "portal."

thanks,
Mike
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: bepu physics and a space simulation

Post by Norbo »

The confusion issue specifically is probably not helped by floating point problems, but I haven't yet been able to nail down a solid cause. I'm still working on it when I get the chance. I suppose the best way to know if you'll encounter problems is to try it out; I don't think I've attempted sizes quite as large as you are proposing, so it will be an interesting experiment.

I e-mailed the pricing/licensing information to the address listed by the forum for your account.
Post Reply