Algorithms For Falling Sands
It's implemented in Java but no source code is available. I've been thinking about the algorithms used. There seem to be a few thousand grains of sand, oil, etc that are either falling, moving over other particles (eg forming heaps) or being transformed- water turned green by plants, oil and plants being consumed by fire so probably only a few hundred pixels in motion at one time. It uses about 20-25% CPU of my three year old PC's processing power so is fairly intensive. I imagine there might be lists of static points and moving or transforming points but tracking and processing all these points is a clever bit of programming.
Looking around the web I discovered an open source C++ version by developer Owen Piette and that uses the wx Widgets. I'll see how he does it.
- Link to C++ Games Code library


No comments yet. Leave a Comment