structured terrain generation code