At the beginning of my game, I want to build a world. This process is slow enough to warrant a separate thread. I successfully implemented it with threading from direct.stdpy (yay!) but it is limited in capability and doesn’t fully exploit the taskMgr or other native capabilities. It does use a Task to check if the thread is finished or not, but that’s about it.
Question 1 - Should I call it good and be happy with the threading? Or should I look for a more panda-native solution?
This matters because I started wanting to monitor the thread progress by updating the scene as it progresses. But, because of multiple frequent reparent_to operations, it has major lags.
Question 2 - Are there good tricks for asynchronously reparenting, or otherwise limiting the lags, during dynamic world creation or other reparent-heavy operations?
I found TaskThreaded and it claims to be good for “CPU-intensive processing” – I thought I was on to something, but I can’t even figure out how to use it. When I subclass from it and try to add it to the taskMgr, it throws this error:
Exception: add: Tried to add a task that was not a Task or a func
When I try to run it directly, it just blocks the rest of the loop.
Question 3 - Is TaskThreaded a good solution for this particular application? If so, is there a good example I can look at to see how to properly implement it? If not, when is it a good tool to use?