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
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 2m15s
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user