mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-19 09:04:59 +00:00
reduce number of trade ships by 50%, double gold per trade ship (#1934)
## Description: v25 increased the number of trade ships from v24, causing lag complaints. On my chromebook pathfinding is using over 60% of cpu. So reduced the number of trade ships roughly by half, but double the gold per trade ship so it should balance out, World v25: * 2 mins: ~ 60 trade ships * 5 mins: ~ 140 trade ships World on this branch: * 2 mins: ~ 35 trade ships * 5 mins: ~ 70 trade ships Also increased the probably of trade ship spawn for players with under 2 tradeships to prevent larger players from starving out smaller players. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
This commit is contained in:
@@ -79,9 +79,10 @@ export class PortExecution implements Execution {
|
||||
shouldSpawnTradeShip(): boolean {
|
||||
const numTradeShips = this.mg.unitCount(UnitType.TradeShip);
|
||||
const numPlayerPorts = this.player.unitCount(UnitType.Port);
|
||||
const numPlayerTradeShips = this.player.unitCount(UnitType.TradeShip);
|
||||
const spawnRate = this.mg
|
||||
.config()
|
||||
.tradeShipSpawnRate(numTradeShips, numPlayerPorts);
|
||||
.tradeShipSpawnRate(numTradeShips, numPlayerPorts, numPlayerTradeShips);
|
||||
for (let i = 0; i < this.port!.level(); i++) {
|
||||
if (this.random.chance(spawnRate)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user