Ship Physics: How would you tackle it?

Posted By: Rondidon

Ship Physics: How would you tackle it? - 01/21/12 09:53

Hello guys,

I`m facing the task of programming a driving physics system for small swimming ships (car ferrys). I`m not sure whether I should use PhysX for this or program it "from scratch" by myself.

How would you tackle this intend? Which advantages do you see in using PhysX for this? (collision system, swim physics, stability and bugs)

Thanks for sharing your thoughts. laugh


Posted By: Rondidon

Re: Ship Physics: How would you tackle it? - 01/21/12 20:17

No ideas?
Posted By: painkiller

Re: Ship Physics: How would you tackle it? - 01/21/12 20:31

probably using c_move and then adding inertia and "height waving" for the ship would do the trick
Posted By: Rondidon

Re: Ship Physics: How would you tackle it? - 01/21/12 20:39

Okay, that makes sense. But what is about collisions (especially with the riverside and while docking)?
Posted By: Superku

Re: Ship Physics: How would you tackle it? - 01/21/12 20:48

As c_move only supports OBB (and I probably wouldn't use physX in this situation), I suggest you write your own collision and movement system yourself. Because your ship only stays at sea level, you only have to perform 2D calculations.
Posted By: Rondidon

Re: Ship Physics: How would you tackle it? - 01/21/12 20:54

Quote:
and I probably wouldn't use physX in this situation

What is the biggest disadvantage of PhysX? The performance?
Posted By: rojart

Re: Ship Physics: How would you tackle it? - 01/21/12 21:09

Another possibility is to use car.c system with var tcar_hover = 1; FLAG1.
Do this and take a look on the knights_on_wheels.c sample, maybe it helps.
Posted By: gri

Re: Ship Physics: How would you tackle it? - 01/21/12 21:44

one of my sideprojects handles ship stuff too...

pirateship simulation...the reason why I purchased 3DGS 10 years ago.

But I spend to less brainticks for this project.

maybe you have a solution already for that. But are you intressted on a code moving your units with the ship?
Not only moving ahead .... rotating too and tilt and roll.
'gri
Posted By: HeelX

Re: Ship Physics: How would you tackle it? - 01/22/12 19:45

PhysX doesn't support ocean-physics. It supports particle fluids, but they are not designed for such big volumes of water. Thus, you can't use a native PhysX feature for that particular task. Though, NVidia is working on such a feature, which would be again for PhysX 3.x, which is not support by the current Gamestudio plugin - you would have to write a completely new one.

I was asked for this lately, too. My answer was since the premise was that Gamestudio is the engine for the project, to write a fishtank simulation (like this), based on heightfields and transfer the dynamics to a terrain. In Skyrim, Bethesda implemented a very basic version of that for pools of water to render a normalmap or something to simulate dynamic rings of water, which appear when the player walks through the pool. In that case they do just normalmapping, but for ocean physics you need a real deformed mesh in my oppinion, so, it is worth it.

Together with a scene description in 2D (like Superku proposed) and a description where ships are and what (oriented) shape they have, this could lead to a very nice water simulation (if multithreaded, it could be also not so CPU heavy as one might think, given that the user has multicore CPU which is nowadays standard).

Together with a cool water shader, you could achieve a very nice water simulation.

But this drives only the water simulation. The ship simulation can be done with force fields, which is in fact a PhysX feature, though, not enabled in the PhysX plugin. As far as I know, Slin works with PhysX forcefields for the very exact same problem and if you ask him, he might commit that to the repository of the open source PhysX plugin on SourceForge.
Posted By: Rondidon

Re: Ship Physics: How would you tackle it? - 01/23/12 10:18

Interesting! Thanks a lot for sharing your ideas (especially to HeelX)! That helped me a lot and I see somewhat clearer now.
Posted By: ventilator

Re: Ship Physics: How would you tackle it? - 01/23/12 19:36

newton had nice and easy buoyancy physics that would have worked well for ships but i don't know the current state of the newton gamestudio plugin.
© 2024 lite-C Forums