Commit Graph

2849 Commits

Author SHA1 Message Date
Achim Marius 0793153f4e Standardize difficulty translation keys to easy/medium/hard/impossible (#2676)
Resolves #2673

## Description:

- This PR unifies difficulty naming by switching all difficulty
identifiers to a single lowercase set of keys (`easy`, `medium`, `hard`,
`impossible`) and aligning UI + translation keys (`en.json`) to match.
- The old UI labels (`"Relaxed"`, `"Balanced"`, `"Intense"`) have been
removed and replaced with the standardized difficulty terms (`Easy`,
`Medium`, `Hard`).

<img width="1312" height="306" alt="image"
src="https://github.com/user-attachments/assets/a59c5fae-f435-427d-b851-eef179a1e94f"
/>


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

assessin.
2025-12-24 03:34:00 +00:00
FloPinguin 6afaf932a5 Make easy and medium nations less aggressive 📊 (#2671)
## Description:

1. Players complained that they have problems allying with nations in
the earlygame. So I added an `isEarlygame()` check to
`AllianceBehavior`. This should make the easier difficulties much easier
:)

2. The attack order of nations now depends on the difficulty. Easy and
medium nations got dumbed down, they now take nuked territory before
retaliating against attacks again.

3. The attack rate now depends on the difficulty. Easy nations are
reacting slower than impossible nations (to make sure the number of sent
alliance requests stays the same I removed the difficulty check in
`maybeSendAllianceRequests()`).

4. On easy and medium difficulty nations will sometimes just skip an
attack if the enemy is a human (`shouldAttack()`). But this did not
apply for the nuking logic. Now it does, which makes the easier
difficulties a bit easier.

5. I tuned the `getBotAttackMaxParallelism()` method a bit. The nations
are doing a bit less parallel bot attacks now, which makes the easier
difficulties a bit easier.

6. The settings in MIRVBehavior now depend on the difficulty. On easy
difficulty, nations will only send MIRVs very rarely.

7. Unrelated MIRVBehavior Cleanup: There was a 2 second cooldown and
cache logic. But it was completely useless because `considerMIRV()` is
only called every 4-8 seconds by NationExecution. So I removed it.

8. Unrelated little cleanup: I made a couple of methods `private`

## 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-12-24 03:10:39 +00:00
Mykola 56e497145e Fix nations spawn (#2672)
## Description:

Returned code that spawns nations around predefined coordinates from the
map manifest.

## 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
2025-12-24 03:07:51 +00:00
FloPinguin 76beed8ab6 Add "Four Islands" 🏝️ to the playlist (Based on feedback) (#2679)
## Description:

Saw a few people in the OF Discord missing that map in the playlist.
As far as I know, it wasn’t added because Evan was worried about
stalemates.
But since the map is fairly small (1500x1500) and two hydros can destroy
an entire island, it shouldn’t be any more prone to stalemates than
Baikal (2500x1500).
Could deliver some variety (Nuke-heavy gameplay). And especially crazy
team games.

<img width="332" height="52" alt="Screenshot 2025-12-23 011703"
src="https://github.com/user-attachments/assets/c4e60d83-6af3-4515-9d19-8dbfac380506"
/>
<img width="552" height="406" alt="Screenshot 2025-12-23 021755"
src="https://github.com/user-attachments/assets/6941fcf6-cdd2-41e1-a1de-d55739f626f8"
/>
<img width="528" height="73" alt="Screenshot 2025-12-23 014455"
src="https://github.com/user-attachments/assets/d90a77e7-cc66-4137-9d05-913120d71ac5"
/>
<img width="530" height="79" alt="Screenshot 2025-12-23 014421"
src="https://github.com/user-attachments/assets/2903ad57-9eaa-480e-80ed-4dcb6c695c60"
/>
<img width="543" height="336" alt="Screenshot 2025-12-23 021657"
src="https://github.com/user-attachments/assets/e84497bf-4fb8-44a3-be59-8208fd9a7312"
/>
<img width="531" height="80" alt="Screenshot 2025-12-23 014355"
src="https://github.com/user-attachments/assets/974a6843-a262-473b-ba51-c795c0e42eae"
/>
<img width="528" height="402" alt="Screenshot 2025-12-23 012506"
src="https://github.com/user-attachments/assets/fa182e7e-3a72-4217-b65c-92fc84e4e4e7"
/>
<img width="458" height="100" alt="Screenshot 2025-12-23 011954"
src="https://github.com/user-attachments/assets/4edb499a-86d8-43f1-aa58-f1e72a87f179"
/>
<img width="424" height="123" alt="Screenshot 2025-12-23 011920"
src="https://github.com/user-attachments/assets/099851b3-129e-484e-a7d0-befafcee918d"
/>
<img width="536" height="125" alt="Screenshot 2025-12-23 011829"
src="https://github.com/user-attachments/assets/118d956b-bec4-48f6-9a6d-abf699170774"
/>
<img width="419" height="67" alt="Screenshot 2025-12-23 021732"
src="https://github.com/user-attachments/assets/27b9536e-1a71-463a-a506-93174508dc2b"
/>

## 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-12-23 21:54:41 +00:00
DevelopingTom 3612667bcd Improve SAM Radius layer rendering and performances (#2667)
## Description:

This PR updates the SAM radius layer to render sharply at all zoom
levels instead of pixelated.


![cleam_sam](https://github.com/user-attachments/assets/9e1a23e1-ea47-428f-a3a5-635874b3029c)

The radius is now drawn using primitives directly on the parent
rendering context, rather than via an intermediary canvas and
`drawImage`.

### Performance improvement:

Since the radius computation is quite heavy, it could lead to bad
performances previously because radii were recomputed and redrawn on
every frame.
With 1k SAM:

<img width="559" height="33" alt="image"
src="https://github.com/user-attachments/assets/207e4fca-2b30-4a32-a69b-be3aacc3d7cf"
/>


This PR separates radius computation from rendering:
- radius values are now recomputed only on the first frame after a SAM
changes.
- subsequent frames reuse the cached results and only handle rendering.

Now with 1k SAM:

<img width="624" height="67" alt="image"
src="https://github.com/user-attachments/assets/9facdf04-1dc2-4908-8ebc-fd80933f0232"
/>



## 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-12-21 14:59:38 -08:00
scamiv 0e3200d647 Tint territory borders based on player relationships. (#2439)
## Description:

Add visual indicators to territory borders that reflect diplomatic
relationships between players, making it easier to identify relations at
a glance.

### Problem Statement

Currently, players must check diplomatic status through other UI
elements. There's no immediate visual feedback on the map showing which
borders represent embargo or friendly relationships.

### Benefits

1. **Improved Gameplay Clarity**: Quickly identify diplomatic
relationships without opening menus
2. **Strategic Awareness**: Visual feedback helps make tactical
decisions about border defense

### Proposed Solution

Tint territory borders based on neighbor relationships: embargo red,
friendly green


### Implementation Details
- Border variants are based on this._borderColor (theme/style handling
unchanged) computed in the constructor and stored in userSettings
UnitView
- Apply tinting to checkerboard for defended borders
- borderColor() checks all neighbors to determine the worst relationship
status
- Embargos take priority.


<img width="1193" height="601" alt="image"
src="https://github.com/user-attachments/assets/cb516402-4f4b-473c-a31b-02397fee9203"
/>
<img width="959" height="682" alt="image"
src="https://github.com/user-attachments/assets/de01a4b9-0fd4-44b2-895d-96705b6cf30b"
/>

## 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
2025-12-21 14:57:42 -08:00
Danny 7db8d51bf7 Remove RNG from SAM launchers (#2665)
## Description:
SAMs will now always hit their target instead of missing sometimes.

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:

Lavodan
2025-12-21 22:49:10 +00:00
Aaron Tidwell 9ab1319126 Map Generator Go Code Documentation (#2656)
Resolves #2602

## Description:
tldr: `npm run docs:map-generator`

Adds documentation to the `map-generator` go code.

This has no functional changes, other than the renaming of the package.
I used the github url, though this can be set to anything as long as it
contains a `.` so that the docs parse it correctly. Go doc best
practices seem a little verbose and terse, but attempted to comply

Future Facing (to get these docs viewable without running locally):
- Wait until the -http issue is sorted, then these are easy to
statically host alongside builds
- Could use the legacy `godoc`
- Could do formatting after outputting the `txt` output


## Change List:

- Add documentation to all types/fns in map-generator go code
- Ensure this outputs correctly with `go doc`
- Add `docs:map-generator` command to package.json. This runs `go doc`
in `map-generator` w/ appropriate flags to generate full documentation.
(see notes in readme)
- rename `map-generator` module to work around pkgsite assuming all
packages without a . are stdlib (this makes `-http` work at all)
- Add new sections to README and update existing sections
- Add additional references to locations in the primary code base where
things can be found
- Update documentation in the ts theme files to add output color
mappings - this ensures that everything needed to trace the input file
-> in game rendered asset is fully documented.


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

tidwell
2025-12-21 14:00:54 -08:00
FloPinguin 183b0ae4cf Fix: Optimize nation random boat targeting by skipping unreachable players 🚢 (#2660)
## Description:

Saw lots of `"cannot send ship to Player"` warnings in the console.
It was caused by `randomBoatTarget` not checking if the target is
reachable by boat.
It also caused the for loop in `randomBoatTarget` to exit too early (=>
no boat sent).
So I added a `canBuildTransportShip` check. Because this runs expensive
(?) pathfinding I added a `unreachablePlayers` Set to optimize
performance.

## 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-12-21 13:17:52 -08:00
FloPinguin 3de3a099d0 Change public game difficulty to Easy 📊 (#2662)
## Description:

Multiple people in the game-feedback dc channel are complaining that
nations are too strong. To make the FFAs feel more like `PvP` instead of
`PvPvE`, switch to the easy difficulty.

Unlike humans, the easy nations cannot execute parallel bot attacks at
all, making them expand much slower.
Also their `maxTroops`, `troopIncreaseRate` and `startManpower` configs
are lower than the human ones.
They are easier to ally, etc...
And I have some dumbing-down ideas ready.

**Proposal:** We could introduce "modifiers" to public games in the
future: Higher difficulty nations (for people who like PvPvE), random
spawn, compact map, MIRVs disabled, ...

## 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-12-20 19:07:34 -08:00
Mykola 6112547273 Improve random spawn (#2503)
## Description:

This is a previously approved PR with an additional commit that fixes
case when nations change spawn & jump around, their previous territory
wasn't getting deleted.

## 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-12-20 13:35:30 -08:00
bijx 4ee3319397 Feat: Added cursor price option to user and basic settings (#2655)
## Description:

Following the hotkey cursor price textbox addition of #2650, this
feature adds the option to enable and disable the visual feature via the
User Settings menu or the Basic Settings modal in game. Also added a
[new icon](https://thenounproject.com/icon/pay-per-click-2586454/) for
the Basic Settings modal from the Noun Project and added credit for it
to the `CREDITS.md` file.

### Video Demo


https://github.com/user-attachments/assets/1667081e-45e3-4b11-9bda-3f00c341e03c

### User Settings Menu
<img width="1029" height="1436" alt="image"
src="https://github.com/user-attachments/assets/e4e6bf6d-db59-463a-81fb-f622ef6e3931"
/>

### Basic Settings Menu
<img width="964" height="1545" alt="image"
src="https://github.com/user-attachments/assets/6b083655-b96e-4937-95d6-f3458858f03d"
/>



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

bijx
2025-12-20 11:09:44 -08:00
FloPinguin e554ffb1b0 Cleanup nations (Part 3) 🧹 Remove nation strength (#2649)
## Description:

This PR removes the nation strength. Reasoning:

- It is currently unused. The backstory can be found in #2498
- It forces map-makers to do balancing work, which is probably not a
good idea
- It increases map-making work
- It increases nation balancing complexity by a lot (we need to have all
the json files in mind)
- It makes humans avoid map areas completely because there is always
that one, same, strong nation
- The map lead Nikola123 wants to "not deal with the stupid nations and
their balancing"

If the goal of nation strength was to make them feel different I would
suggest a nation personality system. Nations that love to boat, love to
ally, love to nuke, love to fullsend, etc.

Link to a discord discussion about nation strength:


https://discord.com/channels/1359946986937258015/1360078040222142564/1450973197251117218

## 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-12-19 19:10:01 -08:00
FloPinguin af1e05961c Cleanup nations (Part 2) 🧹 (#2647)
## Description:

1. Moved the currently very small betrayal logic from `AiAttackBehavior`
to `NationAllianceBehavior` because it makes more sense to have it
there.

3. Very small bugfix in `AiAttackBehavior::shouldAttack()`: the numbers
in the two `random.chance` calls were the wrong way round.

4. `NationExecution` was quite big and a lot of it was about MIRVs. So I
moved all the MIRV logic to the new `NationMIRVBehavior`.

5. `emoji()` and `maybeSendEmoji()` did not really fit in
`AiAttackBehavior`. So I moved it to the new `NationEmojiBehavior` (and
did some renaming for clarity). I'm planning to extend that class in a
future PR.

2. Reordered methods in `AiAttackBehavior` to easily find related
methods.
6. Reordered methods in `NationExecution` to easily find related
methods.

## 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-12-19 19:08:37 -08:00
bijx 4e8aa1f066 Feat: Add cost to ghost structure icon when using keyboard shortcuts (#2650)
## Description:

Introduces a dynamic textbox under the cursor and populates it with
price when a keyboard hotkey is pressed. Prices update correctly based
on current value of the structure or strike being purchased, even if the
value is 0 (during `Infinite Gold` mode). Price value updates live even
if the price box is currently being shown (for example, when voluntarily
removing a structure causes the price to change. See video below).

### Video Demo 


https://github.com/user-attachments/assets/3f974268-c14b-4129-9629-5a0f7db8b30c


The more in depth demo was too big for GitHub, but I uploaded it on the
Discord

https://discord.com/channels/1284581928254701718/1447907175522504704/1451483322260914297

### Live price updates on tooltip


https://github.com/user-attachments/assets/0d98739c-6f24-4fcd-a047-cc304e7e86aa

### Works with `Infinite Gold` mode


https://github.com/user-attachments/assets/25bd2919-77cd-4735-8c3f-043306f53b8f




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

bijx
2025-12-19 19:06:21 -08:00
ZachB 8a281da429 fix typo: recieved -> received in quick chat help text (#2651)
## Description:
Fixed a small typo found in-game. No functional changes, UI changes, or
behavior changes beyond correcting displayed text.

## Checklist

- [x] I have added screenshots for all UI updates  
- [x] I process any text displayed to the user through `translateText()`
and 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

## Contact
Discord username: **Sashazach#sashazach**
2025-12-19 15:51:15 -08:00
bijx 16e290bc77 Fix: Updated images in instructions to reflect new UI (#2643)
## Description:

The image for "Control Panel" and "Options" in the instructions are
outdated (control panel still shows the troop / worker slider bar,
options are still emoji buttons). Updated images to reflect new control
panel and options UI.

### Previous Control Panel:
<img width="717" height="491" alt="image"
src="https://github.com/user-attachments/assets/56a3620e-f76f-494d-bea0-67c4fa4b6b03"
/>

### New control panel:
<img width="823" height="480" alt="image"
src="https://github.com/user-attachments/assets/1a47aadd-57ee-4982-a737-db32f3ad60d0"
/>

### Previous Options:
<img width="891" height="519" alt="image"
src="https://github.com/user-attachments/assets/9c719f13-e3bc-41c2-95ab-fe9d4351ee27"
/>

### New Options:
<img width="713" height="518" alt="image"
src="https://github.com/user-attachments/assets/405c8c53-0f63-46e0-8444-d4e157dbd666"
/>
 


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

bijx
2025-12-19 20:24:32 +00:00
evanpelle e6c9e646d4 fix build rename disableNPCs => disableNations 2025-12-18 20:01:32 -08:00
DevelopingTom f532dab704 Add end of game report window (#2598)
Resolves #1664

## Description:

Add a game ranking window, accessible through the player game history:
<img width="508" height="140" alt="image"
src="https://github.com/user-attachments/assets/51a628d9-628d-44c3-9776-d9b359b94e65"
/>

There is a lot of data players could be ranked with.
Three main ranking categories  with their own sub-categories:

<img width="371" height="264" alt="image"
src="https://github.com/user-attachments/assets/8b3b7c53-c52f-4b96-8039-23180c9181cf"
/>

### Duration:
Rank players according to their survival time

<img width="284" height="281" alt="image"
src="https://github.com/user-attachments/assets/6dfa0d11-7f5b-4f4f-81f8-f31e24ade6bf"
/>


### War:
#### Conquests:
Number of conquered players and bots

#### Bombs:
Show all bomb launched by each players. Can be sorted with each
category.
<img width="289" height="193" alt="image"
src="https://github.com/user-attachments/assets/fc0f9663-9a50-4098-b5c6-f434354accff"
/>

### Economy:
Show all gold earned by each players with trade, conquests, pirate or
total:

<img width="276" height="195" alt="image"
src="https://github.com/user-attachments/assets/a925249d-b2d2-4c61-92a5-4dbf5922b32b"
/>


### Responsiveness:


![ranking_showcase_resize](https://github.com/user-attachments/assets/5316d7f4-803f-4223-b834-783040226b7d)


## 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-12-18 19:41:29 -08:00
Mateusz Żołdak b63744834d fix: area right from control-panel is clickable (#2640)
If this PR fixes an issue, link it below. If not, delete these two
lines.
Resolves #[2638](https://github.com/openfrontio/OpenFrontIO/issues/2638)

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

Not on discord yet, but this bug makes me crazy. :)

Edit:
Also, I wasn't sure from which branch to start from.
2025-12-18 16:21:27 -08:00
FloPinguin 4d5bb7a835 Cleanup nations (Part 1) 🧹 (#2637)
## Description:

1. Using the wording `"Nation"`, `"FakeHuman"` and `"NPC"` at the same
time is confusing.
So I renamed every mention of `"FakeHuman"` and `"NPC"` in the entire
project to `"Nation"`. Just like they are called ingame.

2. `BotBehavior.ts` was originally intended for sharing the logic
between nations and bots.
But at the moment, the logic there isn't really shared and it's
basically just about attacking.
So I renamed `BotBehavior.ts` to `AiAttackBehavior.ts`. I use "Ai" to
indicate that this file is used by bots AND nations.

3. Moved `execuction/utils/AllianceBehavior.ts` to
`execuction/nation/NationAllianceBehavior.ts` to make sure everybody
understands that this file is not about alliances in general. It's just
about nations and how they handle alliances.

4. Removed `difficultyModifier` from `DefaultConfig`. It's unused and I
think we usually want to finetune the difficulty instead of using that
method.

5. Added `assertNever` in all `switch (difficulty)` default cases.

## 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-12-18 16:20:23 -08:00
Duwibi f60aef65e1 Map fixes for Britannia and Pangaea (#2641)
## Description:
This PR fixes some small pixel errors on Pangaea and Britannia

## 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-12-18 16:19:54 -08:00
YoussfeCantCode e55b79266a Fix auth: preserve localStorage persistentID on network errors (#2636)
If this PR fixes an issue, link it below. If not, delete these two
lines.
Resolves #(issue number)

## Description:

When refreshJwt() fails due to network errors (auth server unreachable),
only clear __jwt instead of calling logOut(). This preserves the
player_persistent_id in localStorage for dev mode fallback.

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

furo18
2025-12-17 19:52:33 -08:00
bijx c9f00a5eb8 feat: Factory Railway Tracks become more visible in Alternate View (#2626)
## Description:

Adds network bright green highlighting to Railway tracks connecting
_your_ factories and buildings together when in the alternate view
(spacebar view). It is sometimes hard to see your own tracks on certain
areas of the map (mountain terrains for example), so this change will
highlight the tracks the same color as your border outline in the
alternate view (#00FF00). Also suggested by [this
comment](https://discord.com/channels/1284581928254701718/1445984695752855562/1445984695752855562)
in the Discord.

### Normal Railway Connection
<img width="1009" height="872" alt="image"
src="https://github.com/user-attachments/assets/31c028a8-13d8-4d82-ba4a-385b8372c9ac"
/>

### Alternative View (spacebar)
<img width="1124" height="956" alt="image"
src="https://github.com/user-attachments/assets/f4f3bb38-7233-4f2c-9bbf-a407196b0124"
/>

### Other nation colors remain unchanged
<img width="1566" height="1447" alt="image"
src="https://github.com/user-attachments/assets/c4dde970-20f1-480b-959d-876d4eb0f32b"
/>


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

bijx
2025-12-17 19:46:32 -08:00
evanpelle bec9af6d1e custom color bugfixes: don't add hash because it is already present in flare, clear current color on logout 2025-12-17 15:05:02 -08:00
DevelopingTom 507f391aa1 Add Christmas emojis (#2634)
## Description:

Add some christmas spirit in the emoji list
🎁🌟🎅🎄

## 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-12-17 14:18:39 -08:00
DevelopingTom 7255b5282f Change Christmas-atom and Christmas-hydro colors (#2635)
## Description:
Change atom and hydro color to be less confusing:

<img width="704" height="441" alt="image"
src="https://github.com/user-attachments/assets/17e762d5-50b5-47a9-9a9e-c66e5c4beebb"
/>

## 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-12-17 14:18:04 -08:00
VariableVince 9fa5e9daef Fix: show 0 Nations in Lobby Team Preview when disableNPCs is true (#2633)
## Description:

Fix for v28: show 0 Nations in Lobby Team Preview when disableNPCs is
true. Lobby Team Preview displays the number of Nations on a map, but
should diplay "0 Nations" in this case.

After fix:
<img width="1067" height="737" alt="image"
src="https://github.com/user-attachments/assets/d89ede3f-e1ca-4614-bf8a-36ad564bf3d2"
/>

<img width="1072" height="737" alt="image"
src="https://github.com/user-attachments/assets/b2b068fd-b0d1-49a8-b284-e64e479f4bab"
/>


## 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-12-17 21:09:07 +00:00
VariableVince a26d704a2e Help prevent supply chain attack: add safer install script (#2627)
## Description:

For safer installations, clean install (ci) should be used, preferably
with added --ignore-scripts. To make it easier for devs, add a npm
script which can be ran by using "npm run inst". Update readme.

Evan agreed here
https://discord.com/channels/1359946986937258015/1360078040222142564/1432085555126206576

"npm run inst" runs `npm ci --ignore-scripts` which installs
dependencies exactly according to the versions in `package-lock.json`
and doesn't run scripts. This can prevent being hit by a supply chain
attack.

Did not re-use the "install" or "ci" npm lifecycle hook, instead used a
similar but still short script name "inst". We can change this to
something like "safe-install" if needed but i assume "inst" will do.

## 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-12-17 12:38:47 -08:00
evanpelle 2a294d93df have events display retaliate button send counter troops based on the attack ratio 2025-12-17 12:35:58 -08:00
evanpelle 5f5176bd39 meta: reduce train gold from allies from 50k => 35k 2025-12-17 12:28:37 -08:00
VariableVince 765cd1b495 Fix: incorrect Duos Trios Quads texts + display teams in one box (#2632)
## Description:

- **Fix wrong Duos Trios Quads text in SP and Private Lobby modals:** PR
#2591 overwrote translations for public_lobby.teams_Duos , teams_Trios
and teams_Quads. But those translation keys are not only used in Public
Lobby, they are also used for the Single player and Private Lobby
modals. Where they are displayed in a slightly different context, making
the new translations appear off. Fix: add seperate translation keys and
restore old strings.

- **One box for team text in Public Lobby:** display number of teams and
team size in one block instead of two seperate blocks. It is agreed upon
also by evan that one block would look better:
https://discord.com/channels/1359946986937258015/1360078040222142564/1449498245817569502

--BEFORE:--
<img width="816" height="272" alt="Before in public lobby seperated
boxes"
src="https://github.com/user-attachments/assets/ddf7b425-4664-4f23-9d8c-7a859d6aea36"
/>

<img width="797" height="256" alt="Before in public lobby seperated
boxes and with change in translation of PR 2591 visible"
src="https://github.com/user-attachments/assets/f49c8fec-5de5-42d9-88fb-ed0ccb3951ea"
/>

<img width="1091" height="282" alt="Before naming of Duos Trios Quads
incorrect in SP and private lobby modal after changes in PR 2591"
src="https://github.com/user-attachments/assets/9c4d45b5-8db6-44b9-b2db-379a2c97e4d5"
/>

--AFTER:--
<img width="911" height="297" alt="After in public lobby now one box for
Team games"
src="https://github.com/user-attachments/assets/28a1c30b-3f0d-4484-bf12-4281435072c1"
/>

<img width="807" height="248" alt="After in public lobby now one box for
Team games Quads example"
src="https://github.com/user-attachments/assets/7cb54246-8d0a-410a-9e44-1f8cc15a2978"
/>

<img width="912" height="297" alt="After in public lobby still same for
other game modes"
src="https://github.com/user-attachments/assets/4dab6234-81fe-426d-82d1-c478d672673e"
/>

<img width="1115" height="622" alt="After naming of num teams for Duos
Trios Quads corrected Private lobby modal"
src="https://github.com/user-attachments/assets/c2622c4e-1cfd-40f9-b0ed-8ff1d437d72d"
/>

<img width="1163" height="582" alt="After naming of num teams for Duos
Trios Quads corrected"
src="https://github.com/user-attachments/assets/98fdfa22-70a8-4820-96fa-7b1df991e3ff"
/>


## 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-12-17 11:30:12 -08:00
VariableVince 6d58abfdbb Christmas Themed Homepage 2 (#2628)
## Description:

A small fix for https://github.com/openfrontio/OpenFrontIO/pull/2608.
Give the map buttons in the private lobby and single player modal the
same red border and background as the buttons below them.

Before:
<img width="551" height="592" alt="image"
src="https://github.com/user-attachments/assets/cd6087ab-d74d-48d7-8093-d4a39fb2e30f"
/>

After:
<img width="263" height="192" alt="image"
src="https://github.com/user-attachments/assets/f47da143-6efd-43f5-b586-d46e6b6df96a"
/>

## 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-12-16 19:22:41 -08:00
FloPinguin 8b9bed0e0b Hotfix: Max troops instead of troops for team stats 📊 (#2631)
## Description:

Missing i18n key because I forgot to add maxTroops to the team
leaderboard...
I completely forgot that troops are also shown on the team leaderboard

Before:

<img width="905" height="309" alt="Screenshot 2025-12-17 022043"
src="https://github.com/user-attachments/assets/c2f95c0b-86a5-4447-bbfc-1925d70005f6"
/>

After:

<img width="778" height="309" alt="Screenshot 2025-12-17 025028"
src="https://github.com/user-attachments/assets/fe6c968a-7867-4be9-8ee1-65f2baa26190"
/>

## 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-12-16 19:16:03 -08:00
evanpelle f3b4c7c27f Refine AGPL Section 7 attribution terms 2025-12-16 16:33:51 -08:00
evanpelle 9edf0349cb bugfix: bomb launch was recorded before the MIRV was constructed, causing it to increase in price before it could be built v0.28.0-beta-v1 2025-12-16 12:31:00 -08:00
FloPinguin 058bb44273 Fix nation relation exploit 🔧 (#2523)
## Description:

Saw this in an Enzo video about beating impossible nations:

You can just donate 1% gold / 1% troops to a nation to get a friendly
relation with them.

This PR adds randomized minimum donation requirements based on the
difficulty.
Randomized in a way that there is a minimum someone has to donate to
surely get the relation improvement, but you can also gamble and send
less.

For troop donations, the minimum is calculated based on what percentage
of their troops the sender donated.

For gold donations, it's fixed values. We cannot use percentages here
because “having nearly no gold” is a usual case. Donating 100% of your
gold wouldn’t hurt if you just spent all your gold on buildings.

I tried to add tests for this but it's really horrible. Because the test
would have to wait until the relation update from the alliance accepting
is gone (we need to have an alliance to send stuff), has returned to
Neutral, and then changes back to Friendly after the donation.

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

---------

Co-authored-by: Evan <evanpelle@gmail.com>
2025-12-16 09:01:18 -08:00
Restart2008 f256f497ce Christmas Themed Homepage (#2608)
## Description:
Adds the following:
- Snowflake animation with snowflakes falling from the top to the bottom
of the screen
- Changed homepage color theme from blue and white to Green and Red.
Also changed the openfront logo to a red, green, and white gradient.
- Added a santa hat on the announcements button

## Please complete the following:
- [x] 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
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

<img width="1616" height="836" alt="Screenshot 2025-12-12 at 3 01 17 PM"
src="https://github.com/user-attachments/assets/82e29db3-3bc0-4392-b5bf-dd57c15784a3"
/>

<img width="1616" height="836" alt="Screenshot 2025-12-12 at 2 58 54 PM"
src="https://github.com/user-attachments/assets/232da646-6923-4966-acba-5240074e7e3f"
/>


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

Restart

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-12-15 20:26:42 -08:00
DevelopingTom 648ae1943f Christmas Themed FX (#2624)
## Description:

### Santa:
- spawn randomly on the map every minute:


![santa_is_coming](https://github.com/user-attachments/assets/0c40f983-7c5e-4fd9-93cd-5601008cb2ef)

### Nuke changes:
- Atom: small gift
- Hydro: big gift
- MIRV: shooting star


![all_christmas_nukes](https://github.com/user-attachments/assets/db80d765-6292-44e0-a5a3-fe08c0516993)

### Nuke fallout FX:
- melting snowman
- happy elves
- elves needing assistance


![christmastroph](https://github.com/user-attachments/assets/92270357-a0f6-43bf-9b95-cc5b2427a542)

## 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-12-15 20:24:23 -08:00
FloPinguin f96fd6dc12 Show max troops in PlayerInfoOverlay and leaderboard 🖌️ (#2625)
## Description:

In the main discord, people seem to be divided in their opinions about
this.
But lets see what the playtest-people are saying, we can easily roll
this back.

<img width="197" height="312" alt="Screenshot 2025-12-15 220648"
src="https://github.com/user-attachments/assets/c6acd1f8-03b1-4949-b15e-6a32f8460e18"
/>
<img width="405" height="323" alt="Screenshot 2025-12-15 220623"
src="https://github.com/user-attachments/assets/21190a6f-1a0b-4db3-b6d0-c0722e98902a"
/>

## 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-12-15 20:22:59 -08:00
Danny 58c7cdd46f Task: Unify username validation and remove username sanitation (#2622)
## Description:

This PR centralizes all username validation using UsernameSchema with a
set maximum, minimum, and a regex pattern,

It also removes sanitization, as all places where the username would be
sanitized on the server have been gatekept, so no unvalidated usernames
can get onto the server past the ClientMessageSchema safeParse in
GameServer's on message func.

Here is how the errors look if that happens, Note that if the client is
funtioning correctly and the user doesn't manually send a WS message,
they should never see this. The screenshots are from a debug build where
client uname validation was disabled.
<img height="300" alt="error message too short"
src="https://github.com/user-attachments/assets/1b7ac32c-2f03-40fb-8ce9-1f4ab66100bd"
/>
<img height="300" alt="error message bad regex"
src="https://github.com/user-attachments/assets/c78b4114-7e4b-4d39-a135-4cab3ad52c0b"
/>

Profanity sanitization was not changed.

Additionally, the censor tests were updated to reflect the new
expectations.
Jose was added to the jest config as an allowed transform pattern, as it
didn't make sense to me to mock a zod schema.

The UsernameSchema pattern was set to `^[a-zA-Z0-9_ \[\]üÜ]+$`, I
personally think either we should allow all latin characters (regex has
a pattern for this, `\p{L}` or `\p{sc=Latin}`) and then we'd use some
kind of library to normalize all latin characters into regular ascii for
name filtering, or we should only keep ascii letters.

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


(I just realized sanitization isn't a word, it's supposed to be
sanitation, sorry.)
2025-12-15 10:07:15 -08:00
jachisc 690b7e1155 Add Manicouagan Map and Credit OpenTopography (#2620)
## Description:

Adds a map based on the Manicouagan Reservoir in Quebec and credits
OpenTopography

## 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
<img width="1017" height="1017" alt="Screenshot 2025-12-14 214706"
src="https://github.com/user-attachments/assets/030c4bbd-0325-4da4-bef5-71053dc8f183"
/>

## Discord username:

sehentsin
2025-12-15 09:44:15 -08:00
scamiv aae9c43fa4 perf Optimize removeClusters by replacing sort with linear scan (#2614)
## Description:

PlayerExecution.ts removeClusters:
Replace O(k log k) sorting with O(k) linear scan to find the largest
cluster
2025-12-15 09:43:10 -08:00
Evan 92d9f7a93c Create a docs folder, add auth & architecture docs (#2623)
## Description:
Create docs folder
## 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-15 09:07:31 -08:00
Evan 71cf309252 increase mirv price with total number of merged launched (#2621)
## Description:

To prevent MAD stalemates, have the price of MIRVs increase after each
launch. This will encourage players to launch a MIRV once they have
enough money for it. Also reduce the price of the first MIRV to 25
million to reduce snowballing, each subsequent MIRV cost an extra 15
million:

1. 25 million
2. 40 million
3. 60 million
4. etc



## 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-14 19:52:54 -08:00
VariableVince 4f6a433dc8 Fixes & cleans up Username input (#2619)
## Description:

**Fix:**
Error box like "Username must be at least 3 characters long" sometimes
still remains after the game starts. See bug report with screenshot:
https://discord.com/channels/1284581928254701718/1449169462426079343/1449169462426079343

This is while in main.ts, element username-validation-error is already
set to hidden. Most of the time this works but apparently sometimes
there's a re-render which removes the 'hidden' tag again. Most probable
solution for this edge case: clear validationError first. Then to make
sure, still hide element username-validation-error.

**Cleanup username.ts:**
- Remove cat and clover emojis from validPattern. For single player
games, the only other validity checks are done from GameRunner calling
sanitize() from Util.ts. And from GameImpl where from addPlayer the
PlayerImpl are created, which uses sanitizeUserName also from
username.ts, which uses validPattern again. Both GameRunner and
PlayerImpl therefor allow emoji. But for muliplayer there's an extra
step where ClientJoinMessageSchema enforces UserNameSchema = SafeString.
Which does NOT allow cat or clover emoji. So for multiplayer you get an
error and can't join a game with cat or clover emoji. To align their
behavior more, just disallow the emojis from validPattern from the
start. Almost no-one ever used them anyway, they were once put in
because a developer liked to use them before the existance of
ClientJoinMessageSchema. There's more consolidation/refactoring possible
but this is an important first step.
- Remove sending arg max: MAX_USERNAME_LENGTH for translation key
invalid_chars, since the translation string doesn't contain params

**Cleanup UserNameInput.ts:**
- Remove userSettings: isn't used anywhere in the code
- Remove dispatchUsernameEvent: nowhere in the repo is event
'username-change' listened to. Also, dispatchUsernameEvent is only
called from connectedCallBack but not anywhere else. It seems like
handleChange was made for this. Also main.ts calls
usernameInput.getCurrentUsername() and doesn't listen for the event
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
2025-12-14 18:38:25 -08:00
FloPinguin 7eef3d4688 Rebalance nation configs, they are getting too strong to beat 📊 (#2618)
Resolves #2599

## Description:

For example in #2599 we can see people already struggling with the
higher difficulties.

With my PR #2606 (nation alliance request logic), an alliance request
towards an impossible difficulty nation will probably always get
rejected. They have `maxTroops * 2`, and because humans have much less
troops, the nation of course won't want to ally with them (unless the
human somehow manages to get a similar troop count).

This makes them even harder to beat.

So I tuned the `maxTroops`, `troopIncreaseRate` and `startManpower`
configs towards the setting for humans, following the goal to make
difficulties impact the **SMARTNESS** of nations, instead of just their
troop count configs (more varied gameplay 😊).

The biggest change is in `startManpower`. I thought it was weird that
easy nations started with much less troops than a bot (2_500 vs 10_000).

Look at this screenshot, a couple of seconds into the game. Bots were
bigger than nations. 💀 Turkey in the bottom right corner...

<img width="1536" height="1045" alt="Screenshot 2025-12-14 180823"
src="https://github.com/user-attachments/assets/d219e6ce-b579-4b7e-a8bb-effa339507bf"
/>

## 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-12-14 15:20:13 -08:00
FloPinguin dfe33a05e9 Improved the nation alliance request logic 🤝 Massive upgrade to singleplayer fun (#2606)
## Response to alliance requests

Previously the way nations responded to alliance requests was quite
simple / boring / exploitable. Basically you couldn't ally them if you
had a bad relation with them, or if you had too many alliances.
Otherwise they would just take it.

Now there is a **complete decision tree which is based on the
difficulty**. The nations should also feel more human now.

For example, just like humans, nations will now consider to take an
alliance even if you have a bad relation with them (If you are a
threat).

Also, nations no longer check if YOU have too many alliances. Now they
do what humans do: Check if THEY have too many alliances (they want to
be able to attack somebody).

Another big change is the default case: Previously it was just `return
true`. Now it's `return isAlliancePartnerSimilarlyStrong`. So they do
what humans do: Take a quick look at their troop count before allying
them.

## Sending alliance requests

Previously alliance requests were sent randomly. Quite boring.

Now we use the same decision tree as for responding.

## Alliance extension requests

They also use the same decision tree.

## Tests

Tested it a lot in singleplayer.
I have planned to add unit tests for all the nation/bot stuff in the
upcoming cleanup phase.

## 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-12-14 15:18:07 -08:00
Aotumuri 66ae8cd9bb Remove troop ratio slider and description (#2617)
## Description:

Removed unused translation strings and code.

## 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
2025-12-14 15:13:40 -08:00
Aotumuri 9d10ca71a5 Fix: GulfOfStLawrence map name not being translated (#2616)
## Description:
The map name was not translated because it contained a . character,
which caused the translation key to break.

To prevent this issue, the map name handling now strips . characters
when generating translation keys.
With this change, maps that include . in their names will no longer
cause translation issues in the future.

Before fix:
<img width="538" height="284" alt="スクリーンショット 2025-12-14 14 26 02"
src="https://github.com/user-attachments/assets/a683e3de-09df-4b43-8077-4a00bd5f1272"
/>

After fix:
<img width="494" height="176" alt="スクリーンショット 2025-12-14 14 27 19"
src="https://github.com/user-attachments/assets/f9d27e16-de70-4c43-af31-aaa30287e5cd"
/>


## 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
2025-12-13 21:51:31 -08:00