From 7cd23e3dabc49658199eac44e85dee2da5d5a0d2 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Thu, 31 Oct 2024 10:51:16 -0400 Subject: Make score decay faster --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/index.js') diff --git a/src/index.js b/src/index.js index 71554ce..ab8e047 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,7 @@ const OBJ_MASS = 100; const SCORE_DECAY_CURVE_L = 1000; const SCORE_DECAY_CURVE_K = 0.01; const SCORE_DECAY_CURVE_X0 = 1000; +const SCORE_DECAY_FACTOR = 30; const SCORE_INCREMENT = 150; const STEP_MS = 33; const TARGET_WIDTH_FACTOR = 0.05; @@ -87,7 +88,7 @@ RAPIER.init().then(() => { SCORE_DECAY_CURVE_L / (1 + Math.exp(-SCORE_DECAY_CURVE_K * (score - SCORE_DECAY_CURVE_X0))); if (score_gap > score_decay_coefficient) { - score -= Math.max(Math.log(score), 1); + score -= score / SCORE_DECAY_FACTOR; score = Math.max(score, 0); } -- cgit v1.2.3-57-g22cb