Commit Graph

38 Commits

Author SHA1 Message Date
FloPinguin 339ace0bd6 v30 nuke wars preparation: Disable boats & Team spawn zones (#3263)
## Description:

Preparation for nuke wars, for v30.
Next PR will be adding the nuke wars modifier for public games, but
Wonders https://github.com/openfrontio/OpenFrontIO/pull/3224 needs to be
merged first to avoid merge conflicts.

### 1. Disable boats setting

It's possible to disable `UnitType.TransportShip` now. Because they are
not needed in nuke wars and can even be annoying.

<img width="720" height="320" alt="image"
src="https://github.com/user-attachments/assets/661bc10d-b204-4b4f-b876-ee7c9b92de8c"
/>

### 2. Team spawn zones for random spawn

Maps can have `teamGameSpawnAreas` in their json file now.
Spawn areas are currently active if 
- a supported map is chosen (Baikal Nuke Wars or Four Islands)
- a supported team size is chosen (2 teams on Baikal Nuke Wars or 2/4
teams on Four Islands)
- random spawn is enabled

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

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

FloPinguin
2026-02-23 16:12:24 -06:00
Mykola f7b39faca7 Spawn. Fix respawn near the previos spawn (#3278)
## Description:

Because spawning is prohibited on tiles that have an owner, this created
a problem when a person tried to spawn near the center of their previous
spawn. This was resolved by relinquishing all the tiles conquered by the
previous spawn.

## 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
2026-02-22 22:10:00 +00:00
Mykola 097c42740c Random spawn. Avoid spawning near water. (#3009)
## Description:

Fixing
https://discord.com/channels/1359946986937258015/1360078040222142564/1463898386854973642

Now, if not all tiles on the spawn circle can be owned, the algorithm
tries to select another random spawn tile.

## 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: Ryan <7389646+ryanbarlow97@users.noreply.github.com>
2026-02-22 15:51:05 +00:00
FloPinguin f8156c550b Fix random spawn (#2958)
## Description:

"You can pick your spawn in random spawn games in v29. You need to open
the menu and click on the attack button. That's it."

Thats the fix for this problem.
Radial menu no longer allows to attack (pick a spawn) while random spawn
is enabled.
And SpawnExecution got a check so you cannot send malicious intents.

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

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

FloPinguin
2026-01-19 23:49:10 +00: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
evanpelle 807151b723 Revert "Improve random spawn (#2465)"
This reverts commit 2b2200c808.
2025-11-19 10:58:49 -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
Scott Anderson 0489c63f4b Validate spawn tile (#1512)
## Description:

Enforce valid tile during spawn, to prevent the game from crashing for
all players.

## 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
- [ ] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [ ] I have read and accepted the CLA aggreement (only required once).
2025-07-20 20:17:29 -07:00
Léo Joly 9c7e0ce32f [Cleanup] Pass Player into execution constructor instead of PlayerID (#1022)
## Description:
Answering issue:  #1017 
[Cleanup] Pass Player into the execution constructor instead of PlayerID

I have tested the changes running and playing a full game. I do not know
other way to test the changes, please inform me ❤️

## 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
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

Lele

---------

Co-authored-by: lva <lva@rovsing.dk>
2025-06-06 11:58:15 -07:00
Scott Anderson 70745faac4 Enable strictNullChecks, eqeqeq (#436)
## Description:

Improve type safety and runtime correctness by:
1. Enabling TypeScript's
[strictNullChecks](https://www.typescriptlang.org/tsconfig/#strictNullChecks)
compiler option.
2. Replacing all loose equality operators (`==` and `!=`) with strict
equality operators (`===` and `!==`).
3. Cleaning up of type declarations, null handling logic, and equality
expressions throughout the project.

Currently, the code allows implicit assumptions that `null` and
`undefined` are interchangeable, and relies on type-coercing equality
checks that can introduce subtle bugs. These practices make it difficult
to reason about when values may be absent and hinder the effectiveness
of static analysis.

Migrating to strict null checks and enforcing strict equality
comparisons will clarify intent, reduce bugs, and make the codebase
safer and easier to maintain.

Fixes #466 

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
Co-authored-by: evanpelle <openfrontio@gmail.com>
2025-05-15 16:39:40 -07:00
Evan 924ca2c69e bugfix: humans start with zero troops on teams, also removed manpower argument to addPlayer() 2025-04-04 10:03:00 -07:00
Evan 9d1b4f35e4 bugfix: SpawnExecution was not attaching PlayerExecution to humans
bugfix: WinModal was saying player died even if they hadn't spawned

added hasSpawned() method to player
2025-04-03 20:12:36 -07:00
Evan 9fa3691c5c bugfix: SpawnExecution couldn't find existing player because Game.Players() only returns alive players. This caused SpawnExecution to respawn each human player. 2025-04-03 19:31:42 -07:00
Evan 8b6895d745 add prettier import plugin 2025-03-31 13:09:27 -07:00
evanpelle ab3f4fbac1 All players must join game before spawn (#380)
## Description:
The server stores all players that have joined, and once the game starts
it sends a list of players to all clients. Players cannot join after the
game has started. Server now generated the PlayerID instead of the
client.

The is necessary for team mode, we need to know how who is playing the
game before it starts so we can properly assign teams based on clans.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

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

evan
2025-03-30 17:04:29 -07:00
Evan 5e6f8f5d91 validate all intent input 2025-02-18 16:26:49 -08:00
Evan 4ee37323f9 format codebase with prettier 2025-02-01 12:05:11 -08:00
evanpelle de1dbff570 combine Game & MutableGame 2025-02-01 12:05:11 -08:00
evanpelle 7d15c0c065 combine Player & MutablePlayer interfaces 2025-02-01 12:05:11 -08:00
Evan f0f5bae79f thread_split: convert all tile to tileref 2025-02-01 12:05:11 -08:00
evanpelle 10a1f1af8e thread_split: enable spawn highlight 2025-02-01 12:05:11 -08:00
Evan 2afecf0f39 create troop slider 2024-11-03 12:37:56 -08:00
evanpelle f3307300ef refactored GameImpl into multiple files 2024-09-17 19:49:16 -07:00
evanpelle 8331047a9b have client create player id 2024-09-07 21:23:38 -07:00
evanpelle 5931d15caf added local build, improved spawnexec 2024-09-07 20:40:52 -07:00
evanpelle 4caaaea140 created PlayerType enum add FakeHuman type 2024-09-06 17:55:12 -07:00
evanpelle d2a8b48764 remove playerconfig 2024-08-29 20:24:50 -07:00
evanpelle 480cfba8e0 can change name after joining game 2024-08-26 15:03:50 -07:00
evanpelle 8c902a70b8 added spawn timer bar 2024-08-26 09:13:05 -07:00
evanpelle 51650eb930 can change spawn in beginning of game 2024-08-25 20:21:35 -07:00
evanpelle bb8c24e230 move config to Game 2024-08-24 12:12:46 -07:00
evanpelle bc8463fa79 game start delay 5 seconds 2024-08-16 20:42:10 -07:00
evanpelle 51c05f9d10 moved attack logic to config 2024-08-16 13:10:44 -07:00
evanpelle 332c2cfcac websocket reconnect on failure 2024-08-16 11:06:01 -07:00
evanpelle a4799a3c21 moved attack config to separate config class 2024-08-12 16:31:32 -07:00
evanpelle 14e7cb2ac9 better troop addition 2024-08-11 17:28:34 -07:00
evanpelle 13808f4d70 working 2024-08-10 20:10:28 -07:00
evanpelle 05f55c490f First Commit 2024-08-04 19:51:23 -07:00