diff --git a/src/core/configuration/Config.ts b/src/core/configuration/Config.ts index 990da255ba..93f0fc324c 100644 --- a/src/core/configuration/Config.ts +++ b/src/core/configuration/Config.ts @@ -130,7 +130,7 @@ export interface Config { tradeShipGold(dist: number): Gold; tradeShipSpawnRate( tradeShipSpawnRejections: number, - numTradeShips: number, + numPlayerPorts: number, ): number; trainGold( rel: "self" | "team" | "ally" | "other", diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 85d3b661f6..43b7c3d2a1 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -311,28 +311,24 @@ export class DefaultConfig implements Config { } tradeShipGold(dist: number): Gold { - // Sigmoid: concave start, sharp S-curve middle, linear end - heavily punishes trades under range debuff. - const debuff = this.tradeShipShortRangeDebuff(); - const baseGold = - 75_000 / (1 + Math.exp(-0.03 * (dist - debuff))) + 50 * dist; - const multiplier = this.goldMultiplier(); - return BigInt(Math.floor(baseGold * multiplier)); + return toInt(10000 + 150 * Math.pow(dist, 1.1)); } // Probability of trade ship spawn = 1 / tradeShipSpawnRate tradeShipSpawnRate( tradeShipSpawnRejections: number, - numTradeShips: number, + numPlayerPorts: number, ): number { - const decayRate = Math.LN2 / 50; - - // Approaches 0 as numTradeShips increase - const baseSpawnRate = 1 - sigmoid(numTradeShips, decayRate, 200); + if (numPlayerPorts <= 3) return 18; + if (numPlayerPorts <= 5) return 25; + if (numPlayerPorts <= 8) return 35; + if (numPlayerPorts <= 10) return 40; + if (numPlayerPorts <= 12) return 45; // Pity timer: increases spawn chance after consecutive rejections const rejectionModifier = 1 / (tradeShipSpawnRejections + 1); - return Math.floor((100 * rejectionModifier) / baseSpawnRate); + return Math.floor((100 * rejectionModifier) / 50); } unitInfo(type: UnitType): UnitInfo { @@ -391,13 +387,8 @@ export class DefaultConfig implements Config { }; break; case UnitType.MIRV: - info = { - cost: (game: Game, player: Player) => { - if (player.type() === PlayerType.Human && this.infiniteGold()) { - return 0n; - } - return 25_000_000n + game.stats().numMirvsLaunched() * 15_000_000n; - }, + return { + cost: this.costWrapper(() => 35_000_000), }; break; case UnitType.MIRVWarhead: diff --git a/src/core/execution/PortExecution.ts b/src/core/execution/PortExecution.ts index 9483f1b701..d5c2e23f6b 100644 --- a/src/core/execution/PortExecution.ts +++ b/src/core/execution/PortExecution.ts @@ -69,10 +69,10 @@ export class PortExecution implements Execution { } shouldSpawnTradeShip(): boolean { - const numTradeShips = this.mg.unitCount(UnitType.TradeShip); + const numPlayerPorts = this.port!.owner().unitCount(UnitType.Port); const spawnRate = this.mg .config() - .tradeShipSpawnRate(this.tradeShipSpawnRejections, numTradeShips); + .tradeShipSpawnRate(this.tradeShipSpawnRejections, numPlayerPorts); for (let i = 0; i < this.port!.level(); i++) { if (this.random.chance(spawnRate)) { this.tradeShipSpawnRejections = 0; diff --git a/startup.sh b/startup.sh index 3eba5480bd..ca7eafc4f1 100644 --- a/startup.sh +++ b/startup.sh @@ -86,7 +86,7 @@ export CLOUDFLARE_TUNNEL_TOKEN=${TUNNEL_TOKEN} # Start supervisord if [ "$DOMAIN" = openfront.dev ] && [ "$SUBDOMAIN" != main ]; then - exec timeout 18h /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf + exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf else exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf fi