Jump to content

Multithreading Runtime GeNa Pro


Recommended Posts

Hello all,

The game I am currently developing relies heavily on GeNa's versatile runtime spawning mechanics. Currently I am generating all spawners at runtime, and this can take upwards of 2-5 minutes on my Ryzen 9 5900X.

I looked into multithreading options such as Unity's BurstCompiler and Jobs systems, but after two hours of painstakingly combing through documentation and making small-scale examples, I'm still not sure how to proceed.

Could anyone give some tips on improving spawning performance at runtime?

Thank you.

Link to comment
Share on other sites

13 hours ago, Manny said:

Hey @woffles,

The performance of GeNa is heavily dependant on the objects you are trying to Spawn. If there are a heap of objects that you're spawning, the mere process of Instantiating objects is slow itself. So it's not necessarily GeNa where you'll have bottle-necks in performance. 

I would start by heavily profiling the process to see specifically where the performance is being impacted and try and find a way around it. If you notice it's something other than instantiation causing the performance impact, I would very much like to see that data! 🙂 Feel free to post a screen shot of your findings here.

Hello again @Manny, I apologize for the large influx of questions on my part recently.

I profiled the game during editor runtime. As expected a monumental amount of time was being spent on a single frame where the:


code was being called a preset amount of times throughout my script at different locations on the map.

A single spawner does not include an overwhelming amount of objects by itself, but I am indeed instantiating multiple of them (spawner instances, that is).

My question is whether it would be possible to spawn the spawners themselves concurrently with the main thread, generating on the fly, or at least make it more performant. I am not able to do much with GeNa as I could with Gaia on my previous issue as the Core is in an assembled DLL.

Thank you!

Link to comment
Share on other sites

6 hours ago, Manny said:

Hello again @woffles,

Happy to help where I can! But this is a tricky situation because I'd have to take a look at the project myself in the non-DLLed version to see exactly where the issue is. That being said, we can try and narrow it down a bit. 

There's actually a setting called 'Interval' on a GeNa spawner, can you tell me what that's set to? By default it's 1000 from memory.

Hello @Manny!

The time interval is indeed set to 1000 at the moment. I didn't touch that specific setting when configuring.

Link to comment
Share on other sites

On 8/1/2022 at 11:40 AM, Manny said:

Could you try lowering it to something like 100-150 and perform a profile again? 

Please perform a 'Deep Profile' as well for this. I want to see if there's any other hidden function that's causing the issue. 

Hello again,

I apologize for the late reply. Yes, while waiting for your reply I did do some tweaking with the interval. There was no change to the speed of which objects generated. I was wondering what the interval option did and what it affects.

Thank you!

Link to comment
Share on other sites

On 8/4/2022 at 3:26 PM, Manny said:

The 'Interval' option is the time it takes in between Coroutine Spawns because GeNa spawns work on Coroutines. 

Is there anything else I can try in regards to optimizing the spawning time?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

  • Create New...