Commit Graph

1247 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
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
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 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 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
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
Ilan Schemoul 0b2b042dae faster lobby (#274) 2025-03-17 08:56:47 -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 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
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
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
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