kuligs2 man, youre talking in riddles, or maybe youre just sarcastic, i cant tell..
No, I'm just assuming you're knowledgeable enough. If you're capable of writing an udp server you should be able to understand what "put it in a thread" means.
Any code inside a _process()
function acts as a part of the body of engine's main game loop. So basically the engine does this with your _process()
function under the hood:
while(running): #invisible
_process()
wait_for_next_frame() #invisible
The problem is that the execution of the body of this "invisible loop" is delayed so it executes exactly once per frame. If you want it to run faster, you'll need the code in _process()
to run in a loop that's decoupled from engine's main loop (runs in a thread) or to completely replace the main loop (runs as a custom standalone script instead of the default loop):
func my_thread():
while(running):
# do stuff that was previously done in _process()
The above loop will now iterate your code independently of engine's frame rate. Each loop iteration won't wait until the frame is finished. It will loop immediately. Assuming you launched that function as a thread or as a main game loop replacement.