Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix avoidance calculation on NO_THREADS build #66806

Merged
merged 1 commit into from Oct 3, 2022

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Oct 3, 2022

Fixes #66793

Adds fallback for avoidance calculation on NO_THREADS builds e.g. HTML5 with no threads enabled.

@smix8 smix8 force-pushed the navigation_avoidance_nothread_3.x branch from afa0652 to 47e6fbd Compare October 3, 2022 10:40
@akien-mga akien-mga added bug topic:buildsystem topic:navigation cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release labels Oct 3, 2022
@akien-mga akien-mga added this to the 3.6 milestone Oct 3, 2022
@akien-mga
Copy link
Member

Might be worth adding a comment in the documentation too, e.g.:

diff --git a/doc/classes/NavigationAgent.xml b/doc/classes/NavigationAgent.xml
index 5f8eed4619..e4b0f55dbd 100644
--- a/doc/classes/NavigationAgent.xml
+++ b/doc/classes/NavigationAgent.xml
@@ -6,6 +6,7 @@
 	<description>
 		3D agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO (Reciprocal Velocity Obstacles) collision avoidance. The agent needs navigation data to work correctly. By default this node will register to the default [World] navigation map. If this node is a child of a [Navigation] node it will register to the navigation map of the navigation node or the function [method set_navigation] can be used to set the navigation node directly. [NavigationAgent] is physics safe.
 		[b]Note:[/b] After [method set_target_location] is used it is required to use the [method get_next_location] function once every physics frame to update the internal path logic of the NavigationAgent. The returned vector position from this function should be used as the next movement position for the agent's parent Node.
+		[b]Note:[/b] By default, the expensive calculations for avoidance are done in a thread. In HTML5 exports without thread support, they will be done on the main thread, which can lead to performance issues.
 	</description>
 	<tutorials>
 	</tutorials>

(I don't know if it's the best place for it, and it should be replicated in 2D if it is.)

@smix8
Copy link
Contributor Author

smix8 commented Oct 3, 2022

It is 2D and 3D so if added to the docs should be added for both.

EDIT
Added note to NavigationAgent, NavigationAgent2D and NavigationServer.

@smix8 smix8 force-pushed the navigation_avoidance_nothread_3.x branch from 47e6fbd to f15cb16 Compare October 3, 2022 11:40
@smix8 smix8 requested a review from a team as a code owner October 3, 2022 11:40
@akien-mga akien-mga merged commit ecaf2b0 into godotengine:3.x Oct 3, 2022
@akien-mga
Copy link
Member

Thanks!

@timothyqiu
Copy link
Member

Cherry-picked for 3.5.2

@timothyqiu timothyqiu removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants