Commit Graph

1212 Commits

Author SHA1 Message Date
Evan 075c232d8a improve game websockt (re)connection (#2584)
Previously, the connection and reconnection logic were identical in
Worker.ts, so clients would need to be re-authorized for cosmetics etc
even when reconnecting. Now, on reconnect, Worker.ts only does
authentication - verifying the jwt is valid.

This will allow clients to require a valid turnstile token when first
connecting, and not when reconnecting after a broken ws connection.

## 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
2025-12-08 14:07:07 -08:00
DevelopingTom d694f61517 Add factory & train emojis (#2522)
## Description:

Add 🏭 & 🚂 emojis, which is commonly requested. Also 3 other emojis to
fill the new emoji line: 🫴🙏

To be discussed: this adds a new line in the emoji list: is it too much?
Eventually we could use categories to filter the emojis.

<img width="199" height="465" alt="image"
src="https://github.com/user-attachments/assets/cb6a44e9-30cd-48f7-90ab-8a7c32dcd180"
/>

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

IngloriousTom
2025-11-26 16:40:19 -08:00
VariableVince e99bf6360c Fix: prevent desync after clan team assignment for profane username (#2511)
## Description:

Clan tag was removed when overwriting profane username. The local player
still sees the name they put in though, and are assigned to a team based
on the clan tag. Other player's browsers don't assign them to their team
because the clan tag isn't visible to them.

**Fixes:**
- GameRunner.ts > username.ts: fetch clan tag before potentially
overwriting bad username. Prepend non-profane clan tag back to the name
string afterwards.

- Util.ts: added getClanTagOriginalCase; we can't use getClanTag in
censorNameWithClanTag because it returns all caps and we needed to
retain the orginal capitalization. Explained in code comment.

- Game.ts: no changes. By keeping the getClanTag in PlayerInfo
contructor, TeamAssignment still gets clan param to correctly assign
clan teams, other players get to see the clan tag of the "BeNicer"
player, and GameServer archivegame() and LocalServer endGame() can still
do getClanTag to have the same data at the end of the game, and test
files keep working.

**Screencap after fix:**

https://github.com/user-attachments/assets/564c0ffd-577e-4653-ba33-155d2135a9f0

## 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
2025-11-25 20:10:27 -08:00
evanpelle c8fb8e7f04 record stats for factory build and capture 2025-11-25 15:47:12 -08:00
evanpelle cf7e658d3d Remove yenisei because there is no source in map-generate/assets so the map cannot be rebuilt 2025-11-20 19:18:37 -08:00
unique-coder-124 599342995c fix(2388): troop penalty applied to boat retreat (#2389)
Description:
There is a boating exploit where players could repeatedly send and
retreat boats to effectively increase troop regeneration and maintain
almost double the max troop cap. This PR fixes #2388.

Summary
This pr adds a troop penalty to the boat retreats in
src/core/execution/TransportShipExecution.ts of 25 percent (currently
the same as land attacks, but may require fine tuning). this prevents,
to some degree, the ability to stockpile large amounts of troops above
your max cap.

Testing
I tested the change locally and confirmed that the troop penalty is
applied at the correct times and under the correct conditions, i.e. it
is only applied on successful retreat (applying on reteat initiation may
be confusing if you are told you have lost troops if the transport ship
never arrives anyway). The boating exploit is far less effective with
this fix in place.

Notes
- This is a exploit and does not introduce any new features.
- Existing game behavior outside the retreat penalty remains unchanged.
- The attack message is the same as the land attack, so the translation
should already be present.

Checklist
- [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

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-19 12:37:48 -08:00
Hauke12345 dcf5d1b103 Fading handshake (#2474)
## Description:
Add dynamic alliance icon with time-based fill and extension request
indicator

- Implement bottom-up green fill on alliance icon proportional to
remaining time
- Use AllianceIconFaded.svg as base layer with green overlay clipped
from top
- Add 20-82.40% clip range to account for icon vertical offset 

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


<img width="1132" height="631" alt="Screenshot 2025-11-18 205205"
src="https://github.com/user-attachments/assets/4af71ddc-f847-4460-9046-167275efc773"
/>
<img width="1387" height="792" alt="Screenshot 2025-11-18 205532"
src="https://github.com/user-attachments/assets/9dd0e018-323f-4de1-bae8-2633c09fe867"
/>

## Please put your Discord username so you can be contacted if a bug or
regression is found:
hauke4707

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-19 12:32:01 -08:00
evanpelle 807151b723 Revert "Improve random spawn (#2465)"
This reverts commit 2b2200c808.
2025-11-19 10:58:49 -08:00
Evan 0ba709c40d Create clan stats modal (#2479)
Resolves #2452

## Description:

Created a Clan Stats PR to show top clans. In another PR we can show the
player leaderboard to show top players.

Based on PR from https://github.com/Geekyhobo

<img width="659" height="792" alt="Screenshot 2025-11-19 at 10 00 40 AM"
src="https://github.com/user-attachments/assets/9333b7e2-2357-47a6-a7c8-788cf81e9be3"
/>


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

Co-authored-by: Geekyhobo <geekyhobo@users.noreply.github.com>
2025-11-19 10:34:23 -08:00
Mykola 2b2200c808 Improve random spawn (#2465)
## Description:

After the v27 playtest, some players experienced instant death on spawn.
The issue was that the human random spawn occasionally coincided with a
bot’s spawn. Previously, bot spawns didn’t account for human spawn
locations and could appear on the same tile, now they don’t.

## Please complete the following:

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

nikolaj_mykola

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-18 15:07:25 -08:00
VariableVince 9c24d29824 AFK team mate v2: better ship handling + tests + bugfix (#2396)
## Description:

See PR https://github.com/openfrontio/OpenFrontIO/pull/2203

It was reverted. This unreverts it, with an added fix for boat troops
not getting returned to owner. And small comment updates. And a const
for boatOwner to re-use.

The added bugfix is check for this.sourceTile === null in the retreat()
function in AttackExecution. A boat attack always sets removeTroops to
false because the troops were already removed from owner troops when the
boat departed. They don't have to be removed again in AttackExecution
init, when the boat lands and the attack starts. But at the end of the
attack, in retreat() in AttackExecution, the starting/boat troops still
need to be returned to the owner. That's why even if removeTroops is
false, when sourceTile is not null (only when it's a boat attack) we add
back the troops to the owner.

## 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: Fx Morin <28154542+FxMorin@users.noreply.github.com>
Co-authored-by: Ryan <7389646+ryanbarlow97@users.noreply.github.com>
2025-11-18 14:57:33 -08:00
Mike Harris 2b44b68362 Feature - Improve Structure Color Contrast (#2454)
If this PR fixes an issue, link it below. If not, delete these two
lines.
Resolves #2447

## Description:

This PR updates the logic used to generate structure fill and border
colors. Currently, (v0.26.16 and earlier), some light territory colors
have structures that are difficult to see and identify. This PR ensures
that all territory colors have structures that are easily visible.

Instead of using `Colord.lighten()` and `Colord.darken()` to generate
structure colors, the logic now:
- queries the territory color and border color of the structure owner
- Converts these colors to the [LAB color
space](https://en.wikipedia.org/wiki/CIELAB_color_space) (which is a
human-perception-uniform color space).
- Darkens the border color (by decreasing LAB luminance) and sometimes
lightens the territory color (by increasing LAB luminance) until a
specific `Color Delta` is achieved (currently `delta > 0.5`)
- This ensures contrast between the structure and the territory
background.

Additionally, this PR re-organizes colors in the `Colors.ts` file for
better visibility and removes redundant colors from the `nationColors`
list.

This PR is an implementation of the proposed mock-up posted on imgur in
issue #2447. Screenshots of the original, final, and side-by-side
comparison of structure colors (for all available player colors) are in
the [imgur
album](https://imgur.com/a/openfront-color-playground-4cxSbbj).

I'd recommend inclusion as a feature/fix for v27.

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

GlacialDrift
2025-11-16 20:58:34 -08:00
FloPinguin 0200df3ce1 Let nations send retaliation warships! (#2376)
## Description:

This PR is intended to increase singleplayer fun.
This is a follow-up to my previous PR #2161, which made the
"Hiding-Strategy on small islands" harder.

But its still possible. You can easily warship-infest the map and get
rich from the trade, even though you are playing on impossible
difficulty.
Also you can easily hinder the nations to, for example, get from the
left to the right side of the world map. So you are always in full
control of the game.

This PR makes nations send a warship if their troop transport boat got
destroyed. The warship will travel to the location where the boat got
destroyed.
Because the nations send more boats now (previous PR), this actual has
an impact and there is more action on the map now :)

The chance of retaliation is based on the game difficulty.

### COMPARISON

[Youtube Video](https://www.youtube.com/watch?v=F4_iP54LGNU) of me
playing the infestation-strat without this PR.

[Youtube Video](https://www.youtube.com/watch?v=VHesXJwPtcA) of me
playing the infestation-strat with this PR (Its sill possible but not
that easy, I gave up lol).

## 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
2025-11-11 14:41:10 -08:00
Ryan 34251c0673 lobby fill time added to stats (#2382)
## Description:

Finishes & closes #1969 and closes #1806.

## 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: Evan <evanpelle@gmail.com>
2025-11-10 19:53:25 -08:00
Rj Manhas 6a78494404 Added notifcation when a player wants to renew (#2391)
## Description:

Describe the PR.

Added a new chat message from the server once player wants to renew the
alliance, to the other player.

## Please complete the following:

- [x] I have added screenshots for all UI updates

<img width="572" height="256" alt="image"
src="https://github.com/user-attachments/assets/7feec21f-fff5-4544-8992-caf99c45913d"
/>

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

DISCORD_USERNAME

notifxy (1379678982676676639)
2025-11-08 13:48:05 -08:00
evanpelle d16a2485e3 Merge branch 'v26' 2025-11-07 19:54:27 -08:00
Mykola 25ea11114e Random spawn (#2375)
## Description:

https://github.com/openfrontio/OpenFrontIO/issues/2352

This is my first PR in this project, and I’ll continue refining it based
on feedback.

<img width="1088" height="859" alt="image"
src="https://github.com/user-attachments/assets/07f4f8b1-52fa-4136-add4-19b00aefd963"
/>

<img width="1157" height="783" alt="image"
src="https://github.com/user-attachments/assets/1c5be80d-72f8-4ead-8d4b-706a3a04fd73"
/>

<img width="1488" height="777" alt="image"
src="https://github.com/user-attachments/assets/4d743548-f0c3-4579-963b-43676f68fab1"
/>

<img width="1499" height="778" alt="image"
src="https://github.com/user-attachments/assets/f808e44f-ef97-467f-9e41-812e2857c36e"
/>


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

nikolaj_mykola

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-06 15:49:37 -08:00
DevelopingTom d3c4cd6620 Record missing stats (#2407)
## Description:

Some stats are missing from the recorded game stats:
- Unit upgrade
- Gold from trade and from steal

The gold from trade/steal was introduced with [PR
784](https://github.com/openfrontio/OpenFrontIO/pull/784) but was
quickly reverted with [PR
927](https://github.com/openfrontio/OpenFrontIO/pull/927), probably
involuntarily.

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

IngloriousTom
2025-11-06 15:38:15 -08:00
Philipp Allweyer 5dde4cc16d Extend SAM Range to cover Hydros when stacked (#2351)
## Description:

Implements SAM range extension for stacked SAMs to cover hydros as
requested in #2347 and many times from users in discord.
This implementation is as simple as possible: At level 5 and higher,
SAMs extend their range to the range of a hydrogen bomb + 10 for a small
safety margin. Levels 2-4 are interpolated between.

Screenshot to show the sizes compared to a hydro:
<img width="400" alt="image"
src="https://github.com/user-attachments/assets/a857d66c-e3d4-467f-855f-3539cc90b719"
/>

Everything works together with the new range UI, although I might need
to unify with / rebase on #2350. Not yet tested with #2348, but
shouldn't be an issue.

## Input needed:
- Should I add tests for this?
- This is in effect a massive buff to SAMs, might be too strong. Popular
ideas / suggestions from Discord to balance things:
  - Cap the SAM upgrade level at the maximum range (easy to do)
- Alternative, instead of capping the level, decrease the range when
missiles are reloading
- Increase the cost scaling for SAMs per stack, and scale way higher
(e.g. 1.5M > 3M > 4.5M > 6M or something like that) (UI integration
unclear, breaks with existing cost logic)
  - Decrease SAM hit probability for Hydros

I'm happy to implement any of these paths, or just roll with the simple
way it's set up now, just let me know.

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

newyearnewphil

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-05 11:15:00 -08:00
evanpelle 1b113873d6 Revert "AFK team mate: better ship handling + tests + bugfix (#2203)"
This reverts commit 896a8ebe92.
2025-11-05 08:56:51 -08:00
evanpelle c3f47d16c2 Revert "reduce lobby duration from 30s => 60s to reduce waiting for lobbies that don't fill up"
This reverts commit 4d1911ae1b.
2025-11-05 08:52:51 -08:00
evanpelle e8a04d9a72 Merge branch 'v26' 2025-11-04 16:08:15 -08:00
Kerod Kibatu 822d08bb7c Add performance stats (#2338)
## Description:

Enhanced the performance overlay to display additional tick-related
performance metrics. The overlay now shows:

1. **Tick Execution Duration** - Average and maximum time (in
milliseconds) it takes to execute a game tick
2. **Tick Delay** - Average and maximum time (in milliseconds) between
receiving tick updates from the server

The server sends 10 updates per second (100ms interval), so these
metrics help identify:
- Client-side performance bottlenecks (tick execution duration)
- Network latency issues (tick delay)

**Additional improvements:**
- Renamed `FPSDisplay` component to `PerformanceOverlay` to better
reflect its expanded purpose
- Updated method names (`updateFPS` → `updateFrameMetrics`) and CSS
classes for consistency

All metrics are tracked over the last 60 ticks, providing rolling
averages and maximum values for performance analysis.

## Please complete the following:

- [x] I have added screenshots for all UI updates:
- <img width="495" height="227" alt="image"
src="https://github.com/user-attachments/assets/142b0313-61bf-46cc-b595-61fe73f6b54c"
/>


- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- Translation keys already exist in en.json for
"performance_overlay_label" and "performance_overlay_desc"

- [x] I have added relevant tests to the test directory
  - All existing tests pass (309/310 tests passed)
  - No new tests added as this is primarily a display enhancement

- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
  - Tested locally with npm test
  - Verified performance overlay displays all metrics correctly
  - Confirmed tick metrics are calculated and displayed accurately

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Discord: kerverse

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-04 15:56:44 -08:00
evanpelle d6f5ae7350 increase short range tradeship gold debuff from 200=>300 to discourage cheesing 2025-11-04 11:53:54 -08:00
Evan 4470c3d58a Discourage trading with nearby ports (#2381)
## Description:

The **proximityBonusPortsNb** function increased the likelihood a
tradeship would go to a nearby port. But now that trade gold is nerfed
from nearby ports, we shouldn't encourage trading with ports that are
too close. So now add another factor **tradeShipShortRangeDebuff** That
cancels out the proximity bonus if the port is too close.

Now tradeships are encouraged to go to ports that are close, but not too
close.

Also move tradingPorts method to the PortExecution class because that's
the only place it's used.

## 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
2025-11-04 11:52:52 -08:00
evanpelle 4d1911ae1b reduce lobby duration from 30s => 60s to reduce waiting for lobbies that don't fill up 2025-11-04 11:30:46 -08:00
evanpelle 8fc1bf1c12 increased deletionamrkduration and deleteunitcooldown to 30 seconds 2025-11-04 09:32:53 -08:00
evanpelle 4144628808 Revert "Halloween Event (#2285)"
This reverts commit b69adf70b3.
2025-11-04 09:26:48 -08:00
Kerod Kibatu c371112e9e Add performance stats (#2338)
## Description:

Enhanced the performance overlay to display additional tick-related
performance metrics. The overlay now shows:

1. **Tick Execution Duration** - Average and maximum time (in
milliseconds) it takes to execute a game tick
2. **Tick Delay** - Average and maximum time (in milliseconds) between
receiving tick updates from the server

The server sends 10 updates per second (100ms interval), so these
metrics help identify:
- Client-side performance bottlenecks (tick execution duration)
- Network latency issues (tick delay)

**Additional improvements:**
- Renamed `FPSDisplay` component to `PerformanceOverlay` to better
reflect its expanded purpose
- Updated method names (`updateFPS` → `updateFrameMetrics`) and CSS
classes for consistency

All metrics are tracked over the last 60 ticks, providing rolling
averages and maximum values for performance analysis.

## Please complete the following:

- [x] I have added screenshots for all UI updates:
- <img width="495" height="227" alt="image"
src="https://github.com/user-attachments/assets/142b0313-61bf-46cc-b595-61fe73f6b54c"
/>


- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- Translation keys already exist in en.json for
"performance_overlay_label" and "performance_overlay_desc"

- [x] I have added relevant tests to the test directory
  - All existing tests pass (309/310 tests passed)
  - No new tests added as this is primarily a display enhancement

- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
  - Tested locally with npm test
  - Verified performance overlay displays all metrics correctly
  - Confirmed tick metrics are calculated and displayed accurately

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Discord: kerverse

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-03 13:25:54 -08:00
FloPinguin f607f6d66b Nations rarely sent boats, now they do! (#2161)
## Description:

### Nations rarely sent random boats. Now they are sending twice as
many.
It feels right now, not too many and not too few random boats. 
To make sure that small island nations with, for example, 10k troops
don't repeatedly spam boats into an nation with 1.5M troops (that makes
no sense), they no longer send boats to opponents which have more than
twice the amount of troops.

| my optimizations - 27s into the game - `8 Boats active` | openfront.io
live - 27s into the game - `only 2 Boats active` |
| :---:   | :---: | 
| <img width="2560" height="1068" alt="27s into the game - 8 Boats
active"
src="https://github.com/user-attachments/assets/258e3d69-d86b-4c68-94ec-ade04c6c18b3"
/>|<img width="2560" height="1068" alt="27s into the game - 2 Boats
active"
src="https://github.com/user-attachments/assets/343603d6-e95d-402c-a660-cc54f715d148"
/>|

| my optimizations - 1m20s into the game - `much more boats` |
openfront.io live - 1m20s into the game - `only 4 boats active` |
| :---:   | :---: | 
| <img width="2560" height="1068" alt="1m20s into the game - much more
boats"
src="https://github.com/user-attachments/assets/bbe35603-8db4-4d82-af45-c77b8ef0dcbf"
/> | <img width="2560" height="1068" alt="1m20s into the game - 4 boats"
src="https://github.com/user-attachments/assets/f698794d-f94f-49fb-a09a-1a89b292456f"
/> |

### There was a bug in the random boat sending. 

It did not check if the target is the player himself.
That caused console warnings and a reduced amount of boat-sending.

### The Hiding-Strategy on small islands on the impossible difficulty is
now harder!

Because the random-boat-sending-method preferred large landmasses
instead of small islands (it randomly selects a valid tile),
human-players could easily hide on them, play a
warship-infestation-strat and nearly NEVER get boat-attacked by nations.

I implemented that the random boat functionality now searches for bots
and untaken tiles before searching for nations / humans. That way, they
will try to take some of these tiny islands before the human-player
does. Also its cool to see nations playing on the entire available
land-tiles instead of just the bigger landmasses.

Fixes #1916 (Please check this issue for screenshots and more info)

| my optimizations - 6m53s into the game - `only 5 islands not taken!` |
openfront.io live - 6m53s into the game - `19 islands not taken!` |
| :---:   | :---: | 
| <img width="1078" height="876" alt="6m53s into the game - 5 islands
not taken!"
src="https://github.com/user-attachments/assets/6c103ca1-7d4c-4d0d-948f-3313839302a7"
/> | <img width="1102" height="852" alt="6m53s into the game - 19
islands not taken!"
src="https://github.com/user-attachments/assets/01cc512d-71c9-47aa-b4b1-f7cd5123a782"
/> |


| my optimizations - 6m53s into the game - `all islands taken!` |
openfront.io live - 6m53s into the game - `8 islands not taken!` |
| :---:   | :---: | 
| <img width="2154" height="489" alt="6m53s into the game - 0 islands
not taken!"
src="https://github.com/user-attachments/assets/fc8000b2-de28-4d47-859d-0cc3c6d28ac3"
/> | <img width="2181" height="317" alt="6m53s into the game - 8 islands
not taken!"
src="https://github.com/user-attachments/assets/093243de-f6dc-41ee-ab5e-7e485fe27646"
/>|



### Nations now boat-attack other nations more often!
If there are two nations on two very large landmasses, which are divided
by water, they nearly NEVER attacked each other.

Most attack-functionality relies on the enemies sharing a border. If
they don't have one, the only possible attack-mechanism is the
random-boat-sending. But for very large landmasses (=> very large number
of coastal tiles) it can take a long, long time before it randomly
selects an enemy-tile. With the bug I described above ("did not check if
the target is the player himself") it took even longer. And on the
world-map, the nations have to go over iceland, this is also very
unlikely.

So I implemented the method selectNearestIslandEnemy, which specifically
doesn't cares about borders. It makes sure that a nation always has
someone to attack. This method only gets used as a fallback, and only if
a nation has no borders with anybody.

Fixes #1916 (Please check this issue for screenshots and more info)

| my optimizations - 29m41s into the game - `China won and is in the
process of killing the last enemy` | openfront.io live - NEARLY A HOUR
into the game - `UK finally won. There are still 14 players on the
map...` |
| :---:   | :---: | 
| <img width="2560" height="1068" alt="localhost_9000_"
src="https://github.com/user-attachments/assets/a8107b88-19c8-4df7-a3fd-76d3d3e05d8e"
/> | <img width="2560" height="1068" alt="openfront io_ (1)"
src="https://github.com/user-attachments/assets/0d80e503-d5ed-41d4-a103-33dffc302001"
/> |

## 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
2025-11-02 19:28:21 +00:00
Vivacious Box e7c49d57d2 Add deletion duration and indicators (#2216)
Adds a timer before self deleting units
Adds a loading bar under deleting units
Adds a timer in radial menu for clarity purposes

![deletecd](https://github.com/user-attachments/assets/613bf742-ef90-42b5-a258-b928daae6aaa)

- [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
regression is found:

Mr.Box

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-11-01 11:02:32 -07:00
evanpelle 02b4702a11 Merge branch 'v26' 2025-11-01 10:49:35 -07:00
VariableVince 896a8ebe92 AFK team mate: better ship handling + tests + bugfix (#2203)
## Description:

Have AFK player's Warships not attack team members ships, like Transport
Ships boating in. If team mate conquers the AFK player, transfer over
Warships and Transport Ships to conqueror. The transfered Transport
ships attack in the name of the new owner when landing, and when they
are retreated they move back to a new owner shore tile if they have any.

Added tests. Expectation is this PR will be merged in v26 as the real
solution for the temporary workaround of deleting warships.

**Currently:**
- An AFK player can be attacked without troop loss by their team
members. For this purpose, isFriendly now returns false if the other
player isDisconnected
- But that meant Warships would get False from isFriendly too, and
attack the ships and boats of their team members.
- [Temporary workaround was to delete
warships](https://github.com/openfrontio/OpenFrontIO/commit/eea8db7a06aed50c005db35ad55ece026f7a3643)
as soon as the player was deemed AFK. But this is a disadvantage to the
team. For example the AFK player could have 6 warships in the waters,
either defending team land or helping the team cross over to the enemy
team.
- Transport Ships that were on the way to attack, were still deleted
after the AFK player was conquered. But this is also a disadvantage, if
say a transport ship has just managed to breach through to the enemy
lands despite warships all around. That could have made the win for the
team.

(Left to think about: do we want to transfer part of the defender troops
to the isOnSameTeam attacker? Defender looses less troops in the attack
from their team mate. You'd expect troops to lay down their arms mostly,
if the attacker is on the same team and doesn't loose troops themselves.
Those troops that they loose less than normal, are then added to the
attacker once they've been deemed conqueror. The enemy team can still
attack and do normal damage, and can still also be the conqueror so the
team members have to be fast.)

**Changes in this PR:**
- GameImpl > conquerPlayer: Transfer ownership of the warships to the
conquerer of their lands. If the conqueror is not a team member (other
team can still attack, in their case with troop loss), they won't get
the warships and the ships will be deleted like normal. If the conqueror
is a team member, have them capture the warships.
(Captures need to happen in conquerPlayer since this is right before the
last tiles are conquered and PlayerExecution finds out the player is
dead and deletes its units. Captures will be recorded in the stats just
like normal. Things like this add an extra incentive to be the fastest
to conquer the AFK player, next to getting their gold which is also
recorded in stats. The normal Event Box messages are also displayed.)

- GameImpl > conquerPlayer: Also transfer Transport Ships. As a note:
the limit of 3 transport ships concurrently out on water for one player,
can be exceeded in this specific case (the boatMaxNumber is only checked
for canBuild via TransportShipUtils, and in the init of a
TransportShipExecution, not for an existing TransportShipExecution with
a changing owner). This keeps the situation even for the team in terms
of ships that are already out to attack, which is fair.
captureUnit/setOwner won't do the full job here though, so changes in
TransportShipExecution are needed.
- TransportShipExecution: Added originalOwner. So we can check within
the execution itself if the Original owner disconnected, and if so if
the new owner is on the same team. Only in that case change private
this.attacker. This.attacker can still not be changed from the outside
in this way. Find new src of new owner to retreat boat to if needed, and
if new owner has no shore set it to null so the boat will be deleted
upon retreat. To find new src tile of new owner, use
bestTransportShipSpawn instead of canBuild because canBuild checks for
max boats = 3 etcera but the boat is already on its way so those checks
don't apply (we could get false back from canBuild because there's 3
ships out, while we only need to find the source tile so use
bestTransportShipSpawn).
- TransportShipUtils: to use bestTransportShipSpawn to find new owner
source tile to retreat to, we need to make sure it can handle a new
owner without shore tiles. When the new owner has no shore tiles
(candidates.length === 0), return false. This way it won't go on to call
MiniAStar which would have SerialAStar error on an empty this.sources
array.


- WarshipExecution: Changed isFriendly. This makes sure we have the
wanted behavior: allied/team ships should not attack each other once one
of their owners goes AFK.

- AttackExecution: added one more test specifically to check if attack
on AFK teammate is still witthout troop loss "Player can attack
disconnected team mate without troop loss". Also a bugfix that I left in
after removing a related change from this PR: Add a check for
removeTroops === false in the retreat() function, so at the end of the
attack we don't add troops back to owner troops if they were never
removed in the init. This check in retreat() is actually a bug fix
because removeTroops is in the constructor and can be set to True, but
in retreat() troops would then have been given back after not being
removed at init.

- DefaultConfig: small addition to comment.

- Disconnected.test.ts: added tests. Added useRealAttackLogic because at
least "Player can attack disconnected team mate without troop loss"
needs to use the real attackLogic.
- TestConfig: new class useRealAttackLogic extends TestConfig class, so
a test setup can use the real attackLogic from DefaultConfig instead of
the mock function in TestConfig.
- Setup.ts: for the test setup, add parameter to accept
useRealAttackLogic extension class. Defaults to TestConfig.

## 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: Evan <evanpelle@gmail.com>
2025-11-01 10:48:56 -07:00
VariableVince 64e8733132 Delete unit: 5s > 15s cooldown and new location in Radial Menu (#2345)
## Description:

- Move the Delete button to where the Boat button is otherwise. The Boat
and Delete button already mutually exclude eachother anyway; boat button
is only visible on other's tiles, delete button is only visible on your
own tiles. Evan agreed to this new position:
https://discord.com/channels/1359946986937258015/1381293863712591872/1429147325049077860

- Increase the cooldown between deletions from 5 to 15 seconds. PR #2216
introduced a destruction time (deletionMarkDuration) making it take 15s
to delete a building. With the cooldown of 15s between clicking the
Delete button (deleteUnitCooldown) on top of that, you can actually only
delete a building every 15 seconds while it also takes that same time to
destruct it. Players have voiced between 10s to 30s or more so 15s is
still a reasonable time, keeping deletion of mistakenly placed buildings
still possible, while also keeping a small 'scorched earth' option
during an attack but probably only being able to delete 1-2 units in an
attack. Evan and Vivacious Box agreed with the mentioned 10-15s cooldown
too:
https://discord.com/channels/1359946986937258015/1381293863712591872/1429103999088459897


**Video: Delete button new location and 15s cooldown:**

https://github.com/user-attachments/assets/b0b13fc1-1e50-4a7a-8f32-55f7891f9945

**Delete button new location disabled:**
<img width="310" height="316" alt="Delete button disabled new location
radial menu"
src="https://github.com/user-attachments/assets/f65b88ad-5859-4982-be53-8f2f693f5767"
/>

**Delete button new location enabled:**
<img width="332" height="305" alt="Delete button enabled new location
radial menu"
src="https://github.com/user-attachments/assets/037f07c5-622a-4857-9ab8-fc20981de816"
/>

**Radial menu unchanged on others' tiles:**
<img width="346" height="307" alt="Radial menu unchanged on other
territory"
src="https://github.com/user-attachments/assets/085b2043-096f-4c44-8917-467adb8a7213"
/>


## 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: Vivacious Box <jon@rouillard.org>
2025-11-01 10:48:40 -07:00
VariableVince d9ea9fd432 Fix betrayals for Nations always 0 on Player Info Panel (#2334)
## Description:

Betrayal count in PlayerUpdates came from stats. But stats are only kept
for players with ClientID aka real humans. So betrayals stayed 0 for
Nations even after betraying others. This PR fixes it by keeping a
seperate betrayal count for PlayerUpdates while stats are still being
kept to go in the database.

See bug report
https://discord.com/channels/1284581928254701718/1432759837560799403

After:
<img width="642" height="337" alt="image"
src="https://github.com/user-attachments/assets/1b8bcfa1-aadd-4bea-8a5f-7fa9f2c9111f"
/>


## 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
2025-10-31 11:31:18 -07:00
VariableVince 320a494ff4 Remove redundant function from FakeHumanExecution (#2335)
## Description:

Removed unused code.

PR https://github.com/openfrontio/OpenFrontIO/pull/2044 introduced
function "maybeConsiderBetrayal" in FakeHumanExecution. It was later
replaced by "betray" in BotBehavior, called in a chain of functions
resulting in the behavior that "maybeConsiderBetrayal" originally
intended:
https://github.com/openfrontio/OpenFrontIO/commit/b03f9778dbcada54e0f47232af4cd511a8629980.

## 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: Vivacious Box <jon@rouillard.org>
2025-10-31 07:40:33 +00:00
evanpelle 6fd1576d7b use sigmoid function for trade ship gold to punish short trades 2025-10-30 20:15:18 -07:00
evanpelle 04c240da18 Merge branch 'v26' 2025-10-30 19:28:17 -07:00
Evan 1165126a65 meta update: use rational function to discourage short trades, buff trains (#2337)
## Description:

Use a rational function to strongly nerf short trades. At 50 tiles the
reward is halved.

To compensate, increase gold given by trains by 20%.

## 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
2025-10-30 19:27:46 -07:00
Duwibi fbb818bab1 Add Nuke Wars Baikal Map (#2306)
## Description:
This PR adds the Nuke Wars Baikal map (more balanced out than the
original). This is made for the upcoming Nuke Wars gamemode.

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

DISCORD_USERNAME
Nikola123
2025-10-29 16:41:40 -07:00
Sam Bokai af86a9222f Feature: Enable FakeHumans ("Nation Bots") to Launch MIRVs Strategically (#2225)
## Description:

> [!IMPORTANT]
> Try here: https://mirv-test.openfront.dev/ 

> [!NOTE]
> Blocks PRs:
> - #2244 
> - #2263

### Summary
Implements intelligent MIRV usage for fakehuman players, enabling them
to make strategic nuclear strikes based on game state analysis.
 
### Changes

#### Core FakeHuman Strategy (`FakeHumanExecution.ts`)
- **MIRV Decision System**: Added `considerMIRV()` method that evaluates
game state and determines optimal MIRV usage
- **Three Strategic Targeting Modes**:
1. **Counter-MIRV**: Retaliatory strikes against players actively
launching MIRVs at the fakehuman
2. **Victory Denial**: Preemptive strikes against players approaching
win conditions
     - Team threshold: n% of total land (configurable)
     - Individual threshold: n% of total land (configurable)
3. **Steamroll Prevention**: Strikes against players with dominant city
counts (n% ahead of next competitor)

#### FakeHuman Behavior Tuning
- **Cooldown System**: n-minute cooldown between MIRV attempts
(configurable)
- **Failure Rate**: ~n% chance of cooldown trigger without launch
(simulates human hesitation/resource management; configurable)
- **Territory Targeting**: Centers MIRV strikes on enemy territory
center-of-mass for maximum impact

#### Technical Improvements
- **Type Safety**: Updated `UnitParamsMap` to include `targetTile`
parameter for MIRV units
- **Execution Flow**: Integrated MIRV consideration into fakehuman tick
cycle outside of standard attack logic, due to its holistic strategic
nature

### Game Balance Impact
- **FakeHuman Threat Level**: Increases late-game fakehuman
competitiveness
- **Endgame Dynamics**: Prevents runaway victories, extends game tension

### Breaking Changes
None - purely additive feature

### Related GitHub Issues:
-  #2205 

------
## Other

- [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: samsammiliah

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Evan <evanpelle@gmail.com>
2025-10-29 16:39:31 -07:00
Mike Harris 4ee3cbc255 Features: Team Game Spawn Color Tint (#2303)
## Description:

This PR addresses issue #2302: where there is no obvious information
about the self-player's team during the spawn phase of the game.

Currently, during TEAM games (where there is a set number of teams
defined), the self player's spawn highlight color is white, while all
other players are shown with a team-based spawn highlight color. This
makes it difficult to discern who is a teammate, especially since the
current live version (v0.26.7) uses green/yellow for other players to
depict teammate/other team, respectively.

Technically, the same is true for Duos, Trios, and Quads games, although
this has been addressed separately with PR #2298 by reverting to
green/yellow for teammate/other team players.

This PR changes the color of the self player's breathing spawn highlight
ring to match their assigned team color (with `alpha=0.5` for
transparency). The breathing ring is semi transparent on top of the
existing white static semi-transparent ring, giving the breathing ring a
**tint** of the team color instead of the exact team color.

This allows a player to immediately identify their assigned team and
maintains overall consistency with FFA, Duos, Trios, and Quads game
modes.

See below for example implementation. In this screenshot, the self
player is on the red team as shown by the red tint to the breathing
spawn highlight ring. The screenshot also shows some of the static white
semi-transparent ring around the spawn location. The self player's
teammate is to the top left of the image with a solid red spawn
highlight. The non-player (nation) opponent on the blue team is shown to
the bottom left. In online games, nations are not present in team games.
In single player or private lobby games they are shown as here, without
a spawn color highlight and only a territory color.

<img width="402" height="292" alt="Team Spawn Color Tint"
src="https://github.com/user-attachments/assets/5696a408-a633-4ec8-bf93-c8afa8e2e121"
/>

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

GlacialDrift
2025-10-29 16:39:07 -07:00
Adarsh Das 0789f0d7f8 Add Nations Vs Players Game Mode (#2233)
## Description:
Fixes: #676 
This PR adds Players Vs Nations as a game mode in the menu.

For this change I have added two mutually exclusive option for this
mode:
1. Match number of nations to number of players who have joined
2. Set the number of nations to a fixed value

### Screenshots:
#### Options in Single player mode
<img width="1025" height="790" alt="image"
src="https://github.com/user-attachments/assets/c0685ea5-94f5-43c7-a9e5-390835fc94e9"
/>
<img width="1005" height="795" alt="image"
src="https://github.com/user-attachments/assets/dddba015-a424-40dd-a0fe-2571fd7b0fba"
/>

#### Options in lobby mode
<img width="1015" height="888" alt="image"
src="https://github.com/user-attachments/assets/45bc865b-c6a8-4b6a-9062-4eb499c1ea36"
/>

#### Example gameplay (1 Human Vs 90 Nations)
<img width="1888" height="912" alt="image"
src="https://github.com/user-attachments/assets/38faec75-171f-4358-a3be-93630cca1587"
/>


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

saphereye

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-10-28 16:40:30 -07:00
evanpelle 02bdaaa2c6 Merge branch 'v26' 2025-10-28 14:10:27 -07:00
Evan 3fd38e7306 Add clanTag to GameRecord for archiving (#2314)
## Description:

This will be used to determine clan winners in the api layer.

## 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
2025-10-27 20:05:09 -07:00
Mike Harris b8fab0d359 Expand Clan Name Possibilities (#2178)
## Description:

**This PR expands clan name possibilities available to players.**
**Suggested Label:** Feature
**Suggested Milestone:** v26 or v27

The current clan name logic does not allow for all alphanumeric
characters (e.g. 0-9). Instead it only allows for uppercase and
lowercase letters (e.g. a-z and A-Z). This PR updates the logic to
include 0-9 in the allowable character set. This is in line with how
many other games utilize clan names.

Secondarily, the requirement for the clan name to occur at the start of
the player name has been relaxed. Now, the requirement is that the clan
name is matched with `\[([a-zA-Z0-9]{2,5})\]`. The pre-requisites for
clan regex matching have been updated so that both `[` and `]` must be
*included* in the player name (whereas previously the `[` was required
to appear at the start of the player name). This allows the clan name to
occur anywhere in the player name.

Finally, clan names (once matched by RegEx) are converted to Uppercase
so that clan names such as `[un]`, `[UN]`, `[Un]`, and `[uN]` are all
recognized as the *same* clan.

As a result, all existing clan names remain valid, but new clan names
are now possible. For example `[3M]MeanMrMustard` now has `3M`
recognized as the clan name and `T[UN]able` now has `UN` recognized as
the clan name. Test cases within the `tests/PlayerInfo.tests.ts` file
have been updated accordingly to accurately represent the full
alphanumeric character set.

This addresses issue #2267. 


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

GlacialDrift (GlacialDrift_)
2025-10-27 19:25:46 -07:00
Lavodan cb744b49fc Fix incorrect display of ability to upgrade enemy units (#2308)
## Description:

Fixes #2135.
Adds an owner check to canUpgradeUnit to prevent enemy units from
seemingly being able to be upgraded when Ctrl+clicked on

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

Lavodan
2025-10-27 21:13:05 +00:00
VariableVince 91f1748d70 Perf: remove redundant code from PlayerExecution (#2299)
## Description:

Remove some lines of code that do nothing in surroundedBySamePlayer,
gain a small bit of performance back. The code says "if it is an ocean
shore tile but not an ocean shore tile" which can never be true.


(Why where the lines there and why can they be removed:

Before you were able to boat on a lake, you had no escape from your land
if it bordered a lake and no ocean. So it was logical, if you bordered a
lake with your cluster, to still treat it as fully surrounded annexable
land.

This is why this code was added in [this
commit](https://github.com/openfrontio/OpenFrontIO/commit/ee56d687484131c092599434247b3a036e0e9668)
back then:

`const isOceanShore = this.mg.isOceanShore(tile); if
(this.mg.isShore(tile) && !isOceanShore) { continue; }`

But [this newer
commit](https://github.com/openfrontio/OpenFrontIO/commit/c1383d76f1f76c5e5f9be3a6f30b8f3010258540#diff-fb1101a2b50dd7c353d082ff7a3351cff5469b8249b3ebca91c10573a3dfaaf1)
made it so you could from then on boat on lakes. So you have an escape
from your cluster since then. And just like being on the edge of the map
or when bordering the ocean, this means your cluster won't get annexed.

However, while the updated code for PlayerExecution in the last commit
does its work as intended (it does not exclude lake shore tiles
anymore)... The code contradicts itself:

`const isOceanShore = this.mg.isOceanShore(tile); if
(this.mg.isOceanShore(tile) && !isOceanShore) { continue;}`

Conclusion: the code on lines 136-138 can be deleted because it
literally says "if it is an ocean shore tile but not an ocean shore
tile" which can never be true. Also remove the const and check
isOceanShore directly in the if statement.)

## 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
2025-10-26 21:48:54 +00:00
Abdallah Bahrawi 0a2b6ed9a6 Implement Stop/Start trading with all (#2278)
fixes #2275

Added global Start/Stop trading; use your **player panel** to trigger
it.

<img width="370" height="540" alt="Screenshot 2025-10-23 184447"
src="https://github.com/user-attachments/assets/c3b7967e-ffdd-4f37-ba67-b60a602278ce"
/>

- [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
regression is found:

abodcraft1
2025-10-26 13:42:30 -07:00
Duwibi 6b696685b5 Add Achiran (#2280)
## Description:

Describe the PR.
Adds the Halloween Special Map - Achiran. It has 4 nations and will be
playable in game for a period of around 2 weeks during the Halloween
event.

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

DISCORD_USERNAME
Nikola123
2025-10-25 14:29:49 -07:00