FLUID SIMULATOR!

Post your own tutorials, guides and demos.

Post » Thu Sep 18, 2008 9:32 pm

by fluid i mean any body of liquid/fine dust.

this is a simple example (CPU WHORE) that i whipped up after seeing a falling sand game on my friends ipod touch at school, i wanted to figure out how it was done so during my french class i thought up of this little beauty, although inefficient through constructs event engine it is by no means ineffectient. ive seen java games with tons of particles run really fast, and after research i saw theyre made my way. which is compare your bottom 5 neighbors and reacts based on which ones are open or closed (via an array)

the scans are performed bottom to top, so that everything falls at the same time

i see a possible extension using this in the future, its a really simple concept and it works pretty well 2 this one was thrown toghether.

http://www.mediafire.com/?sharekey=d3fa ... 4777b59d28
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Fri Sep 19, 2008 12:41 am

CPU Whore is right. I get around 10fps with only 2000 grains of sand. Which if you think about it isn't really all that much considering there are 102400 pixels in your 320x320 app alone.

I tried bogging it down to 1fps but I gave up around 6500 grains of sand (was about 3fps).
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Sep 19, 2008 1:11 am

as i said, its just a demo really, its an efficient method, just not well used through events.


http://enigmasand.com/pyro2.html


this shows the power of the method through java, or even better C++, and my events are a tad messy, i could only account for the grains outside of the main area, but i dint set that up.
if it can run through and ipod touch thats pretty fast compared to a "real" simulator, although it would be cool to see some GPU powered effects like in that nvidia demo
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Fri Sep 19, 2008 10:35 am

Cool demo.

BTW is there another way to edit the small sprite beside double clicking them. When objects are small enough it becomes hard to double click on them.
B
2
S
1
G
5
Posts: 79
Reputation: 1,558

Post » Sat Sep 20, 2008 11:25 am

That was pretty cool, mine started to drop below 60 FPS at around 2000 though.

Reminds me of Bloody Zombies
http://db.tigsource.com/games/bloody-zombies
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Sat Sep 20, 2008 11:40 am

Did ok on my laptop... got to 10fps once I hit 6500 or so grains of sand. My main PC doesn't flinch lol... at least, I got bored before it started to slow down... xD

Cool idea... kind of reminds me of "Powder" by Dan Ball... fun game is fun.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests