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

@@ -38,7 +38,7 @@ func (g *Game) ApplyInput(input InputState) {
// Sprung
if input.Jump && g.predictedGround {
g.predictedVY = -42.0 // war -14.0 bei 60 TPS (-14.0 * 3)
g.predictedVY = -30.0 // Reduziert für besseres Spielgefühl bei 20 TPS
g.predictedGround = false
}
@@ -114,8 +114,9 @@ func (g *Game) ReconcileWithServer(serverState game.PlayerState) {
diffX := replayX - g.predictedX
diffY := replayY - g.predictedY
// Nur korrigieren wenn Differenz signifikant (reduzierter Threshold für weniger Ruckeln)
const threshold = 2.0 // Reduziert von 5.0 auf 2.0
// Nur korrigieren wenn Differenz signifikant
// Bei 20 TPS größerer Threshold wegen größerer normaler Abweichungen
const threshold = 5.0 // Erhöht für 20 TPS (war 2.0)
if diffX*diffX+diffY*diffY > threshold*threshold {
// Speichere Korrektur für sanfte Interpolation
g.correctionX = diffX