Private
Public Access
1
0

Adjust physics constants for better 20 TPS gameplay feel, refine smoothing and correction thresholds, and update cache-busting version for client assets.
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 2m15s

This commit is contained in:
Sebastian Unterschütz
2026-01-05 19:54:07 +01:00
parent 0ae6c58eb9
commit dc5136ca21
6 changed files with 12 additions and 11 deletions

View File

@@ -84,8 +84,8 @@ func (g *Game) UpdateGame() {
// Lokale Physik sofort anwenden (Prediction)
g.ApplyInput(input)
// Sanfte Korrektur anwenden (schnellere Interpolation für weniger Ruckeln)
const smoothingFactor = 0.4 // Erhöht von 0.2 auf 0.4
// Sanfte Korrektur anwenden (langsamer bei 20 TPS für weniger Jitter)
const smoothingFactor = 0.15 // Reduziert für 20 TPS (war 0.4 bei 60 TPS)
if g.correctionX != 0 || g.correctionY != 0 {
g.predictedX += g.correctionX * smoothingFactor
g.predictedY += g.correctionY * smoothingFactor
@@ -93,8 +93,8 @@ func (g *Game) UpdateGame() {
g.correctionX *= (1.0 - smoothingFactor)
g.correctionY *= (1.0 - smoothingFactor)
// Korrektur beenden wenn sehr klein (kleinerer Threshold)
if g.correctionX*g.correctionX+g.correctionY*g.correctionY < 0.25 {
// Korrektur beenden wenn sehr klein
if g.correctionX*g.correctionX+g.correctionY*g.correctionY < 1.0 {
g.correctionX = 0
g.correctionY = 0
}