Create water effect like WOG with ODE or Box2D
- Login to post comments
Wed, 04/06/2011 - 01:28
hi Everybody,
I want to create Water in my game. I know Physics Engin, ODE and Box2D. my game created with SDL in C++.
For create water, i found one solution: http://www.patrickmatte.com/stuff/physicsLiquid/
But it is very CPU-consuming so it's not good Idea.
WOG used a simple way but i don't know how can implement this water effect, see this picture that captured when a goo ball jump into water!!
http://www.freeimagehosting.net/uploads/91ead07a1f.jpg
really realistic!!
Can anyone help me to create a water like WOG in ODE or Box2D.
Hmm... the water simulation in World of Goo has puzzled me for a while, also. I think that, like you stated, it is actually far simpler than it looks, but I have no knowledge as to the technical setup as to how they did it. The readme.html lists all the open-source libraries they used, and I see nothing there that talks about their water setup. My best guess would be that they created their own water simulator, using some part of ODE or something, but I don't know for sure. I doubt anyone else here knows, either, as we are the goo fans, not goo developers. I would recommend trying to contact 2DBoy via their contact form. They may or may not respond, but it's worth a shot.
If you find out anything, let me know. I'm highly interested, too.
As far as interacting with the Goo Balls, the water simulator is incredibly simple, however. It's just a rectangular force field that has an upward force. But for the actual wave simulations, I have no idea (The splashes look fairly simple, just a few random water droplets flying upwards. It doesn't look like they depend on how forcefully a Goo Ball hits the water or how big the Goo Ball is).
IRC | Chapter Tutorial | Reference Guide
I try to contact 2DBoy via their contact form. it's worth a shot
I think splashes are random water droplets flying upward, too. ،The Question is about Waves!!
I have an idea: if we create a chain top of water like this:
--------------------------------------
then when a ball falling into the water, the chain will be changed like this:
(remove dots from your Image)
.............. /\........./\...........
..________/..\......./..\______
................. \...../..............
...................\O/...............
....................\/................
and for waves: if we tremble one-side of chain the problem will be solved:
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
It means the chain will be control water surface.
What do you think, it will be Worked?
Erm, maybe, but it would be slightly more complex, as the chain itself would have to be springy and elastic to make it spring back to level, rather than hanging down. Might be worth a shot, but I dunno.
IRC | Chapter Tutorial | Reference Guide
The splashes are a particle effect called "splash" in fx.xml.bin. They aren't affected size, force, water color, or anything else. The chain sounds good, but I'm not sure.
Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.
I test chain. It works for waves!! when density of chain is zero.
but collision between ball and water, it isn't similar to WOG!! all rings in chain go up and down.
Hi,
I Found it!!
Book: Special Effects Game Programming With DirectX
I implement it and it run very well.
psudocode is here (C++):
if you implement it in flash aware me, thanks.
Wow, cool! Thanks! That looks really simple, too.
I see... so this just uses some sine waves to simulate the water. Clever. Do you have a screenshot or video of what this looks like?
IRC | Chapter Tutorial | Reference Guide
That looks cool! Mind if I port it to JavaScript for a game I'm making? I'll give you credit.
Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.
Yeah, what AP said. ^^ Mind if I use this in my game?
IRC | Chapter Tutorial | Reference Guide
I see... so this just uses some sine waves to simulate the water. Clever. Do you have a screenshot or video of what this looks like?
I write a Demo with SDL, Box2D, C++. please, download it here:
http://www.4shared.com/file/GaiekC45/demo.html
It not completed , just a demo. collision in water must be correct,
I try to correct it any way.
note: after download demo run "bin\Exe\MGames.exe" so press start and drag some goo and release it above water, enjoy.
Regards
vahid b.
http://www.prikachi.com/images/879/3554879Y.png
I bugged the simulated water
That's really amazing. I have yet to find a purpose for simulated water in my games but that looks great! I know box2d uses particles rather than a good liquid simulation, but it's still do-able.
I tweet like a bird
I have a lame website
Finally, I upload last version of water in my Framework.
see this in youtube:
Bump.
After digging around a LOT to try to make my own WOG-esque water simulation for my game, I finally found something that works. The basic idea is slightly more simple than the pseudocode posted above. The best code that I found is here: http://www.box2d.org/forum/viewtopic.php?f=3&t=2746#p14093 based off of a "hello world" example from a presentation at siggraph 2007 (the PDF is here: http://www.double.co.nz/dust/GDC03.pdf )
There's a lot out there when it comes to water simulations, and very little of what I found was directly usable/actually worked. This, however, did. My implementation of it follows:
A Viscosity and Waterdamping of 0.95 gives a reasonably WOG-like water simulation for me (For a 32-pixel deep water pool), and I've toyed with different values for each. For me, viscosity=0.1 and waterdamping=0.999 gives epically slow water waves that are mezmerizing to watch. Of course, this will depend on how much force you add to the water from a collision. (I happen to add a lot)
All that's left is to alter the velocity of the part of the water that an object splashes into, add the splashy particle effect, and you're done. I'm very pleased.
IRC | Chapter Tutorial | Reference Guide
Congratulation, your code seems faster. can you add your simulation video to see how it work.
I see the paper that you share(pdf file). i think it has a CD. can you share the link of cd?
I don't have a CD link, sorry. All I found was the Box2D forum topic, then the PDF from there. And limited-bandwidth internet means I can't upload a video, I'm afraid. At least not for a month or so. I will when I get the chance. I think it's basically the same code as yours, just laid out slightly differently.
IRC | Chapter Tutorial | Reference Guide
I am hopeful to see your video in this month.
thanks.
if you want, i can share my source code with you (c++, Box2d), you can use it ever you want, Commercial or non-commercial.
mail me: v [dot] babaee [at] gmail [dot] com
careful!! spam can read that. put it as:
v.babaee (at) gmail (dot) com
-_-
v.babaee (at) gmail (dot) com
thanks.
Or write it vertically, super safe.
v
(dot)
b
a
b
a
e
e
(at)
g
m
a
i
l
(dot)
c
o
m
New GooFans Rules | My Addins
v
(dot)
b
a
b
a
e
e
(at)
g
m
a
i
l
(dot)
c
o
m
clever method!!thanks
Actually, I got it working how I like it. Thanks for the offer, though.
IRC | Chapter Tutorial | Reference Guide
And apologies for being so slow on getting around to it, but here's the video, in case you're still around and interested:
IRC | Chapter Tutorial | Reference Guide
useful, thanks.
Currently, I am working on 3d water simulation with Fast Fourier Transform!!
Sweet! Let me know how it turns out.
IRC | Chapter Tutorial | Reference Guide