mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 00:28:14 +00:00
use v22 trade meta
This commit is contained in:
@@ -20,7 +20,7 @@ import { PlayerView } from "../game/GameView";
|
|||||||
import { UserSettings } from "../game/UserSettings";
|
import { UserSettings } from "../game/UserSettings";
|
||||||
import { GameConfig, GameID, TeamCountConfig } from "../Schemas";
|
import { GameConfig, GameID, TeamCountConfig } from "../Schemas";
|
||||||
import { NukeType } from "../StatsSchemas";
|
import { NukeType } from "../StatsSchemas";
|
||||||
import { assertNever, sigmoid, simpleHash, within } from "../Util";
|
import { assertNever, sigmoid, simpleHash, toInt, within } from "../Util";
|
||||||
import { Config, GameEnv, NukeMagnitude, ServerConfig, Theme } from "./Config";
|
import { Config, GameEnv, NukeMagnitude, ServerConfig, Theme } from "./Config";
|
||||||
import { Env } from "./Env";
|
import { Env } from "./Env";
|
||||||
import { PastelTheme } from "./PastelTheme";
|
import { PastelTheme } from "./PastelTheme";
|
||||||
@@ -289,15 +289,7 @@ export class DefaultConfig implements Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tradeShipGold(dist: number, numPorts: number): Gold {
|
tradeShipGold(dist: number, numPorts: number): Gold {
|
||||||
// Sigmoid: concave start, sharp S-curve middle, linear end - heavily punishes trades under range debuff.
|
return toInt(10000 + 150 * Math.pow(dist, 1.1));
|
||||||
const debuff = this.tradeShipShortRangeDebuff();
|
|
||||||
const baseGold =
|
|
||||||
100_000 / (1 + Math.exp(-0.03 * (dist - debuff))) + 100 * dist;
|
|
||||||
const numPortBonus = numPorts - 1;
|
|
||||||
// Hyperbolic decay, midpoint at 5 ports, 3x bonus max.
|
|
||||||
const bonus = 1 + 2 * (numPortBonus / (numPortBonus + 5));
|
|
||||||
const multiplier = this.goldMultiplier();
|
|
||||||
return BigInt(Math.floor(baseGold * bonus * multiplier));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Probability of trade ship spawn = 1 / tradeShipSpawnRate
|
// Probability of trade ship spawn = 1 / tradeShipSpawnRate
|
||||||
@@ -306,13 +298,12 @@ export class DefaultConfig implements Config {
|
|||||||
numPlayerPorts: number,
|
numPlayerPorts: number,
|
||||||
numPlayerTradeShips: number,
|
numPlayerTradeShips: number,
|
||||||
): number {
|
): number {
|
||||||
// Geometric mean of base spawn rate and port multiplier
|
if (numPlayerPorts <= 3) return 18;
|
||||||
const combined = Math.sqrt(
|
if (numPlayerPorts <= 5) return 25;
|
||||||
this.tradeShipBaseSpawn(numTradeShips, numPlayerTradeShips) *
|
if (numPlayerPorts <= 8) return 35;
|
||||||
this.tradeShipPortMultiplier(numPlayerPorts),
|
if (numPlayerPorts <= 10) return 40;
|
||||||
);
|
if (numPlayerPorts <= 12) return 45;
|
||||||
|
return 50;
|
||||||
return Math.floor(25 / combined);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private tradeShipBaseSpawn(
|
private tradeShipBaseSpawn(
|
||||||
@@ -388,12 +379,7 @@ export class DefaultConfig implements Config {
|
|||||||
};
|
};
|
||||||
case UnitType.MIRV:
|
case UnitType.MIRV:
|
||||||
return {
|
return {
|
||||||
cost: (game: Game, player: Player) => {
|
cost: this.costWrapper(() => 35_000_000),
|
||||||
if (player.type() === PlayerType.Human && this.infiniteGold()) {
|
|
||||||
return 0n;
|
|
||||||
}
|
|
||||||
return 25_000_000n + game.stats().numMirvsLaunched() * 15_000_000n;
|
|
||||||
},
|
|
||||||
territoryBound: false,
|
territoryBound: false,
|
||||||
};
|
};
|
||||||
case UnitType.MIRVWarhead:
|
case UnitType.MIRVWarhead:
|
||||||
|
|||||||
+1
-1
@@ -86,7 +86,7 @@ export CLOUDFLARE_TUNNEL_TOKEN=${TUNNEL_TOKEN}
|
|||||||
|
|
||||||
# Start supervisord
|
# Start supervisord
|
||||||
if [ "$DOMAIN" = openfront.dev ] && [ "$SUBDOMAIN" != main ]; then
|
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
|
else
|
||||||
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user