DF General Discussion / Re: Future of the Fortress
« on: April 06, 2007, 04:22:00 pm »It is evident to me that you have an excellent understanding of geology, physics, math, and computer algorithms so I hope you'll take no offense if I offer a possible solution to the U-trap "problem". It is also clear to me that there is no local solution, but perhaps there is a cheap non-local solution. My suggestion depends entirely on the assumption that you have some data structure that represents a body of water and that each tile has some kind of tie to that structure. Since you said that no calculations take place unless there is some change, that suggested to me that this /might/ be the case.
If it is, then the structure representing this contigous set of water could have a variable representing the tile and elevation of the tile which is highest. Then any tile below the high point which has water with no where else to go (the tiles around it are all filled) could take a unit of water from the highest tile and put it in the tile above it. At this point, the new highest point of water would need to be evaluated. This, I suppose is potentially somewhat expensive (a keen use of data division and sorting could probably greatly lessen this).
While this method doesn't represent true physics, it would mostly appear to in most situations. My guess is that you've already considered and rejected this method or it simply wouldn't work with the way a body of water is stored in memory (pure tile based?), but I thought I'd throw it out. I loved watching the drainage movie. Keep up the good work, but please don't put it ahead of your health or sanity. The last thing we need is Toady going on a rampage and getting locked away by the sheriff.
-Charles