Procedural Generation Script for BGE?

Hi there,

Been using Blender many years now, and also have a solid knowledge of Python. I’ve never programmed in Blender before but want to so that I can create some procedural terrain.

Have any of you reading tried this before and be able give me pointers? Really all I need is code to use math of a Perlin noise function as a heightmap for a set distance from the player.

Much appreciated.

Blender has a whole Python Runtime Environment built-in. If you’re interested in learning Blender’s Python API, I would start with experimenting in the built-in Python Console. It’s similar to Python’s Idle Editor, but with the ability to access Blender’s Python modules. Some tutorials to get started:

Blender 2.5 Tutorial - Writing a Python Script that Creates a Simple 3D Model

modelling complex shapes with scripting in blender

Once you have a basic understanding of the Python interface, my second recommendation would be to spend a lot of time reading through the docs for the Blender Python API and sifting through existing addons. There’s already several terrain generating addons available (ANT landscapes, Suicidator, and a few others). Even if you want to do something different then what was done in those addons, it’s worth having a large collection of addons at your disposal if only for grepping to see how to use certain functions should the official Blender API docs fall short.