Jump to content


Photo

Best Way To Implement Flooding


  • Please log in to reply
12 replies to this topic

#1 Rolfero

Rolfero

    GMC Member

  • New Member
  • 144 posts

Posted 09 May 2010 - 08:47 PM

Hi guys, what do u think would be the best way to implement water flooding like this:
Posted Image

I guess some sort of physics thing would be needed for best results.
  • 0

#2 briantrlov

briantrlov

    GMC Member

  • GMC Member
  • 610 posts

Posted 09 May 2010 - 11:12 PM

Try giving much more information, water flooding in 3d, 2d, what type of game platform or top down, and like what?
  • 0

#3 codyyo2

codyyo2

    GMC Member

  • New Member
  • 568 posts

Posted 09 May 2010 - 11:57 PM

Platform obviously :)
  • 0

#4 briantrlov

briantrlov

    GMC Member

  • GMC Member
  • 610 posts

Posted 10 May 2010 - 12:36 AM

Well i don't know how you mean obviously as all he posted was how do you implement flood? but in a platform a particle effect would be the best way, although i don't know how to use built in particles fake particles are easy enough, add gravity and a water emitter with a ton of random set sprites would work i can make an example if you'd like?
  • 0

#5 Rolfero

Rolfero

    GMC Member

  • New Member
  • 144 posts

Posted 10 May 2010 - 01:54 PM

Cant you see the image that was in the original post? Hmm.
Yes, an example would be nice. If you would like to see the image, heres the link to the image: http://www.squidi.ne...y063-water2.png
^_^
  • 0

#6 Khelder

Khelder

    GMC Member

  • New Member
  • 2018 posts

Posted 10 May 2010 - 04:02 PM

I couldn't see the image until after I went to squidi.net, then came to this page again - probably a minor anti-image-hotlinking code, to prevent people stealing bandwidth.
The page the pic comes from
  • 0

#7 1800askgeek

1800askgeek

    GMC Member

  • New Member
  • 350 posts

Posted 10 May 2010 - 04:13 PM

This isn't a simple subject if you want to make the fluids at all realistic.

If you're persistent though, you can start by investigating how this guy made his simulation: http://www.youtube.c...h?v=0bL80G1HX9w There is source code in C# on his website, as I recall.

I don't think GM is particularly well suited to this problem though, since you need a lot of particles, and the rendering technique he used (metaballs) isn't likely to be easy to translate to GML. The best I can find in regards to metaballs is this blog post: http://www.messy-min...7/2d-metaballs/

Good luck.

Edited by 1800askgeek, 10 May 2010 - 04:15 PM.

  • 0

#8 Rolfero

Rolfero

    GMC Member

  • New Member
  • 144 posts

Posted 10 May 2010 - 04:52 PM

^ I think the way in the video would be the ABSOLUTE BEST possible result, but its not nearly necessary. Couldnt it be done easier if there was no fancy metaball stuff, and it just looked like in the picture? Thats all i want. Of course, if its easier some other (better) way, then so be it.
  • 0

#9 1800askgeek

1800askgeek

    GMC Member

  • New Member
  • 350 posts

Posted 10 May 2010 - 05:27 PM

If you want to skip the particle system entirely, you could fake fluids by triggering horizontal water level rises through timing, but you'd pretty much have to code the levels case by case to do that, and the results would not be in the spirit of Squidi's design; it would not be practical to do much dynamic manipulation of the water.

Edit: Actually, you might be able to take that and make it more dynamic by using a few particle objects to detect where to flow only, and doing rendering based on a simpler horizontal model. Not sure if the results would look good or not though.

Edit2: Probably the biggest challenge if you went that route is figuring out how to make U and O shaped spaces fill dynamically.

Edited by 1800askgeek, 10 May 2010 - 05:42 PM.

  • 0

#10 Rolfero

Rolfero

    GMC Member

  • New Member
  • 144 posts

Posted 10 May 2010 - 06:00 PM

Yeah, the problem is just that if you do that, you have to code every level case by case as you said. Im ok with coding levels case by case a tiny bit, such as special surfaces and such, but not every level everything like you stated.
  • 0

#11 1800askgeek

1800askgeek

    GMC Member

  • New Member
  • 350 posts

Posted 10 May 2010 - 06:05 PM

Well, if you can figure out a physics model that works for you, you could precalculate scenarios (akin to rendering a movie) regardless of how slow the model is, and then just play back the timing scenario.
  • 0

#12 Rolfero

Rolfero

    GMC Member

  • New Member
  • 144 posts

Posted 10 May 2010 - 06:09 PM

Well, then i wouldnt be able to do stuffs like rerouting water to other area by pipes and such, and making the water level rise/sink correctly if dropping items in flooded rooms or swimming in these rooms.
  • 0

#13 Rolfero

Rolfero

    GMC Member

  • New Member
  • 144 posts

Posted 12 May 2010 - 04:20 PM

Maybe if you stored a few properties of each horizontal surface, you could simulate it with help from that information? How would it then be done?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users