use sigmoid function for trade ship gold to punish short trades

This commit is contained in:
evanpelle
2025-10-30 20:15:18 -07:00
parent 1165126a65
commit 6fd1576d7b
+3 -2
View File
@@ -370,8 +370,9 @@ export class DefaultConfig implements Config {
}
tradeShipGold(dist: number, numPorts: number): Gold {
// Smooth anti-cheese formula: base reward scales with distance using rational function, heavily penalizing short trades while converging to original rewards at long distances
const baseGold = Math.floor(100_000 * (dist / (dist + 50)) + 100 * dist);
// Sigmoid: concave start, sharp S-curve middle, linear end - heavily punishes trades under 200
const baseGold =
100_000 / (1 + Math.exp(-0.03 * (dist - 200))) + 100 * dist;
const numPortBonus = numPorts - 1;
// Hyperbolic decay, midpoint at 5 ports, 3x bonus max.
const bonus = 1 + 2 * (numPortBonus / (numPortBonus + 5));