SPH fluid sim

Community Forums/Showcase/SPH fluid sim

Nate the Great(Posted 2009) [#1]
ok so here is a fluid simulation I wrote in bmax using my engine verlet max. It now has viscosity, repulsion, surface tension, and much less compressibility.

edit3: the most recent gameplay vid: http://www.youtube.com/watch?v=aZlXQSHeZgk
edit2: the not most recent vid http://www.youtube.com/watch?v=FlTiWG37qlU
youtube vid with an actual level: http://www.youtube.com/watch?v=DqClczjwduk
Youtube: http://www.youtube.com/watch?v=bgW2hlAj1oI

Download: http://naillproductions.synthasite.com/resources/Flood.zip

enjoy

edit: i borrowed kotsofts particles from polluted planet beta 1 as placeholders and forgot about them before I posted... oops


RifRaf(Posted 2009) [#2]
Very nice. Things like this make me wish I had a mind for math.


Sauer(Posted 2009) [#3]
This looks better and better with each demo, keep up the good work.


GIB3D(Posted 2009) [#4]
How about an FPS game using guns that spray stuff instead of the usual bullets?


Nate the Great(Posted 2009) [#5]
well its bmax so it cant be first person lol but yeah maybe in b3d... and a 2d shooter with fluids might be a good idea too


GIB3D(Posted 2009) [#6]
Oh yea I did mean 2D sidescrolling shooter, I just thought "FPS" at first.


Nate the Great(Posted 2009) [#7]
but a 3d fps with fluid physics would be cool too

edit: emailed u gia


Ked(Posted 2009) [#8]
well its bmax so it cant be first person lol but yeah maybe in b3d...

MiniB3D?


GIB3D(Posted 2009) [#9]
emailed you back ;)

I'm just playin around with your simulator and thought of another idea which could be combined with the 2D shooter idea. There could be like a pool of water inside the level and you could summon it up with the attractor and use it as a weapon, either flinging it or repelling it at something. Now THAT sounds awesome!

My cursor is close to where the little ball of water is inside the big ball of oil but the screenshot didnt screenshot it.



Nate the Great(Posted 2009) [#10]
yeah that sounds cool.... im still thinking about gameplay concepts but everything you suggest seems to be one step ahead of what I was thinking. anyways nice idea GIA


GIB3D(Posted 2009) [#11]
I got the idea from this show
http://en.wikipedia.org/wiki/Avatar:_The_Last_Airbender


Nate the Great(Posted 2009) [#12]
hey GIA, I emailed you from my new email but I think it might not have gotten through... can you check your spam folder?


InvisibleKid(Posted 2009) [#13]
hey just checked this out. its very neat, i noticed if you hold a mouse button down left or right to create a particle and move your mouse out of the window then the new particles go nuts at an accelorated rate for a little bit ( kinda funny ).


Nate the Great(Posted 2009) [#14]
haha I forgot to remove that bug... oh well.

for some reason if you keep the mousebutton held down, bmax can track your mouse outside the window, but if you let go of the mouse button it cant track the mouse outside the window... anyone know why this is?


Nate the Great(Posted 2009) [#15]
ok I updated this! there is now a level built and I have a youtube vid of it
http://www.youtube.com/watch?v=DqClczjwduk


Foppy(Posted 2009) [#16]
Looks very nice. Maybe another game idea: a little ship dancing on the waves, and something for the ship to do, I don't know what. ;) Or a 2d submarine game.


Jeppe Nielsen(Posted 2009) [#17]
Latest video looks nice and I did recognize the particle images from kotsoft :) This makes me want to try to implement liquids in my verlet physics engine aswell.


Nate the Great(Posted 2009) [#18]
Latest video looks nice and I did recognize the particle images from kotsoft :) This makes me want to try to implement liquids in my verlet physics engine aswell.



yeah its not that hard once you get the hang of it, it took me a couple maybe 5 tries to get it right. and I now have my own particles, which give the lava and water glowy blur effects and look much nicer (and more original)

edit: and I am releasing the source under MIT so feel free to use that if you want to, it will save you a lot of trouble.

Looks very nice. Maybe another game idea: a little ship dancing on the waves, and something for the ship to do, I don't know what. ;) Or a 2d submarine game.



yeah those are both good ideas but right now I have to finish this game before the competition is over :)


Nate the Great(Posted 2009) [#19]
heres the latest water/lava particles




Jerome Squalor(Posted 2009) [#20]
very nice.


Nate the Great(Posted 2009) [#21]
update: here is the most recent vid with the water,lava,and rock reacting

youtube vid with an actual level: http://www.youtube.com/watch?v=DqClczjwduk


Jeppe Nielsen(Posted 2009) [#22]
Looks much better now, since you cannot see the individual particles anymore.


Nate the Great(Posted 2009) [#23]
yeah... now I just gotta create the enemies


Jeppe Nielsen(Posted 2009) [#24]
Now I was inspired to create particles in my verlet code :-), so here is a video of it: http://www.youtube.com/watch?v=QNkA6KgkysE

Yeah enemies are always nice to have, perhaps they should be killed by drowning, hehe, or by burning up from the lava :)


Nate the Great(Posted 2009) [#25]
well the enemies are made of lava like this:



and they shoot like this... hes shooting at my mouse



and you kill them by drowning... but they dont die unless you kill all of them... there is usually some of them left to keep the eyes up :)


Sauer(Posted 2009) [#26]
Oh no watch out Nate, Jeppe's code was pretty cool :D

A little competition never hurt anyway. Great stuff guys.


Nate the Great(Posted 2009) [#27]
friendly competition is great. it keeps you on your toes and always adding features you wouldnt otherwise all to the benefit of the users :)


Snixx(Posted 2009) [#28]
If you struggle to think of an idea to go with the physics I wouldn't make it a game.


Nate the Great(Posted 2009) [#29]
If you struggle to think of an idea to go with the physics I wouldn't make it a game.



when did I say I struggled with an idea to go with the physics?


Jeppe Nielsen(Posted 2009) [#30]
Nice idea with the enemies. Yeah friendly competition is always good :), I wouldn't have implemented "sand" particles in my library if it havn't been for Nate.


Nate the Great(Posted 2009) [#31]
"sand" particles


well now all you have to do is make some soft collisions and you have yourself a fluid engine. feel free to check out the source for my game when its done


Nate the Great(Posted 2009) [#32]
ok heres a gameplay concept video

http://www.youtube.com/watch?v=aZlXQSHeZgk


InvisibleKid(Posted 2009) [#33]
that looks really cool. my fav part was "don't hit the lava like that...." :-)


Nate the Great(Posted 2009) [#34]
haha thanks king nothing I think its coming along at a really decent speed.


Gladclef - Ben B(Posted 2009) [#35]
Wow, Nate, that is amazing. You have skillz.

Now, another idea for a level in the game: make a curvy tunnel full of lava, but you can get through it if you just squirt water on the top of the lava, creating a layer of rock that you can touch without getting harmed.


_Skully(Posted 2009) [#36]
And then you better get through quick because the lava underneath will reheat it lol


Nate the Great(Posted 2009) [#37]
Wow, Nate, that is amazing. You have skillz.

Now, another idea for a level in the game: make a curvy tunnel full of lava, but you can get through it if you just squirt water on the top of the lava, creating a layer of rock that you can touch without getting harmed.


yeah with the new way the gameplay is designed, this wont work, but something similare will... ill let you figure it out in the next release :)


gosse(Posted 2009) [#38]
To those suggesting making a shooter that spray fluids instead of bullets, please check out PixelJunk Shooter ;)


Nate the Great(Posted 2009) [#39]
To those suggesting making a shooter that spray fluids instead of bullets, please check out PixelJunk Shooter ;)


you should have seen how many people suggested that on the other forum but they dont understand it just doesnt work as well as bullets.


Gladclef - Ben B(Posted 2009) [#40]
Very nice, but runs slow (same specs as _Skully). I dunno, it might be the physics or it might be the graphics slowing it down. If it's the graphics, maybe try drawing all of the walls as one static image (I don't know if you're doing this already). And, are you drawing all of the particles every frame, instead of just the ones within the viewing window or whose halos are visible within the viewing window?


Nate the Great(Posted 2009) [#41]
Very nice, but runs slow (same specs as _Skully). I dunno, it might be the physics or it might be the graphics slowing it down. If it's the graphics, maybe try drawing all of the walls as one static image (I don't know if you're doing this already). And, are you drawing all of the particles every frame, instead of just the ones within the viewing window or whose halos are visible within the viewing window?



I am only drawing the ones in view.... and in the next release the walls will be filled polygons so no worries there.