Fluid in farseer

Aug 27, 2011 at 4:06 PM

Hi there, 


I red on the forum that fluid were going to be implemented in the version of farseer 3.3 but I can't see it the sample so I was wondering if the feature was already available. Cheers

Aug 27, 2011 at 7:01 PM

no it will be implemented at 3.4 (also waiting for it...)

Aug 28, 2011 at 7:21 AM

Any idea when it will be available. If it's like six months maybe I would implement it myself. It won't be great(I'm not goo with math) but I don't need too realistic behavior. 

Aug 28, 2011 at 9:27 AM

i dont know how long it will take but if you do it yourself it will be very hard. you need a custom grid/quadtree for optimizing, custom collision with fixures, fluid behaviors (its not enought to silmple loop trought n² and apply a force)

Aug 28, 2011 at 11:31 AM

this is not the only way to do it. You can use SAP to check collision and use a SPH algorithm for fluid behavior. Not really sure how to implement it yet but I know someone did on box2d and shared his code. also I was planning maybe in using global repulsion forces base en densityto help with the code. But as I mention fluid behaviors don't have to be exact or realistic. I just need good performance and something believable. Maybe you've been through this too I don't know. But I can't really afford to wait for a feature to be implemented if I may have a chance to something indeed less slick but still working for my purpose. 

But thanks anyway

Aug 31, 2011 at 2:35 AM

It really depends on what kind of fluid behavior you're looking for.

If you're looking for something like the fluid in Feed Me Oil, then yeah, some complex SPH is the way to go. There's a rough implementation done up in jBox2d, see demo at: http://www.jbox2d.org/liquid/

If looking for buoyancy, Farseer does have a buoyancy controller that's a port from box2d. It's a shame really, farseer did have something better with waves in v2.1.3 at http://www.farseergames.com/waterdemo

I would be very curious what kind of fluid will be coming out in 3.4 because I'm trying to add fluid in a project as well. I've resorted to reviving the 2.1.3 water code into 3.3 :/

Aug 31, 2011 at 8:17 PM

I had already ported the Wave code from 2.1.3, but never had time to polish it up so it never got added into the engine. It's really not to hard to get working with rendering proving to be the biggest problem (and it's not much of one).

Aug 31, 2011 at 10:06 PM

Polished or not, I would love to get a copy of what you have so far with the 2.1.3 water code revival. I've been struggling with that because I'm working with MonoTouch and the MonoGame port of XNA, so not only am I trying to integrate the 2.1.3 stuff, but update with XNA changes as well. It's proven to be quite the challenge to do both because I'm not very familiar with either.

Sep 1, 2011 at 12:24 AM

I'll see if I can find it this weekend. If I can't find it maybe I'll see about doing a quick example.

Sep 1, 2011 at 9:47 PM
Edited Sep 2, 2011 at 12:52 AM

Thanks Matt, you're a life saver!

Oct 15, 2011 at 8:07 AM

any progress?

Oct 15, 2011 at 7:42 PM

I haven't had any time lately. I couldn't find my previous port so a new one will have to be done from scratch.

Nov 1, 2011 at 9:57 PM

That is soo cool: http://www.jbox2d.org/liquid/

Anyone got access to the source or similar? I'm working on a experimental project where that would be excellent!


Nov 2, 2011 at 12:08 AM

Pretty sure this is what Genbox is working on for the next release!

Remember rendering is going to be up to you, so study up on surface generation!

Nov 2, 2011 at 1:54 AM

That is correct. I have a fluid implementation that I'm going to implement into the next version of FPE. It is long overdue, so it is my first priority when I have finished the upgrade to the newest Box2D.

Apr 22, 2012 at 10:41 AM

Hey, sorry to bump this old thread, but @Genbox: Are there any updates or ETA on this yet?