Page 1 of 4

Procedural generation based on land terrain texture grid

Posted: 24 Mar 2019, 01:10
by unelsson
It's great fun to have some sort of tool for procedurally generating Instances. This can be used to make forests, or for adding grass... or rocks.. whatever. It's still a WIP, and not ripe for a release, but fun nonetheless. All feedback is welcome.

https://github.com/unelsson/openmw/tree ... rencestool

https://imgur.com/a/Pqj2C03?

Re: Procedural generation based on land terrain texture grid

Posted: 24 Mar 2019, 01:28
by cc9cii
Can this be used as a replacement for SpeedTree?

Re: Procedural generation based on land terrain texture grid

Posted: 24 Mar 2019, 01:45
by unelsson
cc9cii wrote:
24 Mar 2019, 01:28
Can this be used as a replacement for SpeedTree?
SpeedTree? As in tree modeling software? Nope. This doesn't create or change models, just places them based on some variables.

Re: Procedural generation based on land terrain texture grid

Posted: 24 Mar 2019, 01:56
by AnyOldName3
One of the things SpeedTree can do is dynamically generate a forest based on a variety of input data, a little like this is doing here. It's not just tree modelling software. If you want to do anything with trees and computers, it's probably got a mode which does it. That's not to say that everything uses every mode, though - I *think* Oblivion just used it to generate tree models that didn't all look the same at runtime, for example.

Re: Procedural generation based on land terrain texture grid

Posted: 24 Mar 2019, 02:08
by silentthief
This looks awesome. I can see that being a very handy utility. Thanks for this.

ST

Re: Procedural generation based on land terrain texture grid

Posted: 24 Mar 2019, 03:50
by mistermoonshine
Could this be used to help out Tamriel Rebuilt? or maybe generate a bigger and more realistic Vvardenfell?

Re: Procedural generation based on land terrain texture grid

Posted: 28 Mar 2019, 00:04
by unelsson
To make this more useful, I added user options for random object displacement, rotation x/y, z-rotation, rotations towards slopes, z displacement, and made all the edits to fit into one undoStack macro. The UI is getting a bit cluttered, and it might be useful to have per-object settings instead of just global parameters. The amount of data one has to eventually input can also get overwhelming, perhaps it would also be a good idea to have a save/load feature for all that generation data.

Especially the object rotation based on land shape was a tricky one, I even had to stick my finger into Quat mathematics. Even if most of the Quat stuff is handled by osg, and many crucial formulas were taken from other places of OpenMW, I'm not 1000% percent sure I got it all right, so getting feedback from testing would be nice.

Would be interesting to try to generate wider areas with this, so hopefully modders can take advantage of this.

Re: Procedural generation based on land terrain texture grid

Posted: 28 Mar 2019, 00:07
by wareya
Should probably have some kind of resource file that determines how/where/in what way the "detail objects" spawn, so you can configure them individually.

Re: Procedural generation based on land terrain texture grid

Posted: 29 Mar 2019, 11:26
by unelsson
wareya wrote:
28 Mar 2019, 00:07
Should probably have some kind of resource file that determines how/where/in what way the "detail objects" spawn, so you can configure them individually.
I added now this feature, so all details can be saved and loaded from a file. Saving is still fixed to a file called procgendata.txt, but loading can be done from any file.

edit: Some screenshots https://imgur.com/a/7pxBaBC

Re: Procedural generation based on land terrain texture grid

Posted: 29 Mar 2019, 13:07
by unelsson
Okay, it's been really fun to play with this and try things out... Few further development ideas came to mind though:
- XY-rotation and objects leaning towards slopes, natural objects should probably rotate from the base instead of object center. I wonder if in some cases current behavior is wanted, so maybe this also should be a configurable option.
- There probably should be an option for spawning ingredient objects exactly on the same place as the "mother object". One could make an object for apple tree, and then also have apples spawning as a separate object on all of the object ids.