Hey so I want to make an underwater environment to try evolving AI that is able to navigate underwater
Example of this: http://www.youtube.com/watch?v=gfC3NCu4xLY&feature=related
But I can’t seem to find any setting or script that would change the physics from on land to under water. It wouldn’t be good enough to just turn gravity off, because the creature has to be able to move by pushing off the water around it. Is this possible in Unity?
Only if you custom coded it. To my knowledge, Unity’s physics engine (PhysX) doesn’t offer this so you’d have to create it yourself.
hmm ok thanks, maybe I’ll stick with land creatures
fluid physics can become rather complex. Already at “simple replica” its a matter of a speed*speed based friction and pressure aspects, if you want to do it really, then it becomes a highly coupled particle problem which is beyond any reasonable option given you want to do the evolving AI as AI not “chess computer”
You are in trouble. Fluid mechanic is very complex. Physics engine of Unity does not take care of the viscosity nor the pressure.
I am giving you an idea for a proxy model which could work.
As Dreamora said, this is fonction of surface i.e. square power. The best you could approximate is to put coefficient on the accelaration and speed in water vs in the air.
For falling object, it’s pretty simple, you put a high drag, “parachute effect”.
For simulating the pressure, you will need to attach 3 parameters to each objects which will be the internal pressure (IP), the collapse factor (CF) and the crush factor (CRF).
If (depth>IPCF, Start to get leakage or show a strange behaviour)
If(depth>IPCRF, destruction / death)
It is very very raw. I will need to work on this longer.
EDIT: The speed and accelaration of each object can be calculated depending on a a-priori hydrodynamic factor and a power factor. If I have other ideas I will post
It’s fine, frankly I’m not a very advanced programmer so I doubt I would be able to set this up. Thanks for the input though :]