mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-08 00:40:39 +00:00
Merge branch 'main' into Sound&Music
This commit is contained in:
@@ -832,12 +832,13 @@ export class DefaultConfig implements Config {
|
||||
if (nukeType !== UnitType.MIRVWarhead) {
|
||||
return (5 * humans) / Math.max(1, tilesOwned);
|
||||
}
|
||||
|
||||
const targetPop = 0.05 * maxPop;
|
||||
const targetPop = 0.03 * maxPop;
|
||||
const excessPop = Math.max(0, humans - targetPop);
|
||||
const scalingFactor = 20000;
|
||||
const scalingFactor = 500;
|
||||
|
||||
return (scalingFactor * excessPop * excessPop) / (maxPop * maxPop);
|
||||
const steepness = 2;
|
||||
const normalizedExcess = excessPop / maxPop;
|
||||
return scalingFactor * (1 - Math.exp(-steepness * normalizedExcess));
|
||||
}
|
||||
|
||||
structureMinDist(): number {
|
||||
|
||||
@@ -64,7 +64,7 @@ export class TransportShipExecution implements Execution {
|
||||
|
||||
this.lastMove = ticks;
|
||||
this.mg = mg;
|
||||
this.pathFinder = PathFinder.Mini(mg, 10_000, true, 10);
|
||||
this.pathFinder = PathFinder.Mini(mg, 10_000, true, 100);
|
||||
|
||||
if (
|
||||
this.attacker.unitCount(UnitType.TransportShip) >=
|
||||
|
||||
@@ -27,7 +27,7 @@ export class WarshipExecution implements Execution {
|
||||
|
||||
init(mg: Game, ticks: number): void {
|
||||
this.mg = mg;
|
||||
this.pathfinder = PathFinder.Mini(mg, 5000);
|
||||
this.pathfinder = PathFinder.Mini(mg, 10_000, true, 100);
|
||||
this.random = new PseudoRandom(mg.ticks());
|
||||
if (isUnit(this.input)) {
|
||||
this.warship = this.input;
|
||||
|
||||
@@ -148,7 +148,7 @@ export function bestShoreDeploymentSource(
|
||||
if (t === null) return false;
|
||||
|
||||
const candidates = candidateShoreTiles(gm, player, t);
|
||||
const aStar = new MiniAStar(gm, gm.miniMap(), candidates, t, 500_000, 1);
|
||||
const aStar = new MiniAStar(gm, gm.miniMap(), candidates, t, 1_000_000, 1);
|
||||
const result = aStar.compute();
|
||||
if (result !== PathFindResultType.Completed) {
|
||||
console.warn(`bestShoreDeploymentSource: path not found: ${result}`);
|
||||
|
||||
Reference in New Issue
Block a user