Hi I wanted to know how to manage system intensive tasks that freeze the game up when they are done. Can I run them parallel to the rest of the game of the rest of the game does not require them immediately? Or do I have to create some sort of load screen?
Also if I make the task a co routine if the co routine calls a function that’s not itself a co routine will that be executed in the normal thread?
You could write a coroutine that yielded frequently, and it can call anything. But you are in control so you'd have to space out the process by inserting yields. This can make it slower if you do too many, or the game will still freeze if you do too few.
– whydoidoitThanks, The problem was building waypoint connections. I have played around with yield lengths and found that if I build a way points connections every 0.15s and for each way point i calculate ones connected to it very 0.02 seconds i suffer virtually no performance hit.
– dfghdhYeah it's a balancing act. Nice to do it on a thread if you can - but there's no way of doing that if you have to raycast etc.
– whydoidoitUnfortunately I only connect way points that are in each others LOS don't want them linking through walls :)
– dfghdhYeah I have to do the same thing - still once connected you can path find on another thread :)
– whydoidoit