Commit Graph

3707 Commits

Author SHA1 Message Date
evanpelle 41ed31efa3 meta: make sam & missile silo cooldown 90 ticks 2026-05-02 09:39:48 -06:00
evanpelle 1be197229a meta: make tribes slightly weaker to speed up the early game 2026-05-02 09:36:44 -06:00
evanpelle f850bdb605 fix(tests): update AttackStats to expect 50% war gold for human conquests 2026-05-02 09:33:14 -06:00
Evan f90e73c2f7 conqueror receives 50% of gold when conquering a human player (#3818)
## Description:

The motivation is to prevent snowballing players from also gaining too
much gold by conquering other players

- Adds `conquerGoldAmount` to `Config`/`DefaultConfig`: returns 100% of
captured gold for bots/nations, 50% for human players
- Updates `GameImpl.conquerPlayer` to use this amount for the
conqueror's gold gain (the conquered player still loses their full gold)

## 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
2026-05-02 09:23:49 -06:00
Evan bcdc2126c6 bugfix: SAM was only reloading when not in cooldown (#3817)
## Description:

reloadMissile() was inside the isInCooldown() block. For level-2+ SAMs,
isInCooldown() returns queue.length === level, so after firing one of
two missiles (queue.length = 1 < level = 2) the SAM is not in cooldown —
meaning expired timers were never cleaned up. Stale queue entries caused
subsequent shots to be treated as still-cooling even after the cooldown
elapsed.

SAM execution now mirrors the missile silo execution

## 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
2026-05-02 09:05:10 -06:00
evadua f5a91b8aa3 Map accuracy & consistency pass: nation names, spawn positions, and flags across 9 maps (#3780)
## Description:

Comprehensive accuracy and quality-of-life improvements across 8 maps.
No gameplay mechanics changed: only nation names, spawn positions, and
flag codes. All changes bring maps closer to real-world geographic and
historical accuracy.

**Changes by map:**

1. **North America:** Corrected numerous incorrect state spawn
positions. Added all 13 Canadian provinces and territories with correct
flags, as well as a few additional bots for balancing and completeness.
2. **South America:** Corrected spawn positions of Venezuela, Suriname,
and French Guiana. Added four Brazilian states (Amazonas, Pará, Bahia,
São Paulo) for better regional coverage and balancing.
3. **Gateway to the Atlantic:** Full historical consistency pass
targeting the ~1340-1410 CE period, matching the existing Britannia and
Italia map style. Renamed several nations for historical accuracy (Duchy
of Burgundy, Kingdom of Navarre, Kingdom of Majorca, City of Avignon,
Crown of Aragon, Duchy of Aquitaine, Hafsid Sultanate, Marinid
Sultanate, Zayyanid Sultanate, Holy Roman Empire). Added 7 new
historically accurate flag SVGs for these nations.
4. **Europe:** Shortened long-form nation names to short-form for
consistency with other maps. Added Andorra and Monaco for improved
balance.
5. **Europe Classic:** Fixed "Syrian Arab Republic" to "Syria" for
consistency with all other maps. Added Baltic states, Croatia, Denmark,
Sápmi for balancing.
6. **Oceania:** Removed ghost bots that no longer appear on the map.
Fixed truncated and outdated names: Lao PDR to Laos, Brunei Darussalam
to Brunei, TimorLeste to Timor Leste, Taiwan Province of China to
Taiwan.
7. **World:** Fixed outdated names for accuracy and consistency with the
World map and other maps. Added bots in regions lacking coverage for
more consistent global representation.
8. **Giant World Map:** Updated nation names for accuracy and
consistency. Added Canadian provinces, US states, Bolivia, and Gabon for
improved map balance.

All changes made and verified in the map editor. No en.json or UI
changes required as these are map data files only.

## 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:
@islandspiritozempic
2026-05-02 08:33:23 -06:00
VariableVince 775d9a0f0c Chore(deps): Update pixijs to 8.18.1 (#3812)
## Description:

Update pixijs to 8.18.1, mostly because we might want to use the ability
to send AutoDetectRenderer an array as "preference". And because we want
to stay up-to-date with fixes to a renderer we use.

## 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:

tryout33
2026-05-02 08:32:41 -06:00
FloPinguin 0cb17f8086 Fix build: add missing adfree field to ResolveCosmetics test mock 🔧 (#3816)
## Description:

Commit `4d5b7c0` added `adfree: boolean` as a required field to
`UserMeResponseSchema` in `ApiSchemas.ts`, but did not update the mock
object in `tests/ResolveCosmetics.test.ts`. This caused `tsc --noEmit`
to fail with a type overlap error, breaking the production build.

**Fix:** Add `adfree: false` to the `player` mock inside `makeUserMe()`
in the test file.

## 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:

FloPinguin
2026-05-02 08:32:10 -06:00
dependabot[bot] 77462b44eb Bump toshimaru/auto-author-assign from 3.0.1 to 3.0.2 in the updates group (#3813)
Bumps the updates group with 1 update:
[toshimaru/auto-author-assign](https://github.com/toshimaru/auto-author-assign).

Updates `toshimaru/auto-author-assign` from 3.0.1 to 3.0.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/toshimaru/auto-author-assign/releases">toshimaru/auto-author-assign's
releases</a>.</em></p>
<blockquote>
<h2>v3.0.2</h2>
<!-- raw HTML omitted -->
<h2>What's Changed</h2>
<h3>Dependencies</h3>
<ul>
<li>build(deps-dev): bump <code>@​rollup/plugin-commonjs</code> from
29.0.0 to 29.0.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/toshimaru/auto-author-assign/pull/154">toshimaru/auto-author-assign#154</a></li>
<li>build(deps-dev): bump rollup from 4.54.0 to 4.60.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/toshimaru/auto-author-assign/pull/155">toshimaru/auto-author-assign#155</a></li>
<li>build(deps-dev): bump rollup from 4.60.0 to 4.60.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/toshimaru/auto-author-assign/pull/159">toshimaru/auto-author-assign#159</a></li>
<li>build(deps): bump picomatch from 4.0.3 to 4.0.4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/toshimaru/auto-author-assign/pull/157">toshimaru/auto-author-assign#157</a></li>
<li>build(deps-dev): bump rollup from 4.60.1 to 4.60.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/toshimaru/auto-author-assign/pull/162">toshimaru/auto-author-assign#162</a></li>
<li>build(deps): bump <code>@​actions/core</code> from 2.0.1 to 3.0.1 by
<a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/toshimaru/auto-author-assign/pull/150">toshimaru/auto-author-assign#150</a></li>
<li>build(deps): bump <code>@​actions/github</code> from 6.0.1 to 9.1.1
by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/toshimaru/auto-author-assign/pull/160">toshimaru/auto-author-assign#160</a></li>
<li>build(deps): bump googleapis/release-please-action from 4 to 5 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/toshimaru/auto-author-assign/pull/165">toshimaru/auto-author-assign#165</a></li>
</ul>
<h3>Others</h3>
<ul>
<li>chore(main): release 3.0.2 by <a
href="https://github.com/github-actions"><code>@​github-actions</code></a>[bot]
in <a
href="https://redirect.github.com/toshimaru/auto-author-assign/pull/164">toshimaru/auto-author-assign#164</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/toshimaru/auto-author-assign/compare/v3.0.1...v3.0.2">https://github.com/toshimaru/auto-author-assign/compare/v3.0.1...v3.0.2</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/toshimaru/auto-author-assign/blob/main/CHANGELOG.md">toshimaru/auto-author-assign's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2><a
href="https://github.com/toshimaru/auto-author-assign/compare/v3.0.1...v3.0.2">3.0.2</a>
(2026-04-27)</h2>
<h3>Miscellaneous Chores</h3>
<ul>
<li>release 3.0.2 (<a
href="https://github.com/toshimaru/auto-author-assign/commit/658b95bf703955e926268fcaca1124037270bea8">658b95b</a>)</li>
<li>release 3.0.2 (<a
href="https://github.com/toshimaru/auto-author-assign/commit/ca59fc3261247bab40337927fac848bf2a60863f">ca59fc3</a>)</li>
</ul>
<h2><a
href="https://github.com/toshimaru/auto-author-assign/compare/v3.0.0...v3.0.1">3.0.1</a>
(2025-12-25)</h2>
<h3>Miscellaneous Chores</h3>
<ul>
<li>release 3.0.1 (<a
href="https://github.com/toshimaru/auto-author-assign/commit/718d4ed5349747d47952ae841ae03fcbdd74ebea">718d4ed</a>)</li>
</ul>
<h2><a
href="https://github.com/toshimaru/auto-author-assign/compare/v2.1.2...v3.0.0">3.0.0</a>
(2025-12-21)</h2>
<h3>Features</h3>
<ul>
<li>Add <code>npm run package</code> instead of <code>build</code> (<a
href="https://redirect.github.com/toshimaru/auto-author-assign/issues/130">#130</a>)
(<a
href="https://github.com/toshimaru/auto-author-assign/commit/972720f0403d2873e807f16e350c5b0b1be4dda3">972720f</a>)</li>
</ul>
<h3>Miscellaneous Chores</h3>
<ul>
<li>release 3.0.0 (<a
href="https://github.com/toshimaru/auto-author-assign/commit/d100ceff34d1e9cd2c4ea5b8055922f1409f3068">d100cef</a>)</li>
</ul>
<h3><a
href="https://github.com/toshimaru/auto-author-assign/compare/v2.1.1...v2.1.2">2.1.2</a>
(2025-12-16)</h3>
<h3><a
href="https://github.com/toshimaru/auto-author-assign/compare/v2.1.0...v2.1.1">2.1.1</a>
(2024-06-26)</h3>
<h2><a
href="https://github.com/toshimaru/auto-author-assign/compare/v2.0.1...v2.1.0">2.1.0</a>
(2024-01-17)</h2>
<h3><a
href="https://github.com/toshimaru/auto-author-assign/compare/v2.0.0...v2.0.1">2.0.1</a>
(2023-09-26)</h3>
<h2><a
href="https://github.com/toshimaru/auto-author-assign/compare/v1.6.2...v2.0.0">2.0.0</a>
(2023-09-24)</h2>
<h3><a
href="https://github.com/toshimaru/auto-author-assign/compare/v1.6.1...v1.6.2">1.6.2</a>
(2023-01-03)</h3>
<ul>
<li>chore: dependencies update</li>
</ul>
<h3><a
href="https://github.com/toshimaru/auto-author-assign/compare/v1.6.0...v1.6.1">1.6.1</a>
(2022-08-01)</h3>
<ul>
<li>doc: README Update</li>
</ul>
<h3><a
href="https://github.com/toshimaru/auto-author-assign/compare/v1.5.1...v1.6.0">1.6.0</a>
(2022-07-28)</h3>
<ul>
<li>feat: Add auto-author-assign for the issues</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/bdd7688cbf9e6d5683f02f8c7d8ae4062a254b6d"><code>bdd7688</code></a>
chore(main): release 3.0.2 (<a
href="https://redirect.github.com/toshimaru/auto-author-assign/issues/164">#164</a>)</li>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/658b95bf703955e926268fcaca1124037270bea8"><code>658b95b</code></a>
chore: release 3.0.2</li>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/c14bd3bc8fcae805c462193f1fec685b5757fa14"><code>c14bd3b</code></a>
build(deps): bump googleapis/release-please-action from 4 to 5 (<a
href="https://redirect.github.com/toshimaru/auto-author-assign/issues/165">#165</a>)</li>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/ca59fc3261247bab40337927fac848bf2a60863f"><code>ca59fc3</code></a>
chore: release 3.0.2</li>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/725d1cbcd9c65264223e93ed01bae5a1166775b5"><code>725d1cb</code></a>
build(deps): bump <code>@​actions/github</code> from 6.0.1 to 9.1.1 (<a
href="https://redirect.github.com/toshimaru/auto-author-assign/issues/160">#160</a>)</li>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/88a48cc86aa175353a6bedf0f62180f85cba6dc0"><code>88a48cc</code></a>
build(deps): bump <code>@​actions/core</code> from 2.0.1 to 3.0.1 (<a
href="https://redirect.github.com/toshimaru/auto-author-assign/issues/150">#150</a>)</li>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/6a5f2a2150e1a0ba864721da16968b0d612555e3"><code>6a5f2a2</code></a>
build(deps-dev): bump rollup from 4.60.1 to 4.60.2 (<a
href="https://redirect.github.com/toshimaru/auto-author-assign/issues/162">#162</a>)</li>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/7dbebfbadd984a53a3092c634ae3f8054ed4f81d"><code>7dbebfb</code></a>
build(deps): bump picomatch from 4.0.3 to 4.0.4 (<a
href="https://redirect.github.com/toshimaru/auto-author-assign/issues/157">#157</a>)</li>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/49588892f33bafe848a7f70c6960ec7805aabf4a"><code>4958889</code></a>
build(deps-dev): bump rollup from 4.60.0 to 4.60.1 (<a
href="https://redirect.github.com/toshimaru/auto-author-assign/issues/159">#159</a>)</li>
<li><a
href="https://github.com/toshimaru/auto-author-assign/commit/40b645548e95cef9fed45bba6f49491d28a6fe9b"><code>40b6455</code></a>
build(deps-dev): bump rollup from 4.54.0 to 4.60.0 (<a
href="https://redirect.github.com/toshimaru/auto-author-assign/issues/155">#155</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/toshimaru/auto-author-assign/compare/4d585cc37690897bd9015942ed6e766aa7cdb97f...bdd7688cbf9e6d5683f02f8c7d8ae4062a254b6d">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=toshimaru/auto-author-assign&package-manager=github_actions&previous-version=3.0.1&new-version=3.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-02 08:31:50 -06:00
evanpelle d071c8228f Add cache busting to asset urls to bust assets with bad headers 2026-05-02 07:26:06 -06:00
evanpelle 4d5b7c0fb6 Use adfree flag to suppress ads
Adds adfree: boolean to player in UserMeResponseSchema and replaces the flares-length heuristic in Main.ts with a direct check of this field to determine whether ads should be shown.
2026-05-01 18:39:23 -06:00
VariableVince 914c7e750f Remove "uuid" dependency (#3811)
## Description:

One dependency less: remove uuid. It is only used to get the three
random digits after "Anon" if no name is present in localStorage.
Crypto.randomUUID also gives us a UUID v4 and can already be used from
Utils > generateCryptoRandomUUID. Not noticable when it comes to speed
either.

## 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:

tryout33
2026-05-01 17:00:45 -06:00
Patrick Plays Badly a93c466334 Update maps Los Angeles & Dyslexdria (#3809)
## Description:
Removed single pixel line from the bottom of LA map.
Added L.A.X. nation to LA map.
Removed USSR flags from Dyslexdria (originally imported from giant world
map). Left USSR flag on 'Rusha' only.

## 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
PlaysBadly
2026-05-01 13:04:48 +00:00
Ryan df05d21fc2 Clan System Part 2 - UI (#3625)
## Description:

Continuation from #3276 

Adds the complete client-side clan UI as a Lit web component
(`<clan-modal>`), a typed API client with Zod-validated responses,
shared response schemas, and a reusable `<confirm-dialog>` component.


### New: `ClanModal.ts`

| View | What it does |
|------|-------------|
| **My Clans** | Lists joined clans + pending join requests (built from
`/users/@me`, no extra fetches) |
| **Browse** | Search by tag (min 3 chars), paginated results,
configurable per-page (10/25/50) |
| **Clan Detail** | Stats, paginated + searchable member list, role
badges, join/leave/request actions |
| **Manage** | Edit name (max 35 chars) + description, toggle
open/invite-only, disband |
| **Transfer** | Leadership transfer with member selector + confirmation
|
| **Requests** | Approve/deny join requests (leader/officer) |
| **Bans** | View and unban (leader/officer) |
| **My Requests** | View and withdraw outgoing requests |

### New: `ConfirmDialog.ts`

Reusable `<confirm-dialog>` Lit component — replaces native
`confirm()`/`prompt()` which are blocked or broken on mobile and
CrazyGames iframes. Supports danger/warning variants and an optional
textarea (used for ban reasons). Fires `confirm`/`cancel` events.

### New: `ClanApi.ts`

Typed API client covering all clan endpoints. Every response is
Zod-validated. Auth header is always last in the spread (can't be
overridden by callers). Unknown server error messages always fall back
to a generic client-side string — never displayed verbatim.

### New: `ClanApiSchemas.ts` (in `src/core/`)

Shared Zod schemas for clan API responses with max-length constraints on
`name` (35) and `description` (200). Lives in `core/` so it can be
consumed by both client code and the leaderboard table.

### Modified: `ApiSchemas.ts`

- Added `clans` and `clanRequests` arrays to `UserMeResponseSchema`
- Moved clan leaderboard schemas out to `ClanApiSchemas.ts`
- Renamed `LeaderboardClanTagSchema` → `RequiredClanTagSchema`

### Modified: `Api.ts`

- Added `invalidateUserMe()` to bust the cached `/users/me` response
after mutations
- Removed `fetchClanLeaderboard` (moved to `ClanApi.ts`)

### Tests

- `ClanModal.test.ts` — rendering, view navigation, user actions
- `ClanApiQueries.test.ts` — fetch functions, error handling, pagination
- `ClanApiMutations.test.ts` — join, leave, kick, ban, promote,
transfer, etc.
- `ClanApiBans.test.ts` — ban/unban calls and error paths
- `ClanApiSchemas.test.ts` — Zod schema validation edge cases
- `LeaderboardModal.test.ts` — updated imports

## Notable design decisions

- **Not-logged-in state** — shows "Sign in to join clans" instead of
false "no clans" empty state
- **Rate limit feedback** — reads `Retry-After` header and surfaces wait
time to the user

## 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:

w.o.n

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2026-04-30 21:27:35 -06:00
evanpelle 38bbef6ecf update structure icon filename to bust cache, previous assets had bad headers 2026-04-30 20:18:38 -06:00
evanpelle 1f549d0a03 add malibu glow on hover to ranked, join, create lobby buttons 2026-04-30 17:23:11 -06:00
evanpelle 02353cf77d Fix nuke cancellation on alliance to use blast radius
cancelNukesBetweenAlliedPlayers previously only cancelled a nuke if its exact target tile was owned by the new ally. This meant nukes aimed at neutral or own tiles near allied territory would survive alliance formation and still land (and break the alliance).

Now uses wouldNukeBreakAlliance — the same blast-radius logic used by maybeBreakAlliances on impact — so a nuke is cancelled if its blast would have meaningfully hit the ally's tiles or structures. Also switches from the exhaustive listNukeBreakAlliance (scans all players) to wouldNukeBreakAlliance with a single-player allySmallIds set for early-exit performance.
2026-04-30 17:17:46 -06:00
Evan 8a638a3842 perf(UnitLayer): batch trail clears to fix O(n²) cost on mass nuke explosions (#3808)
## Description:

When multiple nukes detonated in the same tick, clearTrail was called
once per dying unit. Each call scanned all remaining units to repaint
overlapping trail tiles — O(dead × alive × trail_len) per tick.

Replace with a deferred batch: dying units are queued into
pendingTrailClears during drawUnitsCells, then flushTrailClears()
processes them all at once after the draw pass. All trail tiles are
cleared in a single loop (skipping duplicates), followed by one repaint
scan of surviving units — O((dead + alive) × trail_len).

Also fixes a minor bug in the original: the surviving unit's
relationship is now used when repainting its trail (previously the dying
unit's relationship was used, which gave wrong colors in alternate-view
mode).

## 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
2026-04-30 16:57:35 -06:00
Evan ccb80f4245 Fix warship diagonal chase and improve trade ship capture reliability (#3807)
## Description:

The warship pathfinder operates on a 2x downscaled mini-map, and
upscaling mini-map paths back to full coordinates produces diagonal
interpolated steps. At close range (< 20 tiles), the entire path
consists of these diagonal moves, causing the warship to approach the
trade ship at an awkward angle and never converge cleanly.
## 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
2026-04-30 16:37:44 -06:00
babyboucher 4f20d2b332 TypeScript update to 6.0.3 (#3806)
## Description:

Updating TypeScript to 6.0.3.
Updating TypeScript-eslint to 8.59.1 for TS6 support.
Concurrently needed to get updated as well to remove deprecated warning.

Most things deleted are now just defaults.

## 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:

Babyboucher
2026-04-30 15:49:24 -06:00
Zixer1 742a544a69 2661 PR 3/3 Warship Manual Override, Aggro Override, and Heal-at-Port Command (#3501)
Part of [#2661](https://github.com/openfrontio/OpenFrontIO/issues/2661)
(split into 3 PRs so they are not too large..)

## Description:

Part 3/3 of
[#2661](https://github.com/openfrontio/OpenFrontIO/issues/2661).

This PR adds the retreat control and override behavior for warships:

- Manual override: moving a warship manually cancels retreat and
suppresses auto-retreat for 5 seconds
- Aggro override: a retreating warship will aggro a nearby enemy
transport or warship before continuing retreat
- Heal-at-port command for sending a warship to a friendly port manually
- Friendly-port validation for HealAtPortExecution
- Regression tests for manual override, aggro override, and heal-at-port
behavior



## 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:

zixer._

---------

Co-authored-by: iamlewis <lewismmmm@gmail.com>
Co-authored-by: evanpelle <evanpelle@gmail.com>
2026-04-30 13:54:28 -06:00
Aotumuri f1d0136a06 mls (v5.3) (#3804)
## Description:

Version identifier within MLS: v5.3

[Changed languages]
- fr
- ru
- uk

[Change volume]
- Changed languages: 3
- Changed files: 3
- Changed lines: 6165
- metadata.json: unchanged

Final reviewer: meow02952

This PR was generated by the PR sender tool, then checked and submitted
by the final reviewer.

## 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:
aotumuri
2026-04-30 09:15:30 -06:00
evanpelle 335083047a Merge branch 'v30' 2026-04-29 22:30:33 -06:00
Evan 1776ae4f35 go to player on spawn start (#3802)
## Description:

Some new players were having trouble finding themselves on game start

* Emits a GoToPlayerEvent (zoom=8) on the first turn after the spawn
phase, using a hasGoneToPlayer flag to ensure it only fires once per
session
* Adds a zoom parameter to GoToPlayerEvent so callers can specify a
target zoom level
* Adds smooth zoom animation to TransformHandler — the camera now eases
to the target scale alongside the existing position easing, with
screen-center correction to avoid visual jumping on mobile (where canvas
and map dimensions differ)
* Moves GoToPlayerEvent, GoToPositionEvent, and GoToUnitEvent out of
Leaderboard.ts into TransformHandler.ts, where they logically belong

## 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
2026-04-29 22:29:41 -06:00
VariableVince f304141338 Fix/refactor/optim(StructureIconsLayer): restore structure icons after context loss, use WebGL/WebGPU/Canvas, and some improvements (#3654)
## Description:

StructureIconsLayer and StructureDrawingUtils fixes and improvements.
Most notably have it restore structure icons after webGL context loss.

Inspired by @Skigim's
https://github.com/openfrontio/OpenFrontIO/pull/3339,
https://github.com/openfrontio/OpenFrontIO/pull/3480. Fixes his
https://github.com/openfrontio/OpenFrontIO/issues/3207, contains only
those fixes from the Issue that are actually valid and needed fixes, on
top of his earlier merged PR.

### CONTAINS (partly written by AI, excuse the exaggerated language)

**1.**
* ** AutoDetectRenderer: ** now, if Hardware Acceleration is unavailable
or disabled, Structure Icons will be displayed using Canvas renderer.
Otherwise it will use either WebGL or WebGPU, depeding on which is
available. PixiJS currently prefers WebGL but it will switch this to
WebGPU at one point. We can also force it to WebGPU as explained in the
comment.
* ** Canvas: ** on Canvas, what doesn't work is gracefully skipped. The
non-working parts will be fixed, see this issue in their repo, but until
then it will work fine for us anyway:
https://github.com/pixijs/pixijs/issues/11981
* **WebGPU Context Loss:** PixiJS doesn't restore this context itself.
Instead we do it by calling setupRenderer again on device loss.
* **WebGL Context Loss:** To know when we need to restore the layer,
don't use native event (`webglcontextrestored`) but use PixiJS's
internal hook (`this.renderer.runners.contextChange`). This prevents our
cache-clearing commands from interrupting Pixi while it's still busy
rebuilding its internal GL State Machine buffer. With links severed, we
need to clear and rebuild all icons to restore them.
* **WebGL Context existance Check (`this.renderer.context?.isLost`):**
This prevents a crash in PixiJS. Fixes black map background and all
graphics frozen, which has been reported a few times. Issue created in
their repo: https://github.com/pixijs/pixijs/issues/12032.
* **Redraw:** for Canvas context restore or on Alt-R, a call from
GameRenderer now actually restores icons. Also called for WebGPU device
loss and after contextChange WebGL restoration. Checks for WebGL
context.isLost so a calls from Alt-R etc won't meddle while GL context
is lost.
* **Orphaned Object Leaks:** In PixiJS v8, `Container.destroy()` does
*not* recursively destroy its children. This PR explicitly adds
`.destroy({ children: true })` inside icon deletion states. This stops
thousands of `PIXI.Sprite` and `PIXI.BitmapText` child nodes from
leaking and choking Pixi when it attempts a WebGL restore.
* **Texture Lifecycle:** Invalidate caching logic in `SpriteFactory` now
correctly executes `.destroy(true)` on `PIXI.Texture` objects.
Previously, they were only deleted from the textureCache Map, retaining
a phantom grip on GPU memory buffers.
* **Don't remove PIXI.Texture.EMPTY from textureCache: `createTexture()`
in `SpriteFactory` stores `PIXI.Texture.EMPTY` (a singleton) in
`textureCache` when a structure type has no known shape. When not
preventing removal of the EMPTY texture, `clearCache()` would call
`texture.destroy(true)` on PixiJS's shared global empty texture,
breaking all sprites in the renderer that fall back to it.

**2. Small Memory/Perf Optimizations**
* **The Shared 2D Canvas Optimization:** To prevent allocating endless
tiny `<canvas>` elements every time a structure color is loaded,
`SpriteFactory` now utilizes a cleanly shared `colorCanvas` singleton.
To keep this safe from hardware acceleration crashes (where the 2D
context dies alongside WebGL), it accurately nullifies itself in
`clearCache()` and lazily instantiates on the next call
(`getImageColored()`).
* **Bypassing Inefficient Textures Cache:** Now passing the `skipCache:
true` argument implicitly to dynamic UI elements via
`PIXI.Texture.from(structureCanvas, true)`.
* **Zero-Allocation Filters (No more GC Stutters):** `renderGhost()`
previously spawned numerous `new OutlineFilter(...)` WebGL shaders when
hovering over invalid tiles, compounding to many leaked Shader Programs.
We hoisted these filters to static class properties initialized once,
and went a step further: hoisted the wrapping Array structures too
(`filterRedArray`, `filterGreenArray`). This eliminates many pointless
micro-allocations and GC sweeps entirely.

**BEFORE, for webGL:**
https://youtu.be/durJxNFNePs

**AFTER, for WebGL:**
https://youtu.be/VnYEFMx4gfM

**AFTER, for Canvas:**
https://youtu.be/zT720oKxcaI

**AFTER, for WebGPU:**
https://youtu.be/J09Wee2qTs8

The performance optimizations weren't well measurable in my tests but
there's no downgrade at least. WebGPU should bee better than WebGL when
we would force it but again, currently PixiJS prefers WebGL hardcoded so
only if we disallow WebGL will it use WebGPU if it is available,
otherwise fallback gracefully to Canvas still.

Canvas skips parts gracefully, as long as the non-breaking issue exists
in PixiJS (as explained above):
<img width="952" height="705" alt="AFTER Canvas in Firefox skips
non-supported gracefully"
src="https://github.com/user-attachments/assets/17e8d8ab-05dc-47cb-ab11-f0f4d015a42a"
/>

## 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:

tryout33

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-29 20:40:02 -06:00
FloPinguin dd52e976e5 Fix broken logo in README 🖼️ (#3799)
## Description:

The README referenced `resources/images/OpenFrontLogo.svg` and
`resources/images/OpenFrontLogoDark.svg`, but those files do not exist
at that path. The actual logo SVGs live under `proprietary/images/`.
Updated all three `<picture>` element references to point to the correct
directory so the logo renders properly on GitHub.

## 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:

FloPinguin
2026-04-29 17:17:33 -06:00
FloPinguin 2a76a63e32 Restrict ArchipelagoSea to special rotation only 🗺️ (#3798)
## Description:

ArchipelagoSea is a very "special" map with the extreme amount of tiny
islands, and the map maker said "could there be a way to make
Archipelago Sea have 5M or 25M starters more often? I feel like the map
is too unorthodox to be played in normal settings"

So lets restrict it to the special rotation, like arcade maps. People
expect crazy-stupid games there.

## 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:

FloPinguin
2026-04-29 16:58:24 -06:00
Evan 063704fa0d Use OpenFront font for version (#3795)
## Description:

<img width="276" height="178" alt="Screenshot 2026-04-29 at 4 18 23 PM"
src="https://github.com/user-attachments/assets/ed2d0416-00c2-4d55-8ee1-d7804b6276ab"
/>


## 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
2026-04-29 16:19:56 -06:00
Ryan c2567b48c6 reword to Public Player ID (#3797)
updates wording to "Public Player ID"

## Description:

Describe the PR.

## 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:

w.o.n
2026-04-29 16:10:29 -06:00
evanpelle 67a42c2fac add malibu glow on edge of lobby card on hover 2026-04-29 13:58:00 -06:00
evanpelle 4b66e40327 move homepage background down 2cm 2026-04-29 13:52:36 -06:00
Evan 2994a5f848 Start game via WebSocket intent (#3794)
## Description:

Replaces the HTTP POST /api/start_game/:id endpoint with a WebSocket
intent, making private game start consistent with how kick_player and
update_game_config already work. Also verifies that only the lobby
creator can start a game.

## 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
2026-04-29 13:26:14 -06:00
evanpelle 58cb86cb6b Add CLAUDE.md 2026-04-29 12:49:19 -06:00
babyboucher bd6c63b6ea Nation ship improvements (#3724)
## Description:

Nations preform poorly on large water maps, these changes aims to
improve how they handle and react to water combat.

Adding the ability for hard and impossible nations to retaliate against
incoming transport ships.
Adding the ability for ships to be moved if the nation is not able to
build a new ship.

## 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:

babyboucher

---------

Co-authored-by: iamlewis <lewismmmm@gmail.com>
Co-authored-by: FloPinguin <25036848+FloPinguin@users.noreply.github.com>
2026-04-29 18:18:00 +00:00
evanpelle 3476bfc674 Changed the default in UserSettings.ts:386 from 1 to 0. New users (or anyone who hasn't touched the slider) will now start with sound effects muted. 2026-04-28 21:39:31 -06:00
RickD004 a989bcbeb0 Rename Mediterranean to Mare Nostrum 🏛️ (#3768)
## Description:

Change inspired by Territorial.io . Renames the Mediterranean sea map to
Mare Nostrum, the ancient name of the sea given by the Romans. The NPCs
of the map are already roman provinces, so this change is more thematic
and also adds a creative name like "Gateway to the Atlantic" and
"Between Two Seas"

## 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:

tri.star1011
2026-04-28 19:15:29 -06:00
Evan d00425871d Fix cross-browser CSS-mask CORS failures for OpenFrontLogo and SoldierIcon (#3792)
## Description:

Cross-origin CSS-mask icons were failing on Chrome and Safari because
mask: url(...) triggers a CORS-mode fetch (unlike plain <img>), and
stale browser caches without ACAO break per-user. Instead change the
svgs with the appropriate colors so we don't need to mask them

## 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
2026-04-28 18:35:07 -06:00
FloPinguin 7654537a00 Much better river handling for nations and tribes! 🏞️ (#3786)
## Description:

In this example, the two nations DONT see each other as neighbors, but
as ISLANDERS. Because they dont have a direct border connection, there
is water in between.

<img width="526" height="329" alt="image"
src="https://github.com/user-attachments/assets/cf2c15b5-7793-4445-afd2-920d6cd50a2a"
/>

This is a big problem, because most of the logic in AiAttackBehavior
gets ignored. Only the "islander" strategy runs (late, because its a
not-important strat).

### Summary

- `PlayerImpl.neighbors()` now includes cross-water neighbors: a new
`shoreReachableNeighbors()` helper samples every 10th shore border tile
and looks up to 5 tiles in each cardinal direction across water, finding
land owners on the other side (covers rivers up to 4 tiles wide).

- `AiAttackBehavior.maybeAttack()` extends the `hasNonNukedTerraNullius`
check to also trigger on TN detected via `player.neighbors()`, so
nations notice and pursue TN that is only reachable across a river.

- `sendAttack()` uses a new `hasLandBorderWithTerraNullius()` land-only
adjacency check to decide between a land attack and a boat attack for
TN, rather than `sharesBorderWith()` which includes water tiles.

- Added `sendBoatAttackToNearbyTerraNullius()`: when no TN land is
directly adjacent, the AI scans its shore border tiles for unowned land
across water and dispatches a transport ship.

### Also works for Tribes!

Tribes can boat rivers now, really cool.


https://github.com/user-attachments/assets/382e85aa-c437-4e0c-afc2-0c381432da3d

## 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:

FloPinguin
2026-04-28 18:25:11 -06:00
FloPinguin 692028d033 Make nations more forgiving toward humans on Easy difficulty 🕊️ (#3791)
## Description:

- Nations on Easy no longer betray human allies
- Nations on Easy now attack humans only 25% of the time (down from 50%)
- Increased Easy reaction tick range (65-100, up from 65-80) so nations
respond more slowly
- Raised MIRV steamroll-stop thresholds on Easy (city gap multiplier 1.5
-> 2, min leader cities 15 -> 20) and slightly tuned Medium/Hard
thresholds

## 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:

FloPinguin
2026-04-28 13:56:05 -06:00
Giovanni 7d41f0dfbb fix: add copy button for game ID in game history details (#3783)
Resolves #3755

## Description:

The game ID in the history details panel was displayed as plain 
unselectable text, making it difficult to copy. 

Replaced the static text div with the existing <copy-button> 
component in compact mode, which allows users to click the game ID 
to copy it to clipboard instantly.

No screenshot provided — feature requires a logged-in account to access
game history. The change replaces a static text div with the existing
<copy-button compact> component on line 118 of GameList.ts.

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] 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
2026-04-28 12:00:08 -06:00
evanpelle 70f425e354 emit sound when structure starts building not on completion 2026-04-28 11:15:29 -06:00
Evan 01b3cbe332 Set crossOrigin = "anonymous" on canvas-bound icon images (#3789)
## Description:

StructureLayer.loadIcon and StructureDrawingUtils.loadIcon hand-roll new
Image() and feed the result into a canvas. With assets now served from a
cross-origin CDN, the default no-cors fetch tainted the canvas, and
WebGL's texImage2D rejected the upload `Uncaught SecurityError: Tainted
canvases may not be loaded`. Setting crossOrigin = "anonymous" before
src switches to a CORS-checked fetch (R2 already returns ACAO), so the
canvas stays clean and the texture upload succeeds.

Other new Image() and <img> sites in the codebase don't need the change
— they're either DOM-only or read naturalWidth/naturalHeight only.

## 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
2026-04-28 09:53:22 -06:00
evanpelle fc45410ee5 Remove the ticks() % 5 gate in TerritoryLayer.spawnHighlight() so the spawn highlight redraws every frame instead of every 5th frame. 2026-04-27 22:13:23 -06:00
Patrick Plays Badly 79ac66df3c Add map los angeles (with roads) (#3708)
## Description:

Add Map - Los Angeles (With Roads)
Whats NY without LA? What is LA without its roads? Here is a larger map
where I have turned LAs road network into rivers. Nations named to areas
of the city or surrounding area. Map geo data is from OpenTopography. I
stenciled the highways from screenshots of online maps and some artistic
choice.


https://discord.com/channels/1284581928254701718/1482605671697613081/1482605671697613081
https://www.youtube.com/watch?v=6td9wiQKE9s

## 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

##Discord username
PlaysBadly

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2026-04-27 22:05:17 -06:00
Evan 0c0f9c2a81 Update attack labels (#3784)
## Description:

The motivation behind this PR is to standardize colors & icons for
incoming and outgoing attacks. Outgoing attacks are always aquarious and
incoming are red. This also makes it much easier to see which attacks
are incoming vs outgoing at a glance, as previously the color changed
depending on attack effictiveness. Instead, show a small bar on the left
side that displays attack effectiveness.

<img width="498" height="456" alt="Screenshot 2026-04-27 at 12 58 53 PM"
src="https://github.com/user-attachments/assets/ea6928b3-5dfa-47fa-84d2-63e1e81ef6a4"
/>


Updates the in-game attack labels to match AttacksDisplay: a single
soldier icon recolored via CSS filters, aquarius for outgoing and
red-400 for incoming. Color is now purely directional — the previous
attacker-vs-defender comparison (and the troopAttackColor /
troopDefenceColor helpers that drove it) is gone, along with the
defenderTroops plumbing.

Also adds zoom-aware sizing via a new computeLabelScale(zoom) (full
screen size when zoomed in, linear shrink with a floor so labels never
disappear), bumps font/padding/snap-jump threshold for readability, and
moves immutable per-label DOM writes (icon src/filter, color) into
element creation so the per-tick path only updates the troop count.

Also fixes a bug where the labels kept swapping when 2 clusters where
similar size

## 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
2026-04-27 20:53:09 -06:00
Evan 4aa726cfd8 Serve hashed assets from R2 via CDN_BASE (#3773)
## Description:

Add an optional CDN_BASE env var that prefixes hashed asset URLs from
asset-manifest.json, so the app can serve static assets from R2/CDN
instead of the app origin. The value is determined at runtime via the
EJS template (window.CDN_BASE) — empty string means "same origin,"
matching today's behavior.

A hack to load the worker bundle:

A same-origin Blob script that dynamic-import()s the cross-origin worker
module and buffers early postMessage calls until the imported module's
handler attaches, sidestepping the browser's refusal to construct a
Worker directly from a cross-origin URL.

## 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
2026-04-27 11:27:54 -06:00
Giovanni 4aeece4aef fix: render spawn highlight on 1/5 frames instead of 4/5 (#3782)
Resolves #3590

## Description:
The spawnHighlight() function in TerritoryLayer.ts was using `=== 0` 
as the condition to return early, which caused the spawn highlight to 
render on 4 out of every 5 frames instead of the intended 1 out of 5. 
Changed `=== 0` to `!== 0` so the function skips rendering on 4/5 
frames, improving performance especially on large maps.


## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [ ] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [ ] 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
2026-04-27 08:49:08 -06:00
FloPinguin 408d0e4862 Improve TribeExecution deleteAllStructures 🏛️ (#3777)
## Description:

`deleteAllStructures` did not check for `isMarkedForDeletion`, not very
clean. Now its clean.
Also rename to `deleteNextStructure` because its not possible to delete
more than 1 structure at a time.

## 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:

FloPinguin
2026-04-26 19:10:27 -06:00
FloPinguin 8099b9fad7 Massive nation improvement 🤖 (#3761)
## Description:

- Hard / Impossible nations in team games auto-stop trading with all
enemies
- If there are a LOT of nations on the map (Enzo stream with 400 nation
HvN private games) they no longer start with a city, they start with eco
(port / factory) because they cannot gain much gold from bot-killing
- Impossible nations built way too many missile silos sometimes, caused
by the SAM overwhelming logic. Fixed now.
- In public HvN games with 5M starting gold, nations placed their
structures way too fast, which slowed down their expansion. And humans
could easily cause a lot of damage with one atom bomb. Now their first
structure is a SAM (on hard / impossible) and they wait between their
earlygame structure placements.
- Nations now spread out their port placements more evenly
- Nations are now able to attack much stronger enemies in team games
(They can expect donations)
- Improve performance a bit by adding more early-returns (Dont run any
nuking logic if nukes are disabled, no alliance logic if alliances are
disabled, no boating logic if transport boats are disabled, ...)
- Fix some of the "cannot send troops" messages in the console
(DonateTroopExecution)
- Nations build their first missile silo sooner, they should also build
more SAMs
- Nations spend their gold better after reaching the save-up-target
(previously they stopped nuking)
- Optimized save-up-targets for team games
- The richest impossible nation is nuking very dense players now (lot of
structure levels on a small island)

### How does a 5M gold HvN start look like now?


https://github.com/user-attachments/assets/e9da89c3-c0d4-4144-a741-3101746b16da

## 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:

FloPinguin
2026-04-26 18:43:45 -06:00
Zixer1 c0febacb8e 2661 PR 2/3 Warship Port Healing, Docking Capacity, and Waiting Behavior (#3499)
Part of [#2661](https://github.com/openfrontio/OpenFrontIO/issues/2661)
(split into 3 PRs so they are not too large..)

## Description:

Part 2/3 of
[#2661](https://github.com/openfrontio/OpenFrontIO/issues/2661).

This PR adds port-based healing and docking behavior:
- Passive healing near friendly ports
- Active docked healing pool scaled by port level and shared across
docked ships
- Docking radius and capacity-by-port-level behavior
- Waiting behavior near full ports until a slot opens
- Auto-undock once fully healed

For the active healing, it works like `ActiveHeal = (PortLevel * 5) /
DockedShipsAtThatPort`
Ex:
1 ship at level 1 port -> +5 HP/tick
1 ship at level 2 port → +10 HP/tick
2 ships at level 3 port → +7.5 HP/tick each

Includes regression tests covering healing math and docking/waiting
behavior.

## 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:

zixer._
2026-04-26 21:42:13 +00:00