Commit Graph

1451 Commits

Author SHA1 Message Date
Evan 25d5cc3702 Update client code to GPL 2025-03-25 14:35:14 -07:00
MRH 9866dbb73a Added map Pangaea (#320)
This map was made by mashing up the world map and putting it in the
general shape of the super-continent
[Pangaea](https://en.wikipedia.org/wiki/Pangaea) It's not super accurate
but the continents are generally in the right places and the nations are
more or less the same as on World, placed in the general location where
they would have been. Hope this is good enough to be added into the
game; even if only among custom lobby maps!
2025-03-25 08:14:29 -07:00
Aotumuri 583217cdb6 Corrected some translations. (#336)
Corrected some translations.

---------

Co-authored-by: Cldprv <dubois.cnm@tutanota.com>
Co-authored-by: jacks0n <rosty.west89@gmail.com>
2025-03-25 08:12:58 -07:00
Mittanicz ebe142a62a Layout setup (#338)
Create css strucure, clean up the index html and use proper tags.
Visualy minor changes, but this allow us maint better visuals and start
the css standards that will help us future
2025-03-25 08:11:58 -07:00
Evan 4849da4fa6 update version 2025-03-24 21:37:03 -07:00
APuddle210 40befee080 Optimize terrain map gen perf (#334)
### Summary
Investigated and resolved slow execution time of this script since the
addition of the thumbnail generation functionality. Determined that
thumbnail generation was not the source of the increased execution time,
likely due instead to change from bun back to npm. Some other minor
improvements made.

### Execution Time Optimizations
Investigated which components of the process were taking the most time
and determined the longest running component to be the
`removeSmallLakes()` function. Research determined that the `.forEach`
looping method to be significantly slower than the `for (const var of
vars)` method and replaced all instances of the former with the latter.

Further review identified possibility to reduce the number of calls to
the getArea() function by combining the `removeSmallLakes()` with the
`processOcean()` function, which was already determining the size of all
bodies of water.

After revision to the `forEach` loops and inclusion of
`removeSmallLakes()` within `processOcean()`, the next slowest executing
component was the `processDistToLand()` function. Aside from being slow
this function was also difficult to understand. Revised function perform
Manhattan distance calculations against the `shorelineWaters[]` array
and identify the minimum value rather than walking out from the
shoreline using the `neighbors()`. This change yielded between ~35% -
~45% faster execution times for this function (~275 seconds -> ~150
seconds; ~225 seconds -> ~165 seconds).

The change to `processDistToLand()` was tested by running the new
version of the function alongside the old version of the function and
having any differences in the calculated distance to land printed to the
console. Initially the test identified errors arising from a reference
to an x coordinate value that should have been a y coordinate value.
Once resolved no further differences were found.  

### Other Minor Changes
Changes to `processOcean()` now also explicitly prevent the largest body
of water from being removed, regardless of what value is passed in for
`removeSmall`, and additionally nest the calls to `processShore()` and
`processDistToLand()` within this function rather than within
`generateMap()` for better comprehensibility. `processOcean()` renamed
to `processWater`.

Also inserted additional console.log lines to better communicate state
of the scripts during runtime, removed unnecessary export statement from
`createMiniMap()` function which requires parameters not readily
available from outside contexts (and which was not called externally
anyways). Revised multiple instances where `terrain` was used to refer
to a single item of a Terrain[][] array to instead use `tile` for
comprehensibility, and consistency with the terminology used elsewhere
in the application.

Added an explicit variable declaration of `removeSmall` to the
generateTerrainMaps.ts file and included it in the call to
`generateMap()` to make toggling this option easier in the future. Moved
the `min_lake_size` constant out of the relevant function and to the top
of the TerrainMapGenerator.ts file for better visibility and consistency
with where `min_island_size` is being declared.
2025-03-24 20:32:51 -07:00
Duwibi 42bb043b0a Add the Bulgarian language (#314)
Adding the base bulgarian language json file and making it usable in
game. This PR is building on top of the multi language support PR. Note:
Needs PR #316 to work!
2025-03-24 20:31:44 -07:00
Aotumuri 9088adeb7a Translate all out-of-game UI (start screen, lobbies, etc.) (#316)
This PR adds full translation support for all out-of-game UI elements,
including the start screen, public/private lobby modals, and other
pre-game interfaces.

All static text has been externalized to en.json and ja.json for future
language support.
If you find any spots that are not yet translated (missing from the
JSON), please let me know.
Thanks a lot!

This is a follow-up to PR
[#305](https://github.com/openfrontio/OpenFrontIO/pull/305).

---------

Co-authored-by: Cldprv <dubois.cnm@tutanota.com>
Co-authored-by: jacks0n <rosty.west89@gmail.com>
2025-03-24 17:12:04 -07:00
Aotumuri f188af6029 Added SAM icon due to missing asset (#318)
There was a report on Discord about the SAM icon not displaying
correctly.

https://discord.com/channels/1284581928254701718/1353348395506466937/1353348395506466937
After checking the CSS, I found that it was referencing a non-existent
path.
Since there was no dedicated image for the SAM, I created a custom one
to replace it.

Let me know if any adjustments are needed!
Thank you!
<img width="324" alt="スクリーンショット 2025-03-23 22 53 38"
src="https://github.com/user-attachments/assets/157f9b70-615c-4454-baaf-7f0c33e98ecf"
/>
<img width="759" alt="スクリーンショット 2025-03-23 22 42 33"
src="https://github.com/user-attachments/assets/35f3ea51-5804-4007-8e8d-40659f47276a"
/>
2025-03-24 15:47:07 -07:00
Aotumuri 7773754e84 Fixed flag not displaying for West Virginia (#319)
The flag for West Virginia was not displaying correctly.
This was due to a mismatch between the key (West_Virginia) and the
displayed name (West Virginia).
I corrected the key reference to ensure the flag loads properly.
<img width="171" alt="スクリーンショット 2025-03-23 23 02 02"
src="https://github.com/user-attachments/assets/be18538b-18e5-462c-b52e-b37d6399ae08"
/>
2025-03-24 15:45:23 -07:00
Duwibi ab44751b08 Adding Iceland map (#323)
This is a map of Iceland. It has 8 nations - the 8 regions of Iceland.

![IcelandScreenshot](https://github.com/user-attachments/assets/1debe786-1dac-4274-85e2-9a0c090bd3b0)

![IcelandScreenshot1](https://github.com/user-attachments/assets/681e4a8f-4603-4434-9714-d76b49b82a6e)

![IcelandScreenshot2](https://github.com/user-attachments/assets/69841915-14f4-4e13-961f-c5e523668d41)

![IcelandScreenshot3](https://github.com/user-attachments/assets/51225d7a-c1df-4890-a56f-d459fe62a534)

![IcelandScreenshot4](https://github.com/user-attachments/assets/a5880022-765f-4e62-8f55-2b93d8b89f84)

![IcelandScreenshot5](https://github.com/user-attachments/assets/ec0d6efc-1056-45a1-ad03-152cb5a2baf6)

![IcelandScreenshot6](https://github.com/user-attachments/assets/56c8c8cb-2b3d-41e0-a55d-37b21b4442e3)

![IcelandScreenshot7](https://github.com/user-attachments/assets/b7a7833c-ef64-4067-a44f-c8a762bed0bc)

![IcelandScreenshot8](https://github.com/user-attachments/assets/d9edd402-7885-4e26-95c6-33d387493a80)
2025-03-24 15:44:57 -07:00
MRH 6a82b8eefc Improved structure legibility (#332)
Updated structure icon border rendering to improve legibility, I often
find that I miss important enemy structures like SAM launchers as they
share a similar icon to many other structures.

Supported shapes:
- Square (SAM, Missile)
- Round (City, Port)
- Hexagon (Defense post)
- Diamond (not used, square rotated 45deg)


![image](https://github.com/user-attachments/assets/85e70f6a-b9d1-4837-b3fb-230d752675db)
2025-03-24 15:34:14 -07:00
MRH 5a1451b430 Improved options panel (#328)
Minor improvements to options-panel and player info panel.

- Improved time display
- Added margin to align with leaderboard
- Better option button layout
- Added flag to player info


![image](https://github.com/user-attachments/assets/b51c8239-caf5-4526-97ac-a33a9d22eff2)
2025-03-24 10:42:49 -07:00
Mittanicz 166ef92970 Create base components button, modal .. (#331)
Create base components with shared styles, as start of make ui better.
For now shoul look same but underhood new copoments are used.

This should be first PR that handle this and many more comes. I am in
rush due conflict with other ppl, but should work as i tested.

Testing again and look at structure

Main goal i have global css not scope in component die loading times and
size of elements. (Modal due nature of lit and shadow dom is exception,
maybe later find better way).

Documenting the components will happen later as base components
establish their usage.
2025-03-24 10:34:27 -07:00
Evan f7c6b0d585 add node-exporter to setup 2025-03-22 17:01:51 -07:00
Evan 2080b4ebe7 use loki plugin to push logs 2025-03-22 13:26:47 -07:00
evanpelle f87394062d add steam libraries, make electron a separate node package (#313) 2025-03-22 10:45:51 -07:00
evanpelle f6e2ca371f Add electron deployment (#312) 2025-03-22 09:29:07 -07:00
Evan f408738db9 update MIRV to 20M 2025-03-22 08:42:57 -07:00
Duwibi b72032e6f1 Added Australia map with 7 bots and their flags (#306)
This is a map of the Australian country. It has 7 bots - the 7 states of
the country. This is my first time making a pull request, so I'm sorry
if i messed something up or something doesn't work.
2025-03-21 15:49:10 -07:00
Readixyee e02361c2f4 Disable nukes option (#237)
This makes it possible to disable all nukes as well as missile silos
from the game in privat lobbies and singleplayer games
2025-03-21 13:52:36 -07:00
Aotumuri c4614fe0ba Add multi-language support to the start screen and help-modal (#305)
This pull request adds multi-language support to the start screen.
Languages are managed via JSON files, making it easy to add new
languages in the future.

I added a basic language selection button for switching between
languages.
However, I believe it would benefit from a better design — my design
skills are limited, so I apologize in advance.

Looking forward to your feedback and possible design improvements.
2025-03-21 13:51:04 -07:00
APuddle210 2392f3a2fe Update NorthAmerica.json (#303)
Just removing some bots from the densest populated parts of the map.
Hopefully will improve responsiveness of the game for some players when
on this map.

Also correcting the map dimensions in the json (I forgot to update
those).
2025-03-21 10:21:24 -07:00
APuddle210 2cac950574 Add gateway map to rotation (#301)
Changes made via GitHub editor. I'll test as soon as I get home ~2.5-3
hours from now.
2025-03-21 10:19:59 -07:00
Ilan Schemoul 68621f326a sam do not target twice same nuke (#270) 2025-03-21 10:17:33 -07:00
Juan Broullon d4ddffe1eb fix: nginx not caching static resources (#254)
The current nginx config isn't caching any images given they're not
being served under the `/static/` path.
2025-03-21 10:06:09 -07:00
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