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
This commit is contained in:
APuddle210
2025-04-02 13:45:37 -04:00
committed by GitHub
parent 524498ac75
commit 71ddeca7f0
24 changed files with 2158 additions and 1388 deletions
+1
View File
@@ -21,6 +21,7 @@ export const MapDescription: Record<keyof typeof GameMapType, string> = {
Australia: "Australia",
Iceland: "Iceland",
Japan: "Japan",
TwoSeas: "Between Two Seas",
KnownWorld: "Known World",
};
+3
View File
@@ -14,6 +14,7 @@ import northAmerica from "../../../resources/maps/NorthAmericaThumb.webp";
import oceania from "../../../resources/maps/OceaniaThumb.webp";
import pangaea from "../../../resources/maps/PangaeaThumb.webp";
import southAmerica from "../../../resources/maps/SouthAmericaThumb.webp";
import twoSeas from "../../../resources/maps/TwoSeasThumb.webp";
import world from "../../../resources/maps/WorldMapThumb.webp";
import { GameMapType } from "../../core/game/Game";
@@ -52,6 +53,8 @@ export function getMapsImage(map: GameMapType): string {
return iceland;
case GameMapType.Japan:
return japan;
case GameMapType.TwoSeas:
return twoSeas;
case GameMapType.KnownWorld:
return knownworld;
default:
+45 -6
View File
@@ -58,15 +58,54 @@ export abstract class DefaultServerConfig implements ServerConfig {
return 60 * 1000;
}
lobbyMaxPlayers(map: GameMapType): number {
if (map == GameMapType.World) {
return Math.random() < 0.3 ? 150 : 60;
}
// Maps with ~4 mil pixels
if (
[GameMapType.Mars, GameMapType.Africa, GameMapType.BlackSea].includes(map)
[
GameMapType.GatewayToTheAtlantic,
GameMapType.SouthAmerica,
GameMapType.NorthAmerica,
GameMapType.Africa,
GameMapType.Europe,
].includes(map)
) {
return Math.random() < 0.3 ? 70 : 50;
return Math.random() < 0.2 ? 150 : 70;
}
return Math.random() < 0.3 ? 60 : 40;
// Maps with ~2.5 - ~3.5 mil pixels
if (
[
GameMapType.Australia,
GameMapType.Iceland,
GameMapType.Britannia,
GameMapType.Asia,
].includes(map)
) {
return Math.random() < 0.2 ? 100 : 50;
}
// Maps with ~2 mil pixels
if (
[
GameMapType.Mena,
GameMapType.Mars,
GameMapType.Oceania,
GameMapType.Japan, // Japan at this level because its 2/3 water
].includes(map)
) {
return Math.random() < 0.2 ? 70 : 40;
}
// Maps smaller than ~2 mil pixels
if (
[GameMapType.TwoSeas, GameMapType.BlackSea, GameMapType.Pangaea].includes(
map,
)
) {
return Math.random() < 0.2 ? 60 : 35;
}
// world belongs with the ~2 mils, but these amounts never made sense so I assume the insanity is intended.
if (map == GameMapType.World) {
return Math.random() < 0.2 ? 150 : 60;
}
// default return for non specified map
return Math.random() < 0.2 ? 85 : 45;
}
workerIndex(gameID: GameID): number {
return simpleHash(gameID) % this.numWorkers();
+1
View File
@@ -60,6 +60,7 @@ export enum GameMapType {
Australia = "Australia",
Iceland = "Iceland",
Japan = "Japan",
TwoSeas = "Between Two Seas",
KnownWorld = "Known World",
}
+1
View File
@@ -39,6 +39,7 @@ const MAP_FILE_NAMES: Record<GameMapType, string> = {
[GameMapType.Australia]: "Australia",
[GameMapType.Iceland]: "Iceland",
[GameMapType.Japan]: "Japan",
[GameMapType.TwoSeas]: "TwoSeas",
[GameMapType.KnownWorld]: "KnownWorld",
};
+2
View File
@@ -19,6 +19,8 @@ const maps = [
"Australia",
"Pangaea",
"Iceland",
"TwoSeas",
"Japan",
"KnownWorld",
];
+7 -5
View File
@@ -280,20 +280,22 @@ function getNextMap(): GameMapType {
}
const frequency = {
World: 2,
World: 1,
Europe: 3,
Mena: 2,
NorthAmerica: 3,
BlackSea: 2,
Pangaea: 2,
NorthAmerica: 2,
BlackSea: 1,
Pangaea: 1,
Africa: 2,
Asia: 1,
Mars: 1,
Britannia: 2,
GatewayToTheAtlantic: 3,
GatewayToTheAtlantic: 2,
Australia: 2,
Iceland: 2,
SouthAmerica: 3,
Japan: 3,
TwoSeas: 3,
};
Object.keys(GameMapType).forEach((key) => {