|We have water!
||[Mar. 9th, 2008|07:42 pm]
Spectre Gruedorf Challenge Blog
Here's some pictures of my water system that I wrote for Perseus today. It's rule-based and operates on a per-tile basis; the two rules are basically 'move downwards if you can' and 'try to equalize the level of the water in any of your neighbours.' This is sort of similar to what I think Dwarf Fortress does, but it's not quite the same. Water also evaporates if it gets spread to thin to prevent numerical stability issues.|
The really cool thing is that Perseus already has deformable terrain. So you can deform the terrain - i.e. with a blast charge or just flinging hills around - and the water will flow correctly, blow up, or whatever. So it's all good.
Obviously this needs some better rendering - at the *very* least, shims between squares, and I think probably even more than that (reflections/refractions/blah blah blah) but there you go, it's good enough for gameplay.
2008-03-10 06:57 am (UTC)
Nice! This is how people should be Gruedorfing.
This gives me a good idea for a Gruedorf status display. All of the Gruedorfers, floating in a lake of awesomeness. Failing makes you lame, and lameness cannot float in awesomeness.
Falthorn's bloated and rotting corpse would be floating along the bottom. Everyone else would be either drowning or barely treading water.
It actually only took me about four hours too, from start to completion. I still have to figure out some way to correct the rendering on hills - I put in sills connecting water grid squares but that doesn't quite do it - and check to make sure there are no weird cases I'm not thinking of, though.