perf: harden runtime for weaker hardware

This commit is contained in:
Rijad Zuzo
2026-08-12 10:02:45 +02:00
parent cd29da95e0
commit 34428d836a
47 changed files with 2164 additions and 243 deletions
+13 -3
View File
@@ -19,6 +19,8 @@ signal interaction_feedback(heading: String, message: String, succeeded: bool)
@export var interaction_range := 3.0
@export var villager_inspection_range := 3.0
@onready var combat_controller: Node = get_node_or_null("PlayerCombatController")
func _ready() -> void:
add_to_group("grass_interactors")
@@ -44,9 +46,17 @@ func _physics_process(delta: float) -> void:
var direction := (right * input.x + forward * -input.y).normalized()
var target_velocity := direction * move_speed
velocity.x = move_toward(velocity.x, target_velocity.x, acceleration * delta)
velocity.z = move_toward(velocity.z, target_velocity.z, acceleration * delta)
var dash_velocity := Vector3.ZERO
if combat_controller != null and combat_controller.has_method("get_dash_velocity"):
dash_velocity = combat_controller.get_dash_velocity()
if not dash_velocity.is_zero_approx():
target_velocity = dash_velocity
direction = dash_velocity.normalized()
velocity.x = target_velocity.x
velocity.z = target_velocity.z
else:
velocity.x = move_toward(velocity.x, target_velocity.x, acceleration * delta)
velocity.z = move_toward(velocity.z, target_velocity.z, acceleration * delta)
if not is_on_floor():
velocity.y -= 30.0 * delta