Loading...
Loading...
Expert blueprint for performance profiling and optimization (frame drops, memory leaks, draw calls) using Godot Profiler, object pooling, visibility culling, and bottleneck identification. Use when diagnosing lag, optimizing for target FPS, or reducing memory usage. Keywords profiling, Godot Profiler, bottleneck, object pooling, VisibleOnScreenNotifier, draw calls, MultiMesh.
npx skill4agent add thedivergentai/gd-agentic-skills godot-performance-optimizationprint()print()@warning_ignoreif OS.is_debug_build():VisibleOnScreenNotifier2Dset_process(false)screen_exitedfor i in 1000: var bullet = Bullet.new()get_node()_process()get_node("Player")@onready var player := $Playervar bullet_pool: Array[Node] = []
func get_bullet() -> Node:
if bullet_pool.is_empty():
return Bullet.new()
return bullet_pool.pop_back()
func return_bullet(bullet: Node) -> void:
bullet.hide()
bullet_pool.append(bullet)# Add VisibleOnScreenNotifier2D
# Disable processing when off-screen
func _on_screen_exited() -> void:
set_process(false)
func _on_screen_entered() -> void:
set_process(true)# Use TextureAtlas (sprite sheets)
# Batch similar materials
# Fewer unique textures