Hey guys, it’s been a fair while since I’ve last posted around here, it’s good to be back and messing around with blender
Anyway I’ve created the skeleton of a python based terrain generator, the main feature as of now is the ability to add planes infinitely around the player when they get close to the edge, basic I know but with that main feature done I can can add some extended functionality, mainly:
COMPLETED FUNCTIONALITY:
- Save and load terrain position from a file to allow for terrain that’s been generated to be saved (DONE)
- Select Vertices at random to place down structures i.e. grass/trees/rocks whilst utilizing the new lod system so the whole thing doesn’t get bogged down and run at 2 fps (DONE)
TO BE COMPLETED:
2. A second python script which modifies the vertices of added planes to make the terrain interesting (which will be the hardest part, I don’t really have any experience with geometry manipulation) (60% complete)
3. Texture terrain based on height(10% complete)
Blend files are below (wasd+mouselook)
(Base version, only features simple terrain gen around player)
v0.1a:[Newer Version Available]
(allows for saving/loading/deleting levels from a outside file)
v0.2a:[Newer Version Available]
(saving and loading is broken but basic structure generation works, script is rather messy and relies on properties a bit too much so I will aim the clean it up in the next version)
v0.3a:[Newer Version Available]
(Structure generation is completely done, all property based too so no messing around with scripts! to use it create your mesh i.e. ‘grass’ and place it in a layer seperate to your player and terrain mesh, give the terrain mesh a int property with the same name as your mesh and set the value to the chance of it spawning and done! AND make sure to use lod, because if you go for larger levels you will get massive amounts of lag)
v0.4a:[Newer Version Available]
(Terrain random height is working as well as terrain physics(albeit a bit buggy), still need to fix terrain edge issues)
v0.5a:InfiniteTerrainTest.blend (1.7 MB)
(Terrain random height is switched over to glsl (which I have never used before in my life woooh) based code, physics does not work, neither does random item placement, one glaring issue is that instanced meshes cannot have separate shaders/materials on them, so as soon as a new mesh is “generated” all the instances will change to look like the new one, I’m currently looking into if this is possible to fix)
v0.6a:[Newer Version Available]
(Fixed some issues witihin 0.6a, namely edges of terrain line up but generation is still pseudo-random so this isn’t much of an achievement, a fake AO was also added to the terrain to give it some depth, still working on physics and object placement)
v0.7a:InfiniteTerrainTest.blend (1.53 MB)
Desert Demo using v0.4a (cannot upload file as I don’t have the right to distribute these textures) but using the 0.4 system it is very simple to recreate
P.S
I have ~6 weeks before my final school exams start so I hope to be able to complete all / most of my intended features within that time as I won’t have any time during my testing period to work on this.