From d39aa245d3b603904465bcb80af02590450c21e1 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 23 Dec 2024 20:03:34 -0800 Subject: [PATCH] rebalance troops increase & max population --- TODO.txt | 17 +++++++++++------ src/core/configuration/DefaultConfig.ts | 14 +++++++------- src/core/configuration/DevConfig.ts | 14 +++++++------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/TODO.txt b/TODO.txt index 044ba101e..3515fcfce 100644 --- a/TODO.txt +++ b/TODO.txt @@ -264,22 +264,29 @@ -- v0.13.0 release +* make troops regenerate slower in mid-late game +* player info show territory +* make boats work on lakes +* compute mini map offline * make url allow to join game * show players joined username in private lobby +* have bots build cities & defense posts & nukes * troop density affects attack bonus -* bug: NPCs don't have money +* record game winner +* pause button in single player +* refresh graphics after tab away * right click brings up player info menu * seperate server config from client config * bug: player names not updating sometimes + +--- v0.14.0 release + * make player editeable configs * couldn't scroll left on build menu to deploy bombs (mobile) * UI/test too big on mobile * bug: build city 25k bump doesn't match troop/worker ratio * bug: mobile: if you don't have enough money can't get rid of build menu -* have bots build cities & defense posts * allow longer names and allow them to be displayed in the Rank UI not be cut -* make boats work on lakes -* record game winner * repaint canvas after tab away to prevent blank screen * have nation spawn with irl territory * on mobile can't click away from build menu @@ -287,8 +294,6 @@ * record commit hash of game * remove alliance when player dies * put delay on adjust troop ratio to reduce number of messages -* make clientID & playerID smaller -* pause button in single player * when hovering over another player have the name not appear ontop of the exit cross * have a visual thing of who your attacking and how many boats you sent * make the sliders bigger. Like vertically. diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 2c96a3a75..fc2515c1c 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -106,8 +106,8 @@ export abstract class DefaultConfig implements Config { return { cost: (p: Player) => Math.min( - 500_000, - (p.units(UnitType.DefensePost).length + 1) * 100_000 + 250_000, + (p.units(UnitType.DefensePost).length + 1) * 50_000 ), territoryBound: true } @@ -252,7 +252,7 @@ export abstract class DefaultConfig implements Config { } maxPopulation(player: Player): number { - let maxPop = Math.sqrt(player.numTilesOwned()) * 3000 + 50000 + let maxPop = Math.pow(player.numTilesOwned(), .6) * 1000 + 50000 if (player.type() == PlayerType.Bot) { return maxPop } @@ -262,12 +262,12 @@ export abstract class DefaultConfig implements Config { populationIncreaseRate(player: Player): number { let max = this.maxPopulation(player) - let toAdd = 10 + (player.population() + Math.sqrt(player.population() * player.numTilesOwned())) / 100 + // const thing = Math.sqrt(player.population() + player.population() * player.workers()) + + let toAdd = 10 + Math.pow(player.population(), .7) / 5 const ratio = 1 - (player.population() / max) toAdd *= ratio - toAdd *= .5 - // consolex.log(`to add ${toAdd}`) if (player.type() == PlayerType.FakeHuman) { toAdd *= 1.0 @@ -276,7 +276,7 @@ export abstract class DefaultConfig implements Config { toAdd *= .7 } - return Math.min(player.troops() + toAdd, max) - player.troops() + return Math.min(player.population() + toAdd, max) - player.population() } goldAdditionRate(player: Player): number { diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index ce66583bd..cb8888dd4 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -8,7 +8,7 @@ export const devConfig = new class extends DefaultConfig { unitInfo(type: UnitType): UnitInfo { const info = super.unitInfo(type) const oldCost = info.cost - info.cost = (p: Player) => oldCost(p) / 10000 + // info.cost = (p: Player) => oldCost(p) / 10000 return info } @@ -25,12 +25,12 @@ export const devConfig = new class extends DefaultConfig { lobbyLifetime(): number { return 10 * 1000 } - tradeShipSpawnRate(): number { - return 10 - } - boatMaxDistance(): number { - return 5000 - } + // tradeShipSpawnRate(): number { + // return 10 + // } + // boatMaxDistance(): number { + // return 5000 + // } // numBots(): number { // return 1