Hi everyone!
I’ve been working for the last couple of months on a game about growing bonsai. The scripts to generate and manipulate the trees have been steadily growing on parameters to play with; so I’m planning to build an editor extension out of them and eventually offer it on the asset store. Although I know there are plenty of options to build trees and nature elements out there I still want to make this mostly for the learning experience.
The extension aims at providing “tree factories” to spawn tree objects using randomized parameters, so that every product out of it looks unique and still the same kind of tree. The tree builder is based on Lindenmayer systems to generate the branch structure for the tree, then other functions modify it to make it look more naturally disperse (or not) and then a mesh is created around the structure. I’m looking for some references, posts, tutorials, documentation or best practices that might help me to come up with an intuitive and easy to use extension (I really need to make the custom editor better organized).
Anyway, here are some screenshots on some of the trees it can produce. These still don’t have leaves, there are some features I want to add on branches before moving to the leaves part.
Update [Feb 06, 2017]
The factory settings custom editor was cramming with options, so I worked on a modular pipeline to process the tree.
Pipelines could be created from nodes providing different options to model the trees, from creating the structure, to modify it to mesh it. For the next update I’m aiming at getting nodes to add leaves.
The node editor uses the wonderful Node Editor framework for Unity3D project!
Update [Jul 08, 2017]
All the parameters assigned to create the trees are contained in nodes. The tree creation process is based on Unity’s tree creator, but adding more customization to the pipeline. The nodes now create sprout groups to work as leafs or fruits and receive materials on them.
Update [Dec 13, 2017]
Wow! it’s been a year since I started working on this project. I’m actually pretty close to release it to the asset store (or at least I believe it is mature enough). Over the last months I’ve added many more options to the tree creation process (modularized of course) including a node hierarchy tree for structure and optimized modes to export the resulting trees as prefabs. I still have some heavy optimization to do using the editor profiler though.
Update [July 17th, 2018]
Ok, I’m almost ready to release the extension to the asset store. Lately I’ve been working on getting the trees to work with WindZones, tweaking and adding improvements here and there and of course looking for bugs to smash. The video shows how switching elements on the pipeline reflect on the preview tree (this tree can be then used to create a prefab out of it).
Another update, now testing low poly processing.
Update [July 24th, 2018]
Testing with Unity terrain tools and effect shaders.
Your feedback about the project will be very much appreciated.
Features on version 0.9:
- Two structure generators to select from (one similar to Unity’s Tree Creator and a Lindenmayer system based one).
- Sprout modes: plane, cross, tricross, planeX, billboard and mesh.
- Sprout groups: to set the mode, alignment, scale, mapping and wind properties on sprouts along the tree branches.
- Modifiers for length, girth, branch sparse, twirl and bend points.
- WindZone component support.
- LODs (optional with two levels).
- Prefab creation with texture atlas creation.
- Controls for texture areas, mapping options and custom materials on branches and sprouts.
- Persistence system (save, load, share) your tree pipeline.
- Catalog with pre-made tree pipelines (so you get trees ready out of the box and pipelines to work with).
- Global scaling for the final tree (to adapt to your game proportions).
- Documentation and source code with comments.