alpapaydin / Godot4-3D-Smooth-Destructible-Terrain

A basic demonstration of procedural smooth terrain generation in Godot 4 in 100 lines.
MIT License
14 stars 3 forks source link

Move dig chunk creation from physics_process to _process #2

Closed gregrylivingston closed 4 days ago

gregrylivingston commented 4 days ago

Digging was called in the player's physics process which typically gets called 60 times a second. Moving it to _process massively decreases lag. Maybe there is a better way to do this? This solution is significantly more performant and even works on web.

Tangentially related. I recently used this in a game jam - https://gregry.itch.io/save-the-animals-calm-before-the-storm. I have a few other improvements I will create pull requests for.

alpapaydin commented 4 days ago

Just confirmed the performance increase, appreciated friend.