Commit Graph

1425 Commits

Author SHA1 Message Date
Evan e65efdebc7 revert lobby times back to 60s, lobbies too small off times 2025-03-20 11:11:32 -07:00
Xuarig 2094a29c8b [UI] Added count on items of the construction menu (#297)
As suggested on the discord server
[here](https://discordapp.com/channels/1284581928254701718/1349545887801806869),
I've added the count of building and permanent units on the construction
menu.
It's included in each button, and follows the background colour of the
button on hover & disabled (see the screen below)

![In Game
Render](https://github.com/user-attachments/assets/b753a494-e9cc-49e3-90b9-f3fce7d8d8b4)
2025-03-20 10:43:26 -07:00
Xuarig 00e7425e74 [UI/Bugfix] Fixed the player info overlay displaying false when troops where equal to 0 (#298)
The player info was: 

![Before](https://github.com/user-attachments/assets/1fc3a4f1-3052-4a0d-b310-f94de10178a0)

I fixed it to:

![After](https://github.com/user-attachments/assets/901ffc10-4d93-4418-9d56-e3b94a4fb5af)

One thing I'm not sure about, is if we want to hide the attacking troops
on 0 or always show it? In this PR it's always shown.
2025-03-20 10:40:52 -07:00
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 b34dd8acf2 only send desync message once per client (#300) 2025-03-20 10:38:36 -07:00
Evan bfb1c4f138 fix region env variable, fix metric name typo 2025-03-19 20:43:13 -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
APuddle210 a9f21b07b5 Add the New Flags from Britannia and North America to the Flag Picker Options for the Players (#294)
Does what the title says. I made sure there were no duplicate entries.
Tested by launching the dev build and confirming the flags are all
present.

While all have present items, a couple (Alaska and West Virginia) do
fail to render. I think this is because the .svg files are too large.
Selecting these flags does not cause any issues upon entering the game,
they're just invisible.

In any event I am working with N0ur on some more flag updates that will
be forthcoming in the next few days, will address these couple then.

![New
Flags](https://github.com/user-attachments/assets/2229f7f0-e7e0-4c42-be3a-3223292a66a9)

![New Flags
2](https://github.com/user-attachments/assets/158c1c4d-c19b-4ddb-ba14-101bb57f13da)
2025-03-19 15:59:25 -07:00
APuddle210 95f3c725a0 Minor map tweaks (#295)
Fix of two trimmed off bits of river. Changed 2 pixels on the input png,
and regenerated the binaries. Did not recreate the thumbnail as it
wouldn't be noticeably different.

Launched game to confirm working.


![Capture](https://github.com/user-attachments/assets/62fe32c8-95c5-45b0-987c-ac8d0ba70b4b)
2025-03-19 15:58:30 -07:00
evanpelle 2c9fc7307e fix config circular dependency (#296) 2025-03-19 15:42:47 -07:00
APuddle210 882a39ee70 Added thumbnail generation to the TerrainMapGenerator script. (#292)
Added functions to TerrainMapGenerator to create a bitmap from the
Minimap Terrain array with the colors being identical to those rendered
in game, with the additional change of setting the Alpha of all water to
0.

Calls added to generateTerrainMaps to actually generate the thumbnail
PNGs,

Revision to src\client\utilities\maps.ts to reflect that the images
pulled into the UI should be those ending in 'Thumb.png,'

I've tested by launching the game and starting a few matches.

hile I'd hoped that using the minimaps as the basis for the thumbnails
would speed things up I think the actual bottleneck is the writing to
the file system.

Below is a screenshot showing these thumbnails in the UI.

![Thumbnails
Transparent](https://github.com/user-attachments/assets/764f7857-b333-47b6-9a0d-b0d4f4eb88cd)


![Capture](https://github.com/user-attachments/assets/4df17927-0ad0-45c6-bcc5-7ddc490d9ce7)

![Capture
1PNG](https://github.com/user-attachments/assets/3bd78d61-644a-4b4d-9646-df260a0e7c0f)

![Capture
3](https://github.com/user-attachments/assets/e7693a8b-1daf-4bd7-96d4-3a350564f31b)


Finally I will say that while the code additions work, given my novice
status with typescript and asynch calls these changes may benefit more
from review and a little critical feedback before they're ready to
merge.
2025-03-19 10:55:33 -07:00
Evan 021b40207e update version 0.20.0 2025-03-19 10:50:13 -07:00
Evan 8e05268863 add region to worker metrics 2025-03-19 10:49:41 -07:00
Evan 9d2ca6cc89 fix prometheus metric labels 2025-03-19 10:17:48 -07:00
Evan 52fd056328 Merge branch 'main' of github.com:openfrontio/OpenFrontIO 2025-03-19 10:06:59 -07:00
Evan 0169b29de1 prefix metrics with openfront 2025-03-19 10:06:56 -07:00
PilkeySEK ebc2b74049 Add instructions for SAM Launcher (#293)
In need of a SAM icon 🙏
2025-03-19 09:03:40 -07:00
Evan d3ea3bfeed Merge branch 'main' of github.com:openfrontio/OpenFrontIO 2025-03-19 08:24:33 -07:00
Evan 350ff217b6 better metrics aggregation logic 2025-03-19 08:24:28 -07:00
APuddle210 e4686642a0 Replace Africa Map files (#262)
Replaces the existing Africa with a revised, identically sized one.
Revisions include addition of navigable rivers allowing the interior to
have access to trade.

Chnages to the json file to take the number of Nation bots from 5 to 36.
Should help prevent so much early game blobbing on this map.
2025-03-18 20:39:45 -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 af0177baa1 feat: add a lot more info in player overlay (#279) 2025-03-18 20:37:09 -07:00
Ilan Schemoul 40b7fe9833 feat: add warship tests (#291) 2025-03-18 20:35:31 -07:00
evanpelle 6499569240 add winston logger (#289) 2025-03-18 14:36:30 -07:00
evanpelle bd2c270ba3 fixed inverted check for game start (#288) 2025-03-18 14:18:18 -07:00
Ilan Schemoul 24f25d677a sam is red when reloading (#268) 2025-03-18 14:16:02 -07:00
APuddle210 a402242f11 Replacing existing map images with colorized ones (#263)
Replacing existing map images with colorized ones for use in the UI.
Confirmed no unintended impacts by receating the map binaries and no
differences being identified by Git.

Africa was not colorized in this one since it is replaced entirely in PR
262.
2025-03-18 13:29:49 -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
Hristiyan Simeonov 65dd485646 FIX: Removed duplicate hotkey instruction (#277) 2025-03-18 12:17:38 -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
Evan 5188792cf4 delete public lobby when greater than or equal. this was causing the lobby to overfill when 2 clients joined within 250ms 2025-03-18 12:04:09 -07:00
Evan 952c747c51 still allow nginx to cache root for 1 second 2025-03-18 10:12:42 -07:00
Evan b20b6a6ba7 Merge branch 'main' of github.com:openfrontio/OpenFrontIO 2025-03-18 09:57:31 -07:00
Evan 388aafbbf5 add more aggressive headers to prevent caching the root. 2025-03-18 09:57:28 -07:00
evanpelle 70e348c94b Export prometheus metrics (#286) 2025-03-18 09:00:05 -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