I think this is what I want, to use threads. But I don't really understand how threads work. I have it set up so that all the map creation is done in one function, and use
thread.start() to start the function, like in your example.
I'm creating and modifying nodes in the build function. The first thing the function does is instances the base map scene, then I do all the generation, adding more nodes as children of the map, and modifying values. Then in the load function I pass in the completed map node so I can add it as a child to my main game, allowing it to enter the tree and start working.
The problem is it takes a lot longer to build in the thread. Like every time a node is created and added as a child it waits one frame, instead of doing it all as fast as possible. I'm not really sure what I'm doing wrong.