A downloadable game

Demo Video:


Goal:

Through this project, I aimed to expose myself to the world of procedural generation by developing a procedurally generated vine that adapts to its environment in real time and with user input. My goal was to make my vine's growth mimic real English Ivy growth patterns as closely as possible while also ensuring visual similarities as well.

The Process:

Determining Growth Factors

I began by researching English Ivy growth patterns and narrowing down its growth factors to determine which ones I wanted to emulate.

    - Gravitropism: Seeks upward movement

    - Phototropism: Growth towards sunny areas

Prototype in Houdini

I started by making a prototype in Houdini to familiarize myself with the procedural process and create a visual and functional reference.

Houdini → Unity (C#): Why Switch To Unity?

Using Houdini's node-based system where there are so many built in functions, I wanted to have a deeper understanding of proceduralism and therefore moved to recreate the prototype by programming it myself in Unity. After I was happy with my vine in Houdini both visually and functionally, I moved into Unity 3D to program the vine growth myself.

Step 1: The Vine's Path

I started by developing the set of rules or algorithm for the vine's growth, using a LineRenderer to visualize the vine's path. I gathered vertices that would be along the vine's path, which later would be used to smooth the curve and generate the geometry of the vine. These vertices are stored in a List<Vertex> vinePoints.

I used a weighted scoring system to determine the next point on the vine, taking into account the real life factors I chose to emulate (gravitropism and phototropism). I take in points nearby the tip of the vine and score them, the best candidate being chosen as the next point in the path.

Challenges: A challenge I faced here was how to determine the light intensity at each candidate point so I could use it in scoring. At first I was simply using the alignment of the growth direction (direction from the last point in the vine to the candidate point), but this would sometimes cause the vine to move underneath the mesh, which would technically be in the shade. I instead opted to use Lambert's Cosine Law to get the intensity of light at each vertex, which made the vine's growth much more natural.

Step 2: Smoothing the Curve
The vine was clearly very jagged at this point so my next step was to smooth the vinePoints using a spline. I have previously learned a lot about bezier curves and splines along with their related interpolation formulas, and I chose to use a Catmull-Rom spline for my project. I create a brand new List<Vertex> smoothedPoints after the process is done. These smoothed points are what I use to generate the geometry in the next step.

Step 3: Generating Geometry
Now that I had a smooth curve to work with, I moved on to generating the actual geometry for the vine in an effort to begin making it be more visually appealing and realistic. At this stage, I also applied a texture to the vine mesh to further the visual realism.

Challenges: A big challenge I faced at this stage was the vine mesh clipping through the environment mesh. I was taking the original smoothedPoint and offseting it in the surface normal direction by the radius of the mesh at that point on the curve. I had to add an additional factor to my multiplication of the point normal and the radius of the vine to make it sit better on the surface of the environment.

Step 4: Leaf Placement and Orientation
I next sources ivy leaf models and chose random vertices at which to add between 2-3 leaves at. I made sure to give the orientation of the leaves some randomness and variation to make them look more realistic.

Challenges: Orienting the leaves correctly honestly took a lot of trial and error and I was frequently tweaking my code throughout the process.

Once the leaves were in place, I now had a finished vine. The vine grows over time and adapts to its environment, with real time mesh generation that changes thickness as it grows. The vine now has leaves as well, which spawn randomly along the vine.

Step 5: User Input for Spawning

To make this project interactive, I then programmed a way for users to choose the spawn point of the vine. Users can add endless vines to the structures in the scene and see how they grow over time. I also made a camera movement script to allow the user to move around the scene to further inspect the vines that they grow.

Upon spawning the vines they can then change the sun positioning to see how their vines change with the sun.

Published 22 hours ago
StatusReleased
Authorkinnaraa
Tags3D, nature, Procedural Generation

Download

Download
Vines.zip 41 MB

Install instructions

Unzip the zip file and run the Vines.exe to play!

Leave a comment

Log in with itch.io to leave a comment.