Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
world_generator [2014/02/22 16:59]
chris [Using Noise]
world_generator [2015/02/10 03:59] (current)
chris
Line 54: Line 54:
 ==== Using Noise ==== ==== Using Noise ====
 [[Plugin Base]] comes with a few built-in noise operators, including perlin, simplex, and cell.  You can read about them here: [[Noise generators]] [[Plugin Base]] comes with a few built-in noise operators, including perlin, simplex, and cell.  You can read about them here: [[Noise generators]]
 +
 ==== Advanced Noise Technique ==== ==== Advanced Noise Technique ====
 +TBD
 +
 +===== Optimizations =====
 +Clearly, the world generator is at the root of all game engineering,​ so it's important to be fast.  Keep in mind, that this ''​GetBlock''​ method will be called 28,311,552+ times just to render the world within your vision. So here are some tips:
 +  * Leave the method as soon as you know what you'll return (Don't store the value and return it at the end)
 +  * Try to eliminate 99% of the use cases first. ​ If you know that all blocks above 100 will be air, check that first and return Air before continuing to other logic.
 +  * Use a [[block cache]] if you can.  The BlockManager is optimized to be blazing fast, but a block cache will still out-perform calling into the manager.