diff --git a/TODO.txt b/TODO.txt
index 91d49f726..75d1ff440 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -101,7 +101,8 @@
* Make more colors DONE 9/8/2024
* Have fake humans join lobby DONE 9/9/2024
* Update landing page image DONE 9/9/2024
-* BUG: fix tile per turn pacing issues
+* BUG: fix tile per turn pacing issues DONE 9/9/2024
+* Improve expansion directions (more uniform) 9/9/2024
--- v3 Release
diff --git a/resources/images/TerrainMapFrontPage.png b/resources/images/TerrainMapFrontPage.png
index 7f1dfaaa2..6b2d41e4b 100644
Binary files a/resources/images/TerrainMapFrontPage.png and b/resources/images/TerrainMapFrontPage.png differ
diff --git a/resources/images/watercolor_worldmap.jpg b/resources/images/watercolor_worldmap.jpg
deleted file mode 100755
index a57c2e72f..000000000
Binary files a/resources/images/watercolor_worldmap.jpg and /dev/null differ
diff --git a/resources/images/world-map.svg b/resources/images/world-map.svg
deleted file mode 100755
index 8c64a9ed6..000000000
--- a/resources/images/world-map.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
diff --git a/resources/images/worldmap.jpg b/resources/images/worldmap.jpg
deleted file mode 100755
index 833ec4873..000000000
Binary files a/resources/images/worldmap.jpg and /dev/null differ
diff --git a/src/client/graphics/TerritoryRenderer.ts b/src/client/graphics/TerritoryRenderer.ts
index f9aa3c289..1fca22723 100644
--- a/src/client/graphics/TerritoryRenderer.ts
+++ b/src/client/graphics/TerritoryRenderer.ts
@@ -69,7 +69,7 @@ export class TerritoryRenderer {
}
}
)
- bfs(event.boat.tile(), dist(event.boat.tile(), 2)).forEach(t => this.paintCell(t.cell(), this.theme.borderColor(event.boat.owner().id()), 255))
+ bfs(event.boat.tile(), dist(event.boat.tile(), 2)).forEach(t => this.paintCell(t.cell(), this.theme.borderColor(event.boat.owner().id()), 180))
bfs(event.boat.tile(), dist(event.boat.tile(), 1)).forEach(t => this.paintCell(t.cell(), this.theme.territoryColor(event.boat.owner().id()), 150))
} else {
trail.forEach(t => this.paintTerritory(t))
diff --git a/src/client/styles.css b/src/client/styles.css
index 93cbf7786..1e4079844 100644
--- a/src/client/styles.css
+++ b/src/client/styles.css
@@ -9,7 +9,7 @@ body {
font-family: 'Overpass', sans-serif;
}
-body {
+/* body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
@@ -20,7 +20,7 @@ body {
background-position: center;
background-attachment: fixed;
background-blend-mode: overlay;
-}
+} */
.content {
max-width: 1020px;
diff --git a/src/core/Game.ts b/src/core/Game.ts
index 3aabb32e1..ceafddfc6 100644
--- a/src/core/Game.ts
+++ b/src/core/Game.ts
@@ -99,6 +99,7 @@ export interface TerraNullius {
}
export interface Player {
+ info(): PlayerInfo
name(): string
clientID(): ClientID
id(): PlayerID
diff --git a/src/core/GameImpl.ts b/src/core/GameImpl.ts
index 7b971eed2..9da94e714 100644
--- a/src/core/GameImpl.ts
+++ b/src/core/GameImpl.ts
@@ -1,3 +1,4 @@
+import {info} from "console";
import {Config} from "./configuration/Config";
import {EventBus} from "./EventBus";
import {Cell, Execution, MutableGame, Game, MutablePlayer, PlayerEvent, PlayerID, PlayerInfo, Player, TerraNullius, Tile, TileEvent, Boat, MutableBoat, BoatEvent, TerrainType, PlayerType} from "./Game";
diff --git a/src/core/configuration/Config.ts b/src/core/configuration/Config.ts
index 542e2634e..4e39784e4 100644
--- a/src/core/configuration/Config.ts
+++ b/src/core/configuration/Config.ts
@@ -36,7 +36,7 @@ export interface Config {
startTroops(playerInfo: PlayerInfo): number
troopAdditionRate(player: Player): number
attackTilesPerTick(attacker: Player, defender: Player | TerraNullius, numAdjacentTilesWithEnemy: number): number
- attackLogic(attacker: Player, defender: Player | TerraNullius, tileToConquer: Tile): {
+ attackLogic(attackTroops: number, attacker: Player, defender: Player | TerraNullius, tileToConquer: Tile): {
attackerTroopLoss: number,
defenderTroopLoss: number,
tilesPerTickUsed: number
diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts
index 62ddbff6f..f4412eab9 100644
--- a/src/core/configuration/DefaultConfig.ts
+++ b/src/core/configuration/DefaultConfig.ts
@@ -33,21 +33,21 @@ export class DefaultConfig implements Config {
}
theme(): Theme {return pastelTheme;}
- attackLogic(attacker: Player, defender: Player | TerraNullius, tileToConquer: Tile): {attackerTroopLoss: number; defenderTroopLoss: number; tilesPerTickUsed: number} {
+ attackLogic(attackTroops: number, attacker: Player, defender: Player | TerraNullius, tileToConquer: Tile): {attackerTroopLoss: number; defenderTroopLoss: number; tilesPerTickUsed: number} {
let mag = 0
let speed = 0
switch (tileToConquer.terrain()) {
case TerrainType.Plains:
mag = 5
- speed = 3
+ speed = 10
break
case TerrainType.Highland:
mag = 15
- speed = 5
+ speed = 20
break
case TerrainType.Mountain:
mag = 45
- speed = 10
+ speed = 40
break
}
@@ -64,13 +64,13 @@ export class DefaultConfig implements Config {
return {
attackerTroopLoss: within(defender.troops() / attacker.troops() * mag, 1, 1000),
defenderTroopLoss: within(attacker.troops() / defender.troops(), 1, 1000),
- tilesPerTickUsed: within(attacker.numTilesOwned() / defender.numTilesOwned() / 2, 1, 5) * speed
+ tilesPerTickUsed: within(defender.troops() / (attackTroops * 5), .2, 3) * speed
}
} else {
return {
attackerTroopLoss: mag,
defenderTroopLoss: 0,
- tilesPerTickUsed: Math.floor(Math.max(speed, 1))
+ tilesPerTickUsed: within(this.startTroops(attacker.info()) / (attackTroops * 5), .2, 3) * speed
}
}
}
diff --git a/src/core/configuration/PastelTheme.ts b/src/core/configuration/PastelTheme.ts
index 50c7cd5e0..a143ccb97 100644
--- a/src/core/configuration/PastelTheme.ts
+++ b/src/core/configuration/PastelTheme.ts
@@ -12,8 +12,8 @@ export const pastelTheme = new class implements Theme {
private land = colord({r: 194, g: 193, b: 148});
private shore = colord({r: 204, g: 203, b: 158});
- private water = colord({r: 110, g: 153, b: 181});
- private shorelineWater = colord({r: 100, g: 143, b: 171});
+ private water = colord({r: 75, g: 142, b: 190});
+ private shorelineWater = colord({r: 100, g: 143, b: 255});
private territoryColors: Colord[] = [
colord({r: 230, g: 100, b: 100}), // Bright Red
@@ -36,7 +36,6 @@ export const pastelTheme = new class implements Theme {
colord({r: 230, g: 180, b: 180}), // Light Pink
colord({r: 120, g: 120, b: 190}), // Periwinkle
colord({r: 190, g: 170, b: 100}), // Sand
- colord({r: 160, g: 100, b: 100}), // Indian Red
colord({r: 100, g: 180, b: 160}), // Aquamarine
colord({r: 210, g: 160, b: 200}), // Orchid
colord({r: 170, g: 190, b: 100}), // Yellow Green
@@ -66,7 +65,6 @@ export const pastelTheme = new class implements Theme {
colord({r: 180, g: 160, b: 180}), // Mauve
colord({r: 160, g: 180, b: 140}), // Dark Olive Green
colord({r: 170, g: 150, b: 170}), // Dusty Rose
- colord({r: 230, g: 100, b: 100}), // Bright Red
colord({r: 100, g: 180, b: 230}), // Sky Blue
colord({r: 230, g: 180, b: 80}), // Golden Yellow
colord({r: 180, g: 100, b: 230}), // Purple
@@ -86,7 +84,6 @@ export const pastelTheme = new class implements Theme {
colord({r: 230, g: 180, b: 180}), // Light Pink
colord({r: 120, g: 120, b: 190}), // Periwinkle
colord({r: 190, g: 170, b: 100}), // Sand
- colord({r: 160, g: 100, b: 100}), // Indian Red
colord({r: 100, g: 180, b: 160}), // Aquamarine
colord({r: 210, g: 160, b: 200}), // Orchid
colord({r: 170, g: 190, b: 100}), // Yellow Green
@@ -164,14 +161,14 @@ export const pastelTheme = new class implements Theme {
case TerrainType.Highland:
return colord({
r: 200 + 2 * mag,
- g: 193 + 2 * mag,
+ g: 183 + 2 * mag,
b: 138 + 2 * mag
})
case TerrainType.Mountain:
return colord({
- r: 220 + mag,
- g: 220 + mag,
- b: 220 + mag
+ r: 230 + mag / 2,
+ g: 230 + mag / 2,
+ b: 230 + mag / 2
})
}
}
diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts
index 7af550d53..ebc8f9fa2 100644
--- a/src/core/execution/AttackExecution.ts
+++ b/src/core/execution/AttackExecution.ts
@@ -6,7 +6,12 @@ import {Terrain} from "../TerrainMapLoader";
export class AttackExecution implements Execution {
private active: boolean = true;
- private toConquer: PriorityQueue = new PriorityQueue((a: TileContainer, b: TileContainer) => a.priority - b.priority);
+ private toConquer: PriorityQueue = new PriorityQueue((a: TileContainer, b: TileContainer) => {
+ if (a.priority == b.priority) {
+ return a.tick - b.tick
+ }
+ return a.priority - b.priority
+ });
private random = new PseudoRandom(123)
private _owner: MutablePlayer
@@ -113,7 +118,7 @@ export class AttackExecution implements Execution {
continue
}
this.addNeighbors(tileToConquer)
- const {attackerTroopLoss, defenderTroopLoss, tilesPerTickUsed} = this.mg.config().attackLogic(this._owner, this.target, tileToConquer)
+ const {attackerTroopLoss, defenderTroopLoss, tilesPerTickUsed} = this.mg.config().attackLogic(this.troops, this._owner, this.target, tileToConquer)
numTilesPerTick -= tilesPerTickUsed
this.troops -= attackerTroopLoss
if (this.target.isPlayer()) {
@@ -159,6 +164,7 @@ export class AttackExecution implements Execution {
this.toConquer.enqueue(new TileContainer(
neighbor,
dist / 100 + this.random.nextInt(0, 3) - numOwnedByMe * 2 + mag,
+ this.mg.ticks()
))
}
}
@@ -195,5 +201,5 @@ export class AttackExecution implements Execution {
class TileContainer {
- constructor(public readonly tile: Tile, public readonly priority: number) { }
+ constructor(public readonly tile: Tile, public readonly priority: number, public readonly tick: number) { }
}
\ No newline at end of file
diff --git a/src/core/execution/BotExecution.ts b/src/core/execution/BotExecution.ts
index 4e6d6bdb7..a0f593521 100644
--- a/src/core/execution/BotExecution.ts
+++ b/src/core/execution/BotExecution.ts
@@ -60,9 +60,16 @@ export class BotExecution implements Execution {
const toAttack = border[this.random.nextInt(0, border.length)]
const owner = toAttack.owner()
- if (owner.isPlayer() && (owner.type() == PlayerType.FakeHuman || owner.type() == PlayerType.Human)) {
- if (this.random.nextInt(0, 1) == 1) {
- return
+ if (owner.isPlayer()) {
+ if (owner.type() == PlayerType.FakeHuman) {
+ if (!this.random.chance(4)) {
+ return
+ }
+ }
+ if (owner.type() == PlayerType.Human) {
+ if (this.random.chance(2)) {
+ return
+ }
}
}
this.sendAttack(owner)