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

Heightmap collision generation via PhysicsServer causes game to freeze for over a minute #290

Closed
droc101 opened this issue Nov 17, 2021 · 5 comments

Comments

@droc101
Copy link

droc101 commented Nov 17, 2021

Describe the bug
I'm not sure if this is the right place to put this, but when loading the scene in game with a large heightmap, the game freezes for multiple minutes. I have done some troubleshooting and believe that the line causing the issue is PhysicsServer.shape_set_data(_shape_rid, shape_data) in hterrain_collider.gd. The only modifications I made to the plugin was changing the maximum terrain size to 8193 (from 4097), and adding timers with OS.get_ticks_msec() to time functions for debugging.
Again, I'm not sure if this is the correct place to put this, as it might be an issue with PhysicsServer or something like that.
In case it matters, I am using the MultiSplat16 shader.

To Reproduce
I can't seem to reproduce the issue in other projects, but it might be possible to do so by creating complex terrain with a large size.

Expected behavior
The collision should not take over a minute to be added to the physics server.

Environment

  • OS: Windows 10 21H1
  • Graphics card AMD Radeon RX Vega 11 (Integrated GPU)
  • Godot version 3.3
  • Plugin version 1.5.2
  • Renderer used: GLES3
@Calinou
Copy link
Contributor

Calinou commented Nov 17, 2021

@droc101 Please upload a minimal reproduction project to make this easier to troubleshoot.

Also, try upgrading to Godot 3.4 as it features many physics fixes and optimizations. Did you change any project settings such as the physics engine or the thread model?

@droc101
Copy link
Author

droc101 commented Nov 17, 2021

I will try it with 3.4, I did change some graphics settings to make it perform better on my hardware, including changing to a multi threaded model. I will try to work on a reproduction project.

@Zireael07
Copy link

changing to a multi threaded model

This most likely is your culprit.

@droc101
Copy link
Author

droc101 commented Nov 17, 2021

Changing to 3.4 and Single-Safe thread model fixed all the issues! Thanks for the help.

@droc101 droc101 closed this as completed Nov 17, 2021
@Calinou
Copy link
Contributor

Calinou commented Nov 17, 2021

If using Bullet (the default 3D physics engine in Godot 3.x), this may be due to godotengine/godot#30027.

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

No branches or pull requests

3 participants