Jump to content
  • Advertisement
Sign in to follow this  
FRex

Fluid Simulation Like In Creeper World 1 And 3

This topic is 775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm looking into 'unusual' tower defense games and creeper world 1 and 3 stand as such.

They are strategy/tower defense where you fight a very tar like fluid.

Here's the game's page (gameplay video included in trailer): http://knucklecracker.com/creeperworld3/cw3.php

I'm looking into tips on how to implement that kind of fluid.

I was thinking of a 2D grid of which I have two copies and do sort of back and forth (double buffering) between them, spreading the fluid according to some rule (each tile = average of all neighbours). I whipped a prototype up in few minutes and it's so-so.

But I'm still looking for tips or resources on how to implement that well, in particular:

  • data structure and the algorithm itself
  • two hostile to each other fluids (there is a mechanic where you can create your own fluid that kills the enemy fluid but otherwise acts the same)
  • tar-like physics, not water-like, but most preferably behaviour adjustable by few (many) parameters to the simulation
  • ability to arbitrarily modify/add/remove fluid and for the rest to adapt to that, move into unoccupied place, etc.

Share this post


Link to post
Share on other sites
Advertisement
There's basically two parts:
1. Figure out the edge tiles.
2. Figure out how to grow the edge tiles.

For #1 you can just scan the whole grid every frame, and any creep that borders non-creep is an edge tile. For #2 there's a lot of options, but I'd do a percentage thing. Pick a percent based on the material viscosity. Every frame, grow X% of the edge tiles in some random direction, perhaps weighted on the number of adjacent edges. Counterfluid is just fluid that considers other fluid to be empty space (but possibly weighted differently). These kinds of things are always more about fiddling with stuff until you get something satisfactory.

You'll need a smarter algorithm for #1 on extremely large grids, but you'd be surprised how far it can go. With stuff like decreeping bombs, doing things densely like that will save you a lot of headache.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!