Re: Terraria Style Water.
Sims_Doc wrote:
for giving me the infomation need to kill any intressed in this topic.
You don't have to kill your interest, you just have to start thinking outside the box, and maybe put a little more effort into what you're posting
As a forum we did a lot of work trying to get water working but unless it's a static solution (read - no flow) we haven't found a way to get around the issue of slow script execution leading to horrible horrible lag.
Fluid simulation is a bad algorithm when executed in series as it has O(n^2) complexity in its simplest form (each water particle comparing itself to every other water particle). Threaded lua execution would fix that but we all know that isn't going to happen (especially as then you'd have to deal with it asynchronously - removing water particles could easily cause horrible crashes).
Long story short it's an interesting problem, and if you can find a way to logically cut down on the number of comparisons needed then you might be on the road to finding a solution but it's very likely to be very complicated
In fact, here's a potential cut to the massive lag problem - it essentially scales the lag by some arbitrary constant by locating water particles within a certain area. There's overhead because then each particle has to find their location in terms of the water array to put themselves into the right "slot", but that should cut down on the cost. I think Lord Tim was looking into using quadtrees for something like this but never did it - I think the paged solution is better because it allows control over the "resolution" of the solution - which lets the modder choose what they want in terms of accuracy.
The funny thing here is that more accuracy (-> larger boxes) means less tables, and less accuracy means more tables, so there's a point where having less accuracy actually means having more lag (or at least larger memory cost).
Anyway - here's the image:
Attachment:
File comment: Quick mockup with some scribbly terrain
Water.jpg [ 107.13 KiB | Viewed 1182 times ]
My aim isn't to kill creativity here, Sims_Doc - it's just that you need to know what you're doing before you can make realistic suggestions. You might want to start smaller (say, getting a good explosion emission system going, with a primary explosion, maybe some secondary clusters and debris with smoke trails) and put more effort into your thinking - making sure you've thought long and hard about whether what you're suggesting is plausible and maybe making some attempts at implementation yourself - rather than just typing whatever and hitting post. If you want to be creative, you have to put some work in