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

Godot 4 port fixes #17

Open
wants to merge 6 commits into
base: godot-4-port
Choose a base branch
from

Conversation

hankedan000
Copy link

Major fix was that the cube resource pool was leaking cubes after release(). This was causing new cubes to instantiated when the pool became exhausted (big performance hit). This bug was introduced at some point in a refactor and/or godot 4 porting effort

was previous set to "Local" which doesn't support recentering (keeps player head fixed in virtual world)
 * pre-instance the CutPieces objects
 * fixed bugs in the ScenePool leaking cubes on release()
i have the renderer drop down to "Mobile". you only acquire this additional setting when you switch to "Compatibility" rendere, but then this setting gets removed when you switch back to "Mobile", so i think it should be removed.
i'm not sure if the old API needed a call to trigger_haptic_pulse() with intesity=0.0 in order to terminate the rumble, but the current API has a duration argument. repeatedly calling trigger_haptic_pulse() seems to have no gain besides a ~0.25ms cost per call.
if the cut plane was vertical, then the cut pieces were flying up/down instead of left/right
@@ -34,5 +34,4 @@ func acquire() -> BeepCube:
return cube

func _on_scene_released(cube: BeepCube) -> void:
cube.scene_released.disconnect(_on_scene_released)
Copy link
Author

@hankedan000 hankedan000 Jan 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leandrodreamer haha i see you've been making attempts at improving cube cutting performance recently too, and we have some conflicts.

I think the major issue with cubes leaking from the resource pool still exists on main (should probably retest though). I believe the big issue was that the scene_released signal was being disconnected here for no good reason, resulting in object not getting re-added to _free_list list after released(). This basically results in a pool object only ever getting used twice (i think) before the pool will become exhausted and start dynamically instancing entire new cube each time acquire() is called.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm i see, i haven't noticed any performance issue on new cubes, even on web, but there may still be some issue if they stay in memory forever

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

Successfully merging this pull request may close these issues.

2 participants