summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2024-10-31 14:51:16 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2024-10-31 14:51:16 +0000
commit7cd23e3dabc49658199eac44e85dee2da5d5a0d2 (patch)
tree88de68bbc8b0f01fb8dd8da6f0fc1463fb4e461a /src
parentd687ab739cb0bc0c3cea8398a8320070a8e3cda1 (diff)
downloadthrow_simulation-7cd23e3dabc49658199eac44e85dee2da5d5a0d2.tar
throw_simulation-7cd23e3dabc49658199eac44e85dee2da5d5a0d2.tar.gz
throw_simulation-7cd23e3dabc49658199eac44e85dee2da5d5a0d2.zip
Make score decay faster
Diffstat (limited to 'src')
-rw-r--r--src/index.js3
1 files changed, 2 insertions, 1 deletions
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);
}