Inspiration

Due to the massive popularity of games like Grow a Garden, there have been a recent surge of creators looking for optimized ways for spawning resources in the world. The constrain is that more often than not spawning implies increasing the number of dynamic objects, the world runs out of capacity very quickly and the playtime stops. This asset is a demonstration of a workaround for this limitation: it spawns static objects, not dynamic, making it so the world can hold more and more resources and assets.

What it does

It automatically spawns resources like trees, rocks, or collectibles in valid areas of your world, making sure they don’t overcrowd or appear in unreachable spots. Each resource can have custom health, size, rotation, and spawn timing, so they feel varied and natural. Players can harvest them using a physics enabled tool that deals damage on collision, and when resources break, they trigger sound, particles, and floating hit messages for satisfying feedback. The system manages all spawning, limits, and cleanup behind the scenes, so you can easily create survival, farming, or progression mechanics without extra setup.

How we built it

Everything was bult using the Desktop Editor:

  • The prototype assets are from the Public Library as well as the sfx and vfx
  • I used TypeScript for scripting, and VS Code

Challenges we ran into

  • Features balancing: I tried to find a sweet spot between the number of features and the ease of use of this asset. I errored on the easy to use side, so there are plenty of room for enhancements and personalization
  • Collision: handling collisions is never an easy task, in particular since they are not so good with performance. But I implemented a cooldown to make sure that the interaction trigger within a reasonable time
  • NavMesh: Navigation profiles do not carry over with sharable assets. So I added detailed instructions in the asset to guide the player on how to configure the NavMesh to make it work. Also, the accompanied video should help with the configuration

Accomplishments that we're proud of

I'm very proud of the final result. Randomly spawning resources that can be harvest without overloading the simulation is a good tool to have, that will hopefully help many creators.

What we learned

NavMesh can be tricky to work with, especially if we don't allow enough time to rebake after an asset spawns in. I solved this problem by implemented a queue that makes sure that 2 assets are not spawned in exactly at the same time. This also helps with optimization and world stability.

What's next for Grow a World Resources Spawner

Further optimizations can be implemented to make the asset more complex and suitable for advanced scenario, like "lucky hit" or specialized tools. For now, I'm interested on gathering feedback to further address what the majority of the community needs.

Built With

Share this project:

Updates