Crafting tabs (tools, weapons, cooking, building...); panel fits at 1280x720; steadier smoothness test

This commit is contained in:
Paul Bailey
2026-11-04 22:01:54 +00:00
parent a211fe4c63
commit 47fc116839
4 changed files with 117 additions and 6 deletions

View File

@@ -107,9 +107,18 @@ func _body() -> void:
var end_anim: int = av.anim if is_instance_valid(av) else -1
var br := await _result(bob)
var moving := samples.filter(func(s): return s[1] > 0.5)
# Top speed over 0.2 s windows (4 samples): one late frame on this machine
# reads as a burst in a single 50 ms sample, while a real jump (half a
# metre extra) still shows as over 6.5 m/s.
var top := 0.0
for s in samples:
top = maxf(top, s[1])
for i in range(3, samples.size()):
var dt_sum := 0.0
var dist := 0.0
for j in range(i - 3, i + 1):
var dtj: float = samples[j][0] - (samples[j - 1][0] if j > 0 else 0.0)
dt_sum += dtj
dist += float(samples[j][1]) * dtj
top = maxf(top, dist / maxf(dt_sum, 0.001))
var stalls := 0
if moving.size() > 2:
# Count gaps inside the walking stretch where he froze.