Simple fluid on dynamic terrain

I’ll repost this one more time, since I didn’t get an answer in the Scripting forums.

I have working voxel-based terrain (using marching cubes) generated procedurally, and I’m planning on adding dynamic fluids that will react to the terrain being modified. I certainly don’t expect to be able to achieve From Dust quality, but I know I can do better than Minecraft’s water (I already did a few experiments with that). I don’t expect a realistic feel, I just want something that is believable, fun to play with, and real-time.

I have very little experience with real-time fluids, though. Does anybody have any links/ideas/suggestions/algorithms on how best to do this? One thing I do know is that I’ll have to be able to only simulate the fluid when the terrain around it changes in order to calculate a new path, but will have to have a static river while it’s environment doesn’t change to significantly cut down on costs. I’m also planning on at least basic volume considerations. I’ve been fooling around with various ideas, but haven’t got anywhere so far. I’ll be using marching cubes to create the mesh; the problem is the simulation itself.

not sure how you’re storing data in each voxel, but you might consider storing how much water is contained in each one. Every so often, or at least when a voxel gets updated near water, merely check the surrounding voxels if there is empty space next to the water, if there is, for horizontally, try and ‘level out’ the amount of water in a flat-spaced area (so find all linked, horizontally neighboring voxels, probably should limit this to some value, and divide the amount of water in the current voxel by the number of cells. Similarly, you can also look ‘down’, but instead, if there’s an empty cell below your current voxel, just change the current voxel to air, and the one below it to water, or, for a more flowing effect, drain the value of the top one and fill up the one below it at some rate.

This is traditionally a very tricky area. There’s a Gamasutra article on making an approximation here:

I think you’re right not to want to go for a full out simulation, even if you can get your head around the maths the processing power needed would probably mean you can’t have anything else in your game.

All the best with this.