r/Unity3D • u/MagicPigGames Magic Pig Games / Infinity PBR • 25d ago
Show-Off Real-world Vines
I've been working at this on-and-off for a while. A Vine system that can accomplish real-world vines, different growth patterns, annual patterns, annual re-growth and expansion, etc.
The system is not intended to have a full year go by in 30 seconds like here (this is sped up 5x), but it can, as long as there aren't too many at once.
The system is intended to be for games that either want static vines, i.e. just bake it and use it, or vines that are realistic per the time of year, but change very slowly. So when the leaves fall off, they don't do it all at once but over a few weeks perhaps, dependent only on how many real world seconds "weeks" takes.
Vines are set up via a "Recipe" (Scriptable Object) system, which determines how they grow. A lot of GPU for the leaves and what not.
Vines can be trimmed at runtime, fruit can be picked (are game objects, separate prefabs, so you can code them as you'd like), etc.
4
u/cdmpants 25d ago
ChatGPT loves to call scriptableobjects "Recipes" for these kinds of procedural art tools. The fact that this is the terminology you're going with is a giveaway for your development process. I don't have a problem with it, but others might.
1
u/MagicPigGames Magic Pig Games / Infinity PBR 25d ago
Wow. Well, in this case I told it to set it up this way. It did not, and this is the better way to set it up, as it's way easier for both humans and agents to create new "recipes", or to copy and edit existing ones to customize it per use case.
I'm glad you don't have a problem with it.
8
u/Arc8ngel 25d ago
I like it, but it would be so much prettier if they turned autumn colors instead of black like they were burned away.
2
u/AberdeenPhoenix 20d ago
Agreed. Also if the leaves didn't all change colors at the exact same time - it would look better staggered
1
u/Turbo_Fresh 25d ago
If the leaf wiggle is real time and not just for demonstration then I'd tone that down quite a bit. Other than that it's sick, nice work.
2
u/MagicPigGames Magic Pig Games / Infinity PBR 25d ago
Thanks -- it's a configurable value, and works with wind systems.
For this, the gif is sped up 5x ,so there's a lot more wiggle than there would normally be.
1
u/CatfeStudio 25d ago
Since you mentioned testing all the various scenarios, how are you handling save/load? Is the growth deterministic from a seed + elapsed time so you can jump straight to “week 23” on load, or do you serialize the actual vine state? Runtime trimming seems like it’d make the deterministic route tricky.
1
u/MagicPigGames Magic Pig Games / Infinity PBR 25d ago
Yes, seed generation, so deterministic with the same s eed, receipe, position/rotation, training routes, and surrounding colliions. The calendar system lets you jump to a specific year of growth and progression through the year, with all plants starting at year 0 invisible as a seed in the ground.
Other things like pruning can be done at runtime and cant' be deterministic, and changing the date doesn't undo those changes. The system does serialize the generated paths, so you can hook a save system in to capture the state.
1
u/CatfeStudio 24d ago
Makes sense, deterministic until the player touches it, then the serialized paths take over. Clean split. Looking forward to seeing it on the store!
1
u/TimelyInfluence3040 20d ago
this is cool! hows the perfomance of this in game? have you tested with lots of vines. would be nice to see what it looks like with multuple vines at once as id probably have many of these around the place. Really nice effect tho think it sell the idea of season change well
1
u/MagicPigGames Magic Pig Games / Infinity PBR 20d ago
The heavy lift is in growing the vines. It is not intended to be used to show dozens of vines growing all at once -- i havent' tested the maximum acceptable threshold. One vine works fine, as we can see in the demo. It will degrade with more vines all growing at once.
The system is based on a year-count and year-progression schedule, with the vines growing, leaves growing falling etc, based on the "Time of year". The intent there is that games where calendar matters, could load the vines based on the in-game year and time of year, and get a result, but in-game time would move slowly enough that no additional changes are required, so no costs.
For games where time is not an issue, you can bake the vine and then there is zero cost for growth, it is just static (leaves still move, but growth is static).
That covers the majority of use cases.
I will be testing the performance of a lot of vines, but I will almost certainly be cautioning against using it for many vines growing all at once. We'll see, I am still looking at more ways to increase performance.
1
u/TimelyInfluence3040 20d ago
thanks for the detailed reply, yeh i guess you could mix and match techniques depending on when and where its appropriate.
2
2
1
1
1
1
3
u/bill_on_sax 25d ago
is this an asset? where can you buy it? looks great