Thursday, 20 December 2007

Cave, River plus Farview mode rewritten

The Cave and River has been modified to work together with all the new stuff in Geography. They fit together now well.

While I was tinkering with the new height based tile calculation method it occurred to me that with this new code at last I can make the far view mode work much better than before! The cube kind of a given height is calculated based on the neighboring cubes' height relative to the current cube's height. The method calculates if a slope or a ground or some other kind of cube is needed. Slope if the cube is at a lower height than neighbors, normal ground if in equal height, etc. And here comes the trick! In farview parts only every 4th cube is rendered and the scale of it is multiplied by 4. Before using this method farview rendering resulted in ugly gaps between ground and lower positioned ground parts unconnected with a slope. BUT with height based cube kind calculation we can have gapless view if the neighbors in far view are determined to be 4th cube in the 8 used directions for cube kind calculation instead of the next cubes around. Thus big sized slopes will be always put between two different levels of ground. Finally farview is usable and much nicer than anytime before! :-) Okay, not the nicest I've ever seen, but gives some base potential to later sophistication.

1 comment:

Paul said...

Trying around with the farview on my gaming machine I could reach usable performance (with very high memory usage 600+ MB) with RENDER_DISTANCE_FARVIEW=300, which means around 150 cubes of view distance. I could see far away heaps of mountains a lot of walk away. Amazing for me! :-D But for a usable performance and optimal view distance I set it 30 - 60 - 120 (VIEW_DISTANCE, RENDER_DISTANCE, RENDER_DISTANCE_FARVIEW). We are nearing a new release! Maybe I will polish the world generation a big bit and then release the many changes onto the world!

Twitter