2D Liquid Simulation Engine

New releases and general discussions.

Post » Tue Jan 11, 2011 12:42 pm

QuaziGNRLnose, tulamide and any others who have contributed.
Thank you for your efforts.
There are people out there (like me) who really appreciate this fluid simulation.

As you can see by the post count (as of now, 2) I'm new to this. But thanks to you guys (and some lost sleep reading tutorials and forum), I think I have all the major stuff to get my game running.

Now all that I need is just one tiny little matter of getting-decent-art-intead-of-placeholders-and-music-and-let's-not-forget-sound-fx-also-different-levels-probably-save-file-and-not-mandatory-but-i-really-really-wanted-a-level-editor-for-the-player and I'm done!
B
3
S
1
G
1
Posts: 15
Reputation: 655

Post » Tue Jan 11, 2011 1:24 pm

i can propably point you to the right direction if you would need music and maybe SFX.
As for graphics - depends what do you need.
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Tue Jan 11, 2011 6:01 pm

Quazi,

thanks for the tips. I pursued the same approach, trying to use a dummy physics object with ellipse collision and setting the blobs to the dummy's position. But I used an id-system and whatever went wrong (can't tell, because I can't find that test cap), the result was that after a few hundred sprites the physics refused to work correctly. Suddenly the framerate went down to under 10fps and objects fell through "solids", etc.

Didn't think of containers. After reading your post, I retried and the container trick works perfectly, as can be seen here:

(Left: custom, Right: ellipse)
Note: The only change is to spawn one dummy with ellipse collision check and one blob sprite, instead of just one blob sprite with custom collision check. Although having double as much sprites, I could double the max particles.

Now I finally have enough fluid to form my game idea to something playable. Yeah :)
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Jan 11, 2011 6:04 pm

[quote="tulamide":3mgyw8d7]Quazi,

thanks for the tips. I pursued the same approach, trying to use a dummy physics object with ellipse collision and setting the blobs to the dummy's position. But I used an id-system and whatever went wrong (can't tell, because I can't find that test cap), the result was that after a few hundred sprites the physics refused to work correctly. Suddenly the framerate went down to under 10fps and objects fell through "solids", etc.

Didn't think of containers. After reading your post, I retried and the container trick works perfectly, as can be seen here:

(Left: custom, Right: ellipse)
Note: The only change is to spawn one dummy with ellipse collision check and one blob sprite, instead of just one blob sprite with custom collision check. Although having double as much sprites, I could double the max particles.

Now I finally have enough fluid to form my game idea to something playable. Yeah :)[/quote:3mgyw8d7]

this looks mind blowing O_O
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Tue Jan 11, 2011 7:42 pm

irbis,
Thanks for the offer. I will first work out more stuff (still on my first week of this) and get me my first complete level working (it's not really complete, but it's playable). Then I'll worry about all that other stuff I said I "just needed". :)

tulamide,
I'm also working on a game that uses lots of water, but probably completely different. I can work with the fluid .cap that you graciously uploaded, and I made some changes to it (removed the darkening over time), but I'm still wet behind my ears (pardon the pun) to get that ellipse collision going on.
Can I get another .cap with more liquid stuff please?

Is it ok to ask for caps of liquids to strangers in your countries? In my country it is not illegal but it is impolite and a sign of alcoholic dependency. Ah well, I'll buy you a beer if you come to Portugal. This way it's not begging for booze. It's having a party! :)
B
3
S
1
G
1
Posts: 15
Reputation: 655

Post » Tue Jan 11, 2011 9:46 pm

:lol: foam
[url:4mw4qn6r]http://dl.dropbox.com/u/666516/foam.cap[/url:4mw4qn6r]
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue Jan 11, 2011 10:12 pm

[quote="newt":njjedub6]:lol: foam
[url:njjedub6]http://dl.dropbox.com/u/666516/foam.cap[/url:njjedub6][/quote:njjedub6]
Still don't know what I'm doing, but I hacked away (as in "with an axe") at your foam and I erased (with the eraser in the picture editor) and now it works on non-black layouts. I'll do some more experimenting and if I come up with anything good or interesting I'll upload it.
B
3
S
1
G
1
Posts: 15
Reputation: 655

Post » Tue Jan 11, 2011 10:39 pm

Awesome stuff!

Here's an idea:

Part of the reason particles are quicker than sprites is because they do not rotate after they are created. Could you make a new sprite/particles object that is optimized for fluid? I'm not sure how much of a difference optimizations to the sprites themselves would make (compared to if the physics was faster), but I do wonder. Also, does having two sprites = one water drop slow anything down at all compared to having only one object and still using ellipse? The faster the better :)
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Post » Tue Jan 11, 2011 10:42 pm

[quote="gmvasco":2idwndg1][quote="newt":2idwndg1]:lol: foam
[url:2idwndg1]http://dl.dropbox.com/u/666516/foam.cap[/url:2idwndg1][/quote:2idwndg1]
Still don't know what I'm doing, but I hacked away (as in "with an axe") at your foam and I erased (with the eraser in the picture editor) and now it works on non-black layouts. I'll do some more experimenting and if I come up with anything good or interesting I'll upload it.[/quote:2idwndg1]

To use a layout with a lighter background simply add a copy of the sprite that has the physics behavior, only without the behavior.
Then have it the same size as the sprite with the lighten only effect.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue Jan 11, 2011 11:08 pm

the slowdown is entirely a result of the physics being a bottleneck. even if you did get some small improvements from particle type sprites it would be pointless.
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

PreviousNext

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests