Commit Graph

1389 Commits

Author SHA1 Message Date
Evan 388aafbbf5 add more aggressive headers to prevent caching the root. 2025-03-18 09:57:28 -07:00
Evan fe3b4fb8cc update the readme: code in core must be tested 2025-03-17 19:59:30 -07:00
evanpelle b1c78ccca7 add test action (#281) 2025-03-17 16:52:32 -07:00
Evan 466b97fe77 add log options to docker run 2025-03-17 16:35:55 -07:00
Evan 4816ac7a61 update README to use npm instead of bun 2025-03-17 13:33:12 -07:00
Evan da1b3dbf4b update build script to use regions instead of prod/alt, just single build for docker, remove bun start up 2025-03-17 13:30:48 -07:00
evanpelle cd1f8b9586 add testing infrastructure and example test (#276) 2025-03-17 12:20:23 -07:00
Peter bd91d7c00b Game server ticks too much. Removed duplicate call to .tick (#271)
removes gameManager.tick as it is already ticking inside the
gameManagers contructor
2025-03-17 08:58:45 -07:00
APuddle210 a9fe042c53 Add New North America, and 50 US State Flags (#273)
Revised North America Map, added lakes and rivers, some manual edits
around the northern coasts to preserve the jagged fjordness, added ~53
bots to the json, to fill in all the empty space (makes for a very fun
solo run, may need to reduce somewhat once the players get a chance to
try it).

Added 50 US state flags to the resources folder. 

**Can now Nuke Santa.**
2025-03-17 08:58:26 -07:00
Ilan Schemoul 0b2b042dae faster lobby (#274) 2025-03-17 08:56:47 -07:00
Evan 4086598a1a run npm install update deps 2025-03-17 08:56:19 -07:00
Evan 321cf5e110 update gatekeeper 2025-03-16 20:53:51 -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 f0b2d0d065 remove bun build from deployment 2025-03-16 20:40:56 -07:00
Evan c4381a9ad3 encirclement bug: ensure player is inscribed before losing territory 2025-03-16 20:39:20 -07:00
Evan 2c075fc382 Revert "initial bun setup"
This reverts commit 5236f7a212.

bun was causing code 1006 websocket errors
2025-03-16 20:37:04 -07:00
Ilan Schemoul 46889077f0 sam can't touch mirv (only mirv warhead) (#259) 2025-03-15 19:32:45 -07:00
Evan 8cd8d5bf60 add Britannia, reduce world & europe frequency 2025-03-15 18:24:26 -07:00
Evan c7259bc0d9 update version 0.19.1 2025-03-15 18:22:44 -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
Evan b83075baea add contribution guidelines to the README.md 2025-03-15 14:09:59 -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
Peter c0d6889e4d possible discrepancy between map bins and build-map script (#249)
i just ran build-map script and the bins were different than the ones in
main...
2025-03-14 16:31:04 -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
Evan 67c1ff2158 store game hashes on singleplayer 2025-03-14 15:48:25 -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
evanpelle 4a6ce12988 archive full game on crash (#251) 2025-03-14 14:08:16 -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
Ilan Schemoul a1d0c87232 remove Game starts when ... in lobby (#233) 2025-03-13 06:02:45 -07:00
APuddle210 67af4b06ab TerrainMapGenerator General Cleanup (#234)
> There were 4 separate implementations of getting neighboring
coordinates for a given x,y pair, 3 completely unique implementations.
These were found in neighbors(), processOcean(), processDistToLand(),
and getArea(), with processOcean() and processDistToLand() having
essentially identical implementations. Created new function
getNeighborCoords() with implementation closely resembling that found in
neighbors().

Revised aforementioned functions to utilize the new getNeighborCoords()
instead, with revised implementations being much more consistent across
the impacted functions.

> Revised getArea() to correctly assess the area, was previously likely
to overestimate the area as it included all coordinates it check
regardless of their terrainType. getArea() now also explicitely
implements the Coord[] interface, allowing for standardized
implementation syntax in all functions which call getArea().

Also removed the parameter targetType as all calls to getArea()
targetted the same TerrainType as was present at the passed x, y
position. getArea() will now assess targetType based on the passed x, y
values.

Reordered the parameters of getArea() so that it conformed with the
ordering used elsewhere in the script (x, y, map, visited). Updated all
calling locations accordingly.

> Revised processOcean() to make use of getArea() instead of using its
own reimplementation of area checking. This coupled with the use of the
new getNeighborCoords() significantly reduced the size of processOcean
and improved comprehensibility.

Also removed unnecessary check of waterBody.size that would always
return TRUE in that context.

> Removed checks against and setting of Terrain.ocean values in the
removeSmallIslands() and removeSmallLakes() functions as these functions
are called prior to processOcean() making the checking
redundant/unncessary, and the setting potentially problematic.

Revised Terrain class to default ocean to false, to address compiler
warning, and since processOcean() handles setting this property to true
explicitly.

Reduced total lines from 417 to 372.
2025-03-13 06:02:30 -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
Ilan Schemoul cef8a61d9c fix: crash when spectating (#232)
Nuke icon patch added a crash when spectating game (myPlayer is NULL)
2025-03-12 14:17:11 -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 8b5d402d96 fix nginx.conf (#226) 2025-03-12 12:29:08 -07:00
evanpelle ea628570b2 have nginx cache index for 1s. (#224)
This is required for A B deployments, the browser wasn't updating due to
conditional caches
2025-03-12 11:03:28 -07:00
evanpelle 920dafc425 update deployment: add alt deployment (#223) 2025-03-12 10:40:51 -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