HOME | DD

wonderwhy-ER — CavernGenerator 0.3

Published: 2009-08-30 13:51:17 +0000 UTC; Views: 1667; Favourites: 12; Downloads: 19
Redirect to original
Description Well it took me a LOT more time I wanted... After uploading 0.2 version yesterday I spend like 5 more hours and today even more testing few ideas on how to make water simulation that more or less pertains it's volume/speed/inertia without going trough each pair of colliding particles. So I had few ideas of how to do particle against particle collisions without checking particle pairs at all.

Never got to trying the idea as it was pretty weird but 48H competition is right place to test weird ideas don't you think? Well it turned out that it is almost impossible to make water stable and more or less pertaining volume without doing particle-particle collisions but here what I got... More or less fine right?

Well only problem that bugs me is that it leaks in some places but fixing it make water aether completely crazy or not that volumetric so I am stopping at this variant.

You can ply with some of the params and stuff. Now to making a game out of it
Related content
Comments: 23

J-Taurens [2009-12-02 22:32:16 +0000 UTC]

sitais tev baigi labi sanaacis ^^

👍: 0 ⏩: 1

wonderwhy-ER In reply to J-Taurens [2009-12-03 07:17:59 +0000 UTC]

Paldies

👍: 0 ⏩: 0

Monation [2009-08-30 20:06:03 +0000 UTC]

You are a true genius my friend! This is light years ahead of anything else I've seen in flash particle physics. The only thing I do notice is each particle seems to transfer it's entire energy to any particle it hits. What I mean is they seem to be going uphill quite easily.
Anyway this is great. Have a break, you deserve it!

👍: 0 ⏩: 1

wonderwhy-ER In reply to Monation [2009-08-30 21:08:03 +0000 UTC]

I will soon... Seems I will not be able to finish a game out of it today for ludum dare even tough I am pretty close to it...

As for uphill yeah... But reason(at least I believe so) for them doing so is that they push each other... For some reason it work better when wall is close by... Tried a lot to make the them push as good even when wall is not close but failed... It just that such performance comes a big cost of how weird math is... I mean that particles don't directly know about each other lol So it is weird but still pretty good huh

👍: 0 ⏩: 0

Linsy96 [2009-08-30 17:45:56 +0000 UTC]

Cooool

👍: 0 ⏩: 1

wonderwhy-ER In reply to Linsy96 [2009-08-30 18:09:20 +0000 UTC]

Thanks Still need to make it in to a game

👍: 0 ⏩: 1

Linsy96 In reply to wonderwhy-ER [2009-08-31 02:10:28 +0000 UTC]

I agree

👍: 0 ⏩: 1

wonderwhy-ER In reply to Linsy96 [2009-08-31 08:23:32 +0000 UTC]

👍: 0 ⏩: 0

YoungLink19 [2009-08-30 15:56:42 +0000 UTC]

I can only say one thing on this: Sandboxing with this thing is fun. This one managed not to look laggy!

You should do more things like this and let people experiment around

👍: 0 ⏩: 1

wonderwhy-ER In reply to YoungLink19 [2009-08-30 17:15:43 +0000 UTC]

Well I plan to as tests for game making

👍: 0 ⏩: 0

Donitz [2009-08-30 15:39:32 +0000 UTC]

Jawesome. This is one of the most impressive things I've seen done in flash so far. This physics engine could work pretty nicely with some kind of landscape editor. Like with waterfalls, rivers, cliffs, backgrounds and such. I could imagen that it would be hard to make the water stable in the particle form, but if the particle effect was combined with a "stable" water effect, like for example lakes or water containers based on water rendered using a polygon fill effect, this could become one awesome game.

👍: 0 ⏩: 1

wonderwhy-ER In reply to Donitz [2009-08-30 17:19:34 +0000 UTC]

I tough about combining particles with fillers... It could work. I mean having waving volume based thing that on collision with particles aether absorbs them or spawns more when waves are too large or water level gone beyond maximal that landscape allows. Problem is tough that this thing is really at the border of what flash can on 2Ghz one core PC... Almost everything starts to be a bottle neck with 3K particles... Rendering of Flash starts to slow down... AS3 become too slow for such amount of calculations etc etc... Really seems as a border line for me here... Tough I still have some ideas for optimizations on AS3 side... As for rendering engine of Flash... It is at it's limit with 3K objects...

👍: 0 ⏩: 1

Donitz In reply to wonderwhy-ER [2009-08-30 17:34:04 +0000 UTC]

I'm just speculating here but wouldn't using the filler method be able to decrease the performence usage as fluid would pile up everywhere instead of remaining in the particle form. A regular landscape could like contain just a few rivers and many lakes so the particle count could be kept very low. I'm also curious how the particles are being rendered. Maybe you could lower the fluid resolution for a performence boost. Again, just speculating. I'm sure you have already considered all possibilites.

👍: 0 ⏩: 2

wonderwhy-ER In reply to Donitz [2009-08-30 18:09:07 +0000 UTC]

I lowered it already Plus it is drawn with fillRect which seems to be fastest routine. Tried draw with another bitmapData as source +- BlendMode and it slows it down in both cases. May be copyRect could work. Well anyways it is very close to the limit. Tough tested it at my home PC which is a lot more powerful then my notebook and it was not lagging even with 10K

👍: 0 ⏩: 0

Donitz In reply to Donitz [2009-08-30 17:37:40 +0000 UTC]

I mean INCREASE the performence.

👍: 0 ⏩: 1

Donitz In reply to Donitz [2009-08-30 17:42:29 +0000 UTC]

Oops, no I didn't.

👍: 0 ⏩: 0

theCheeseGrater [2009-08-30 14:20:45 +0000 UTC]

this is pretty epic
any chance of making the denser areas of water blue and the sparser areas white? like whitewater kinda effect? that would look amazing

👍: 0 ⏩: 1

wonderwhy-ER In reply to theCheeseGrater [2009-08-30 15:10:27 +0000 UTC]

Tried trough BlendingModes and it works. Not shore I will use it tough as it makes it lagg faster. So it depends on how much particles I will need for this thing in the end.

👍: 0 ⏩: 1

theCheeseGrater In reply to wonderwhy-ER [2009-08-31 04:12:54 +0000 UTC]

Fair enough i thought it might lag... It would be cool to see what you've got even if you don't use it Its pretty amazing how it doesn't lag as is.

👍: 0 ⏩: 1

wonderwhy-ER In reply to theCheeseGrater [2009-08-31 08:25:54 +0000 UTC]

On my old notebook it starts to lag at 1K particles which is not enough...

👍: 0 ⏩: 1

theCheeseGrater In reply to wonderwhy-ER [2009-09-01 08:59:08 +0000 UTC]

haha ok fair enough

👍: 0 ⏩: 0

Keydan [2009-08-30 14:10:54 +0000 UTC]

W00t! You made the changes!

👍: 0 ⏩: 1

wonderwhy-ER In reply to Keydan [2009-08-30 14:13:06 +0000 UTC]

Yes... Tough it took a hard tool on me... Tired now Still need to make a game out of it But having some 3K particles without serious lags in Flash is a big achievement

👍: 0 ⏩: 0