Commit Graph

677 Commits

Author SHA1 Message Date
Xuarig ce676d0efb [Security] Added username sanitization on server (#299)
Fixing issues #282 where players can bypass max username length by
editing their storage. I added a sanitization on the server side to
avoid all kind of cheat on the username as we can't trust clients
2025-03-20 10:39:41 -07:00
evanpelle f0734eb848 faster "medium" players, slower "huge" players (#261)
Previous patch modified largeModifier to increase it. It boosted
attacker loss but also increased speed a lot (not intentional). We now
declare two different modifier for speed and for attacker loss. Attacker
loss should remain the same.
Speed was brought as before (to slow down a bit huge players). Except
instead of sqrt (exponent 1/2) we do exponent 0.6. So the speed modifier
decreases a bit faster with size (to disadvantage a bit huge players who
are invincible right now)

Co-authored-by: ilan schemoul <ilanschemoul@gmail.com>
2025-03-19 16:37:57 -07:00
evanpelle 2c9fc7307e fix config circular dependency (#296) 2025-03-19 15:42:47 -07:00
Evan 8e05268863 add region to worker metrics 2025-03-19 10:49:41 -07:00
Ilan Schemoul 3c17e09fee faster attack (#260) 2025-03-18 20:38:26 -07:00
Ilan Schemoul 26bfb84b7b SAM rebalance (circle radius, faster speed, smaller range) (#266)
see commit
2025-03-18 20:37:49 -07:00
Ilan Schemoul 24f25d677a sam is red when reloading (#268) 2025-03-18 14:16:02 -07:00
APuddle210 6b41cc9b75 Inversion of how water color was being set as it moved away from land… (#269)
Inversion of the way water values on the light palette get set as the
tile is further from land. Was previously resulting in the darkest water
being the closest to land.


![Before](https://github.com/user-attachments/assets/3b2d8e9a-0648-40ac-8725-c0bcbebf61ac)

![After](https://github.com/user-attachments/assets/6356758f-abbf-493b-a82b-652a9c642539)
2025-03-18 12:25:28 -07:00
Ilan Schemoul 6ad4ac86f4 feat: when player has no port warship do not capture trade or heal anymore (#280) 2025-03-18 12:07:51 -07:00
APuddle210 48d111bf0d Add new map, iberia, france, north africa (#285)
Addition of new map, 'Gateway to the Atlantic' covering Iberia, France,
and North Africa.

Tested via loading to local build, ensuring the game launched
succesfully, and ran a full game through to completion. Confirmed
thumbnail is displayed in the UI.

Discovered possibly undocumented bug: minimap binary generation fails if
either the width or height of the provided map image is an odd number.

Not sure what proper tests for a new map would look like, hope this is
sufficient testing.

![Thumbnail in
UI](https://github.com/user-attachments/assets/d78e51b8-8571-4244-bb55-8b4f95748108)

![Game
Starts](https://github.com/user-attachments/assets/124beaa3-8f57-4015-bdc6-7bde19a4a5ba)

![Game
Proceeds](https://github.com/user-attachments/assets/e8bb9a59-9bfb-4882-88c8-bf11d709244b)

![Game Proceeds
More](https://github.com/user-attachments/assets/7ec899eb-0338-4ec9-995f-20717e7f80b3)

![Game Proceeds
x2](https://github.com/user-attachments/assets/6c286cd6-4e13-4766-845e-393faebac116)

![Game
Completed](https://github.com/user-attachments/assets/20653b5e-0592-4a44-b3b3-58ea612a42b3)
2025-03-18 12:05:11 -07:00
evanpelle cd1f8b9586 add testing infrastructure and example test (#276) 2025-03-17 12:20:23 -07:00
Ilan Schemoul 0b2b042dae faster lobby (#274) 2025-03-17 08:56:47 -07:00
Evan 9a297308db don't use manhattanDistWrapped to prevent boat from starting on opposite side of world 2025-03-16 20:51:44 -07:00
Evan c4381a9ad3 encirclement bug: ensure player is inscribed before losing territory 2025-03-16 20:39:20 -07:00
Ilan Schemoul 46889077f0 sam can't touch mirv (only mirv warhead) (#259) 2025-03-15 19:32:45 -07:00
Ilan Schemoul b2d9bb670a nerf SAM (#258)
More costly (start at 1.5M), increase cost cap (4.5M), biggest timeout
(5s->10s), much lower chance to stop hydrogen (70%->10%), triple
construction time (10s->30s) otherwise it's trivial to build a SAM right
before a nuke hits
2025-03-15 18:22:14 -07:00
Evan 364387578b fix lobby duration at 60s now that we limit lobby size. remove "high traffic time" 2025-03-15 17:22:15 -07:00
evanpelle 0b9a75bb0c Remove path cache (#257) 2025-03-15 13:41:56 -07:00
evanpelle 4fdc570921 pad turns at the end on replay (#256) 2025-03-15 13:38:01 -07:00
Ilan Schemoul 275de50fcd feat: move warship (#196) 2025-03-14 16:30:30 -07:00
Ilan Schemoul baf91db288 tweak numbers of attack (#253)
Slightly decrease flat land advantage (in certain cases it feels almost
instataneous otherwise)
To calculate speed bonus use 4*attackTroops instead of 5 (people keep
complaining than small numbers of troops take crazy amount of lands
veryn quick)
Slightly increase minimum multiplier for attacker loss, to make
snowballing a little bit slower.
I only slightly modified numbers because the meta is fun it's just too
quick on certain cases.
2025-03-14 16:03:04 -07:00
Ilan Schemoul 2dd0c56583 fix: lobby were twice as long because of dynamic timer (#252)
We previously had a system where lobbyLifetime = gameCreationRate * 2
It was to always have one lobby ready.
With dynamic timer (start if enough player or timer's over) we cannot
rely on this system (which used setInterval) so we have one lobby and
check every 100ms if we need to create another lobby.
Might add 100ms+time of creating a lobby ms latency. Which is fine I
guess.
2025-03-14 14:30:05 -07:00
Evan d82191308e add back large attack modifier, make it 100k 2025-03-14 10:54:56 -07:00
Evan 462e1734b1 remove large territory attack bonus, will hopefully prevent too much snowballing 2025-03-14 10:22:45 -07:00
Ilan Schemoul da50aa28d2 feat: more trade when there are few ports worldwide (#242) 2025-03-14 09:45:40 -07:00
Ilan Schemoul c4f612eb98 easier to take nuclear land if most of the land are nuclear (#241)
- **Revert "Change BorderTiles from Array to Set (#230)"**
- **easier to take nuclear land if most of the land are nuclear**
2025-03-13 17:05:22 -07:00
Ilan Schemoul b9dad022fc fix timer (#239)
- **improve and fix dynamic lobby**
- **Revert "Change BorderTiles from Array to Set (#230)"**

I'm obviously forced to include the revert patch otherwise I can't
compile. but you should first merge PR dedicated to revert before tthis
2025-03-13 17:03:38 -07:00
Ilan Schemoul 70c3c43a5f feat: handle embargo fake human (#240) 2025-03-13 14:53:27 -07:00
Ilan Schemoul 7ec3f0c81f Revert "Change BorderTiles from Array to Set (#230)" (#238)
This reverts commit 8124651382 which
breaks compilation, has wrong indentation and uses flatMap without
Array.from which is also wrong.
2025-03-13 14:51:35 -07:00
Ilan Schemoul cb3f36a74f fix: update dst port when ship captured (#217) 2025-03-13 06:31:41 -07:00
ByGoalZ 8124651382 Change BorderTiles from Array to Set (#230)
Changed border constant from Array to Set, to avoid potential
duplicates.
2025-03-13 06:05:10 -07:00
Evan ad90f636b3 better check for profane username 2025-03-12 20:10:37 -07:00
Ilan Schemoul 07ad7912bc feat: timer starts if enough player or enough time (#229)
Avoid these huge lobbies
2025-03-12 14:18:34 -07:00
evanpelle 439f5af2bd PathFinder: return path not found when src or dst is null (#228) 2025-03-12 12:59:36 -07:00
evanpelle b1035a8e77 update to hetzner deployment (#220) 2025-03-12 09:17:27 -07:00
Ilan Schemoul 3ce5785d1e nuke icon (#207)
- **feat: white nuke icon next to name if player nukes you**
![Capture d'écran 2025-03-10
220439](https://github.com/user-attachments/assets/1b717b2d-bffb-45fc-96ea-2feb57d25de0)
- **feat: red nuke icon if player sends nuke towards you**
- 
![Capture d'écran 2025-03-10
220358](https://github.com/user-attachments/assets/b755fa06-9510-4bd1-8312-7180dc681d85)
2025-03-11 15:44:45 -07:00
Ilan Schemoul c4b8d6b92e cancel trade if port is captured (no trade inside same country) (#194)
If the port of destination and of source have same owner it means a
player captures port of another player, we cease all trade that happens
inside same country.
Also added a check in the canTrade code to be more reliable and correct
even outside of the specific case of capturing a port.
2025-03-11 12:33:45 -07:00
Ilan Schemoul 87d1a8d69d feat: retreat stops attack + show when ennemy retreats (#209) 2025-03-10 17:25:21 -07:00
evanpelle 9b71c8e78f use ticks instead of Date when retreating for determinism (#208) 2025-03-10 14:38:41 -07:00
Ilan Schemoul 4375797d92 feat: show a message when attack is canceled (with number of deaths) (#193) 2025-03-10 13:30:07 -07:00
evanpelle 5dc00bc3ab use git commit hash verification when replaying archived games (#204) 2025-03-10 12:40:36 -07:00
evanpelle 6a24bce213 fix decompress game record function, start at -1 (#203) 2025-03-10 07:21:24 -07:00
evanpelle e2f18df426 use center eucl dist on spawn tiles, looks nicer (#202) 2025-03-10 06:37:43 -07:00
evanpelle 33292aec5c feat: replay archived games, gamestate hash verification (#195)
create endpoint to load archived game. when joining game client first
checks if the game is active, if not it requests the game archive from
the server. the archive is sent to LocalServer to replay the game
locally. Every 10 ticks a hash is stored on the archive, and during
replay the LocalServer verifies this hash.
2025-03-09 14:24:39 -07:00
Readixyee 84951fed9f Sam anti nuke missile launcher (#176)
now with better name

---------

Co-authored-by: evanpelle <evanpelle@gmail.com>
2025-03-09 13:25:51 -07:00
Tiger McSwane 219d732f84 Added Britannia map with 23 NPC as well as their flags (#186)
Let me know if you have any questions or concerns. This is my first time
near coding, so it would not hurt to double check my work. Thanks!
2025-03-08 16:58:04 -08:00
evanpelle 4281095666 update maps: remove small lakes as it breaks encirclement. More money… (#188)
… more frequent trade ships, lakes prevent encirclement, warships start
at full health
2025-03-08 16:45:23 -08:00
evanpelle c99cec8f0b add South America map (#184) 2025-03-08 12:11:34 -08:00
evanpelle 09132495c0 Revert "have MIRV target all non allied players, increase price to 25… (#181)
… million"

This reverts commit 226112beb5.
2025-03-08 10:58:46 -08:00
Ilan Schemoul afe4f85919 fix: warship icon (#178) 2025-03-08 10:27:16 -08:00