mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:10:55 +00:00
f6412a5979
## Description: **HumansVsNations is back!** The original PR had an issue: only the nations listed in the map’s `manifest.json` were being spawned, which resulted in completely unbalanced games. What did I change with this PR? - The number of humans and nations is now always the same. - If a map contains too many nations, we take a random subset. - If a map doesn’t contain enough nations, we dynamically add additional ones. These get random spawn locations, and their names are taken from the new name generator `NationNames.ts`. The name generator was taken from the closed PR #2245 (idea from @VariableVince). These changes apply to private lobbies and singleplayer as well. In singleplayer, you now simply play a 1-vs-1 against a nation. For public lobbies, we use 50% of the regular team-game player count. The remaining 50% are nations. We are also using the Hard difficulty for HumansVsNations. At the moment, it’s important that nations cheat a little because humans can donate troops, whereas nations cannot, at least not yet. In the future, we may make that work. We might need to adjust the difficulty or do fine-tuning depending on the humans’ win rate in production. Ideally, we want a ~50% win rate; otherwise, the mode may become boring. Over time, humans will likely develop strategies that nations can’t counter, in which case we’ll need to improve the nation AI. Here is a screenshot showing that the number of nations now matches the number of humans in the private lobby UI: <img width="806" height="304" alt="Screenshot 2025-12-25 004023" src="https://github.com/user-attachments/assets/cb4ac6f6-13cc-452c-8cc5-7a500670d7f2" /> The `PuplicLobby` display was a bit bugged for HumansVsNations: <img width="532" height="191" alt="Screenshot 2025-12-23 221832" src="https://github.com/user-attachments/assets/3950bcd9-0072-4c28-b1a0-83c0a24e9b8e" /> So I fixed it to look like this; <img width="532" height="195" alt="Screenshot 2025-12-23 224127" src="https://github.com/user-attachments/assets/690fc554-b607-4c8a-8b22-0c2912ee671a" /> ## 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: iamlewis <lewismmmm@gmail.com>