Level of Detail. Easy to use, property-settings, with instructions.

LevelOfDetail.blend (701 KB)
(new Version 1.1 with 2 bugfixes)

What it is

It is a level of detail script, which is extremely easy to use. It works by replacing the mesh of an object. You can have 4 levels of detail, and customize the settings by changing or adding properties. It even takes the camera lens value (zoom) and the number of objects in the scene into account (which can be deactivated if you want to.)

How to use it
The script can (but not must) be run in module mode. It needs only 1 Controller, 1 Sensor and 1 Actuator to work. To change the distance on which the next level of detail is loaded, just edit a property value. It’s as easy as it sounds.

Further information
The script is completely commented, providing coders who are new to python and the blender game engine the possibilty to understand some basic python operations. Furthermore, there is a complete and detailed instruction on how to set up the level of detail system, which should also be understood by beginners, and another more compact instruction for advanced users in order to get fast results.

The attached .blend-file contains an example using blender’s monkey Suzanne.

I used a script from a tutorial (which was very basic) to get the basic idea on how to implement this, so some property names might be the same. But the script and the instructions are written by myself, in about 2 days.