Przeglądaj źródła

balance: 前 30 层短期加成 ×2、首次回溯门槛 20 层

LiuYuYang 1 tydzień temu
rodzic
commit
921aaec486
3 zmienionych plików z 6 dodań i 4 usunięć
  1. 2 1
      js/config.js
  2. 3 2
      js/state.js
  3. 1 1
      tests/unit.mjs

+ 2 - 1
js/config.js

@@ -74,10 +74,11 @@ export function essenceDensity(L, F) { return Math.pow(ESSENCE_GROWTH, Math.max(
 export const PROD_BASE_DIV = 1.05 * Math.log(1.05);
 export const PROD_DECAY = 0.0015;  // 软上限:每层指数的衰减(有效增长率 = e^(ln1.05 − PROD_DECAY·L);L=1000 时每层仅 ×1.0006)
 /** 产出基线:∫_0^L e^{ln1.05·x − 0.5·DECAY·x²} dx 的数值近似(软上限:32 层内指数衰减 12.8%) */
+export const EARLY_BOOST = 2;   // 低层起步加速:前 30 层的本源密度额外 ×2(避免“前 10 分钟几乎不动”)
 export function essenceBase(L, rootP) {
   if (L < 30) {   // 低层直接解析式(软上限效果可忽略)
     const gl = Math.log(1.05);
-    return rootP * (Math.exp(gl * L) - 1) / gl;
+    return rootP * EARLY_BOOST * (Math.exp(gl * L) - 1) / gl;
   }
   const g = Math.log(1.05);
   let acc = 0; const n = Math.max(1, Math.ceil(Math.max(0, L) / 2));

+ 3 - 2
js/state.js

@@ -281,8 +281,9 @@ export function tick(s, rift, dt) {
     const progress = (s.layer - floor) / Math.max(1, (s.maxLayerRound || 0) - floor);
     if (process.env.ADBG && s.playSec >= 30) console.log('AD', s.playSec.toFixed(0), 'L', s.layer.toFixed(2), 'mr', s.maxLayerRound.toFixed(2), 'floor', floor, 'prog', progress.toFixed(2), 'stall', stalled, s._stall && s._stall.layer.toFixed(2));
     const sinceReb = s.playSec - (s._lastRebSec || -1e9);
-    // 门槛:本轮至少 8 层、当前层已到“最优回溯点”(前半段)附近、且(卡墙 或 已完成本轮大半)
-    if (s.playSec >= 60 && sinceReb >= 20 && (s.maxLayerRound || 0) >= 8 && s.layer >= Math.max(5, 0.75 * (s.maxLayerRound || 0)) && (stalled || progress >= 0.4)) { out.auto = true; s._lastRebSec = s.playSec; s._stall = { t: s.playSec, layer: s.layer }; }
+    // 门槛:本轮至少 8 层、还没回溯过时先攒到 20 层、当前层已到“最优回溯点”(后半段)附近、且(卡墙 或 已完成本轮大半)
+    const minDepth = (s.rebirths || 0) === 0 ? 20 : 8;
+    if (s.playSec >= 60 && sinceReb >= 20 && (s.maxLayerRound || 0) >= minDepth && s.layer >= Math.max(5, 0.75 * (s.maxLayerRound || 0)) && (stalled || progress >= 0.4)) { out.auto = true; s._lastRebSec = s.playSec; s._stall = { t: s.playSec, layer: s.layer }; }
   }
   return out;
 }

+ 1 - 1
tests/unit.mjs

@@ -47,7 +47,7 @@ ok('修仙道基起始层 +100', C.earlyLayer(400, C.PLANE_RULES[3]) === C.early
 ok('里世界中主世界冻结:炼化预期为 0', (() => { const a = S.newState(); a.planeRun = { state: 'fight', active: true }; a.layer = 50; a.maxLayerRound = 50; return F.rebirthEstimate(a) === 0; })());
 
 // 5) 本源产出积分:L=100 时 = (1.05^100 − 1)/(1.05·ln1.05)
-ok('产出积分公式(前 30 层解析;100 层带软上限,偏差 <100%)', Math.abs(C.essenceBase(100, 1) / ((Math.pow(1.05, 100) - 1) / Math.log(1.05)) - 1) < 1 && near(C.essenceBase(20, 1), (Math.pow(1.05, 20) - 1) / Math.log(1.05), 1e-6));
+ok('产出积分公式(前 30 层解析;100 层带软上限,偏差 <100%)', Math.abs(C.essenceBase(100, 1) / ((Math.pow(1.05, 100) - 1) / Math.log(1.05)) - 1) < 1 && near(C.essenceBase(20, 1), C.EARLY_BOOST * (Math.pow(1.05, 20) - 1) / Math.log(1.05), 1e-6));
 ok('π(L=30) 公式', near(C.piOf(30, 0), Math.log(1.05) / (1 - Math.exp(-Math.log(1.05) * 30))));
 
 // 6) 里世界结算:探索度增量 通关 ⌊6+分/50⌋ / 失败 ⌊6+分/100⌋