Sunday, July 02, 2006

Hehe, went on a bit of a gui bender and set it up to remember (via a hashtable) which output geometry came from which input waterfalls - it means you can click on a wall and have it say what made it. Should be really useful for detailed debugging.

Next up was fixing the problem of Random. The whole program used one Random object, so that all results would be repeatable. However it turns out that it needs each frozen/instanced waterfall to have its own random source, that is used to generate random sources for all the children. This makes parts of the tree also reproducable.

The next trick I wanted to get it to do was generate just one part of the tree (say a particular style of window) over and over again so that you can get an idea what it looks like. This means finding the input values to a instanced waterfall, then re-running it with different Random objects. To save the random object it was initally given I used this old trick to serialize the Random object as it isn't cloneable. The whole tree is then searched using brute-force to locate the first instance of the specified waterfall. It then stores the input parameters and attempts to bail out. The the input sheet it moved to the origin and the input state of the instanced waterfall is run over and over again to give an impression of what the output will look like...

No comments:

Post a Comment