Commit Graph

45 Commits

Author SHA1 Message Date
Duwibi 027f9ac9ac Add Faroe Islands map (#441)
## Description:
This PR adds the new "Faroe Islands" map that is based on the real
islands. It has 6 nations - the 6 regions of the Feroe Islands.

Fixes #460

## Please complete the following:

- [ ] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Nikola123
2025-04-17 08:51:48 -07:00
Duwibi 51bbf2becd Fix difference in translation strings regarding the new Between Two Seas map (#416)
##Description:
I renamed all instances of "TwoSeas" to "BetweenTwoSeas". That way it
lowers the confusion but more importrantly - it removes the difference
between the translation strings for the map.

Please put your Discord username so you can be contacted if a bug or
regression is found:

<Nikola123>
2025-04-04 09:42:56 -07:00
APuddle210 71ddeca7f0 Map Revisions, one Addition, and Adjustment to Lobby Max Player based on Map Sizes (#389)
## Description:

Implementation of separate lobby playlists, one for large maps another
for small, with the implementation framework being easily adjusted for
additional playlist categories in the future (such as fantasy maps).

Addition of new map 'Between Two Seas' a small map, replacing Black Sea
in the public lobby rotation (Black Sea retained for singleplayer or
private lobbies.

Adjustments to lobbyMaxPlayer configuration function. Broke out into
tranches by map pixel count, commented to communicate to other collabs
which tranch to place their map in. This change pairs well with the
adjustment to lobby map selection to alternate between big and small
maps. For the Potato (and mobile) players.

Revision to Mena, adding lakes and rivers.

Revisions to Japan, adding lakes and rivers, slight change of bounds to
include more mainland and less ocean.


![image](https://github.com/user-attachments/assets/434ad418-3ad4-40d4-841f-2ab71d13effd)


![image](https://github.com/user-attachments/assets/c46863b4-6a29-494f-82f0-d249c5017c1d)


![image](https://github.com/user-attachments/assets/c1e10fc4-b5e8-465a-a4eb-d325447df954)


The below no longer applies, I talked to Duwibi (Nikola123) who
explained the source of the issue is outside my control, but that he was
taking the action necessary to resolve.

The only issue still present after testing the the display of the map
name for Between Two Seas on the Public Lobby button. I've asked for
assistance with this issue on the Discord and will submit a fix as soon
as I can figure out its cause. Does not impact gameplay and its 3:30am
so hopefully this issue is not enough to prevent a merge as aside from a
quick fix PR, I don't think I'll be able to do any more work until after
this weekend.


## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

aPuddle
2025-04-02 10:45:37 -07:00
michaelabilliot 524498ac75 Added Game of thrones map (#390)
## Description: The entire world from game of thrones

Thanks to apuddle7 on discord for helping me a lot with this map
especially the rivers

![Screenshot 2025-04-01 at 19 35
09](https://github.com/user-attachments/assets/d96e2de5-06f4-4103-877b-0dbf33a34137)
![Screenshot 2025-04-01 at 19 36
25](https://github.com/user-attachments/assets/22ccd251-e7ef-4f7e-b943-afa2e9c445ae)
![Screenshot 2025-04-01 at 19 23
11](https://github.com/user-attachments/assets/aa4de47b-c5bd-4610-ba84-713a4b4f7da3)

## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

Discord: 
lunhuiyan1718
2025-04-02 10:25:57 -07:00
Aotumuri 4c776629f3 Optimize Water Tile Distance Calculation with BFS (Manhattan Distance) (#396)
## Description:
Replaced with BFS from shoreline tiles to propagate Manhattan distances
efficiently in O(W) time.
I’ve confirmed that the results match the previous implementation, but
please double-check on your end as well just to be safe.
I’d also like to get input from aPuddle.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>
aotumuri
2025-04-02 10:22:37 -07:00
Evan 8b6895d745 add prettier import plugin 2025-03-31 13:09:27 -07:00
Mittanicz 6678d6e36e Image optimalization (#343)
I have minify images and convert them to webp format that reduce size
and keep quality.
Reduce size of bg image since its already blured by css so no need to
have it that big.

Reduce size of thumbs and helper images in helper modals should be fine
since they will not exceed the container size. Even that make them
larger than containter just to be safe
2025-03-26 10:05:45 -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
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 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
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
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
Ilan Schemoul 40b7fe9833 feat: add warship tests (#291) 2025-03-18 20:35:31 -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
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
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
BeGj 619891741f linting 2025-03-07 16:53:10 +00:00
Evan 84f067d66b remove small lakes, use largest body of water as ocean 2025-03-03 20:00:12 -08:00
ilan schemoul 373a1aacf7 feat: remove small islands when loading a map
Also updated the map loader to now run on every single map (in the
`maps` array).
Also now maps are loaded concurrently (run every promise at the same
time and wait that they are all finished). As the functions are CPU
bound and not IO bound running concurrently doesn't change much right
now but it can if we use more promise in the function loadTerrainMap
then things will get faster.
2025-03-02 22:47:09 +01:00
Evan db4e520886 fix africa map: add straight of gibraltar 2025-03-02 09:29:10 -08:00
Evan 4ccd6071c6 connect ocean on asia map to allow boats 2025-02-23 20:37:39 -08:00
Evan 4ee37323f9 format codebase with prettier 2025-02-01 12:05:11 -08:00
Evan f0f5bae79f thread_split: convert all tile to tileref 2025-02-01 12:05:11 -08:00
Evan eed90dece5 update europ and world maps 2025-01-05 12:56:04 -08:00
Evan f7fda4fb48 remove single pixel lakes 2025-01-05 12:38:06 -08:00
Evan 903a630953 added Black Sea 2025-01-02 11:16:43 -08:00
Evan 2ceeda051d added suez canal 2024-12-27 10:21:09 -08:00
evanpelle 111775a3f4 generate mini map offline and load it from binary. this reduces loading time by 30-40% 2024-12-25 11:27:36 -08:00
Evan 951585a8ed NorthAmerica has panama canal, fixed ocean calculation for Oceania 2024-12-12 21:00:10 -08:00
Evan da7637477c add Oceania and North America maps 2024-12-08 20:56:19 -08:00
Evan 30f72a3365 NPCs create battleships, destroyers. start work on miniastar 2024-11-30 12:41:22 -08:00
Evan 3e4f4e42cf created path finding web worker 2024-11-29 11:34:03 -08:00
Evan 8b76717ef0 added Mena 2024-10-30 20:45:08 -07:00
evanpelle 0904125b69 fix terrain map generator 2024-10-11 14:26:37 -07:00
evanpelle bb8827c8ad use europe map 2024-10-09 10:51:56 -07:00
evanpelle 7235b73b6c * deleted old maps
* fixed bug where NPC and Bots had same id
* NPCs spawn near IRL location
* NPCs have different strength (starting troops)
* game has more NPCs than before
* Needs more balancing
2024-10-08 20:42:35 -07:00
evanpelle 9c58f99968 improve map terrain color 2024-08-31 14:43:33 -07:00
evanpelle 8b2c2a13c0 add terrain to map 2024-08-30 22:01:08 -07:00
evanpelle 41d7c77d2d tiles now have lake or ocean method 2024-08-23 17:53:55 -07:00
evanpelle 98cf1b6beb create binary repr of map 2024-08-23 12:08:57 -07:00
evanpelle ac556ee073 preprocess map into binary data 2024-08-22 21:01:40 -07:00
evanpelle d0f4f4d129 create script to pack and upack map data 2024-08-21 08:06:36 -07:00
evanpelle 8bd86d0384 trying to build protos 2024-08-20 08:11:41 -07:00