Semaphore.post() can get deadlocked if it posts before the semaphore waits, not sure how to fix that yetīeta Was this translation helpful? Give feedback. I wonder if there's a way to speed this up. Godot Godot game engine was released with a mission to provide an open-source solution which When it comes to game development, the Unreal Engine (UE) is. Yield( reattach_to_thread( "print test in thread"+ str( 1)), "completed")Īfter some testing, It does work without issue but running it 700 times is extremely slow, taking over 9 seconds. Yield( reattach_to_thread( "print test in thread"+ str( 0)), "completed") Godot is a popular Free and Open Source game development engine and toolset. Yielding_on_thread_process = false print( "this call should now be within thread" + str(printer) + "-") Its main focus is education and experimentation it is not recommended for production. #this needs to be called as yield(reattach_to_thread(),"completed") in order to work func reattach_to_thread( printer): The Godot Web Editor has some limitations compared to the native version. #if reattach_to_thread is still yielding, keep emitting signals until this is false if !yielding_on_thread_process: #in the case where the yield() is called after emit_signal("thread_frame"), this is needed to ensure that eventually the yield catches the signal var yielding_on_thread_process = false func thread_process(): Upload your games to itch.io to have them show up here.Godot Engine - The free and open source 2D and 3D game engine Var thread_active = true signal thread_frame() TopGamestagged Godot and markjam5 (1 result) Explore games tagged Godot and markjam5 on itch.io. Here would be my solution to this which would re-merge the function to a thread but I'm not sure if there's a better way of doing what I'm trying to do: It means that the documentation team can always use your feedback and. Is_colliding = true #now how do i get this function to merge back to the thread i called it from? return is_colliding Note: Godot Engine is an open source project developed by a community of volunteers. direct_space_state #need to transform the collider shape params itself:Ĭollider_shape_params. transform #merge with the physics thread in order to safely call the collision functions yield( get_tree(), "physics_frame") #need to transform the collider shape params itself:Ĭollider_shape_params. set_collide_with_bodies( true)Ĭollider_shape_params. set_collide_with_areas( false)Ĭollider_shape_params. set_shape(col_shape.shape)Ĭollider_shape_params. Var collider_shape_params = PhysicsShapeQueryParameters. #wait until col_shape is added to the world (this also merges this with the main thread) yield(col_shape, "ready") #do whatever positioning with the col_shape and cylinder here. #But i am unable to yield on anything that was called from the original thread, so what am i to do? call_deferred( "emit_signal", "thread_done") A downloadable template Buy Now 14. #my thread is meant to continue running other things in the background after this call as to not burden the main thread. #upon yeilding for the result of this function the thread_func() is no longer running from within the thread var is_colliding = yield( check_if_colliding(), "completed")
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |