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

Collision avoidance doesn't work occasionally #72202

Closed
Scony opened this issue Jan 27, 2023 · 3 comments · Fixed by #69988
Closed

Collision avoidance doesn't work occasionally #72202

Scony opened this issue Jan 27, 2023 · 3 comments · Fixed by #69988

Comments

@Scony
Copy link
Contributor

Scony commented Jan 27, 2023

Godot version

4.0 beta (master @ 27.01.2023)

System information

Linux Manjaro

Issue description

When units move further from the (0,0,0), at some point they may lose track of each other. In such cases producing new unit helps for a while.

See the video below. Please note that units that fail to collide occasionally are having max_neighbors = 30 while there are not even 30 units in the entire simulation.

navi_problems_2.mp4

Btw. The issue may be reproduced with less units as well.

Steps to reproduce

See the video

Minimal reproduction project

godot-open-rts-navi-error.zip

@smix8
Copy link
Contributor

smix8 commented Jan 27, 2023

If avoidance things bug out and adding / removing agents helps that is often a sign of a unsolvable / broken avoidance simulation because when agents are added the RVO simulation is rebuild so it is "fixed" temporarily.

If you can try testing it with #69988 as the current avoidance has so many screws loose it is hard to tell what is just a settings issue and what is actual a bug from the broken avoidance.

I also need a manual for your demo, it is very cool by I have no clue how half of the stuff is supposed to work :D

@Scony
Copy link
Contributor Author

Scony commented Jan 31, 2023

I confirm #69988 fixes that issue

@Scony
Copy link
Contributor Author

Scony commented Mar 2, 2023

Just FYI: for Godot 4.0 I've made a workaround that basically adds/removes dummy agent every 0.1s like this:

if _dummy_agent_rids[domain] == null:
	_dummy_agent_rids[domain] = NavigationServer3D.agent_create()
	NavigationServer3D.agent_set_position(_dummy_agent_rids[domain], Vector3(-99, 0, -99))
	NavigationServer3D.agent_set_map(
		_dummy_agent_rids[domain], get_navigation_map_rid_by_domain(domain)
	)
else:
	NavigationServer3D.free_rid(_dummy_agent_rids[domain])
	_dummy_agent_rids[domain] = null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants