mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 21:44:49 +00:00
ae884cb902
## Description: Adds New York City Map. ## Please complete the following: - [X] I have added screenshots for all UI updates - [X] I process any text displayed to the user through translateText() and I've added it to the en.json file - [X] I have added relevant tests to the test directory - [X] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: tidwell Screenshots <img width="1700" height="1081" alt="location-select" src="https://github.com/user-attachments/assets/06d229c1-f804-4766-bd58-35923c6696bc" /> <img width="1705" height="1079" alt="map-bots" src="https://github.com/user-attachments/assets/16a677d1-da6b-4aca-9ecf-8b0fbb161019" /> <img width="1706" height="1082" alt="map-select" src="https://github.com/user-attachments/assets/8adfd26b-f506-4c72-be05-a1fa638311ab" /> <img width="745" height="929" alt="nation-placement" src="https://github.com/user-attachments/assets/6b5ffd0e-0b2e-4189-b118-bd04c8ac4240" /> Misc Dimensions: 1500 x 1900 px Total Area: 2,850,000 px² New Flag Assets: None [Inspired by this Discord Thread](https://discord.com/channels/1284581928254701718/1440439003160641667/1440439003160641667) Some of the water features are adjusted for playability. NYC doesn't have a ton of elevation differences, so marshland is replicated w/ highland noise. This is roughly placed to match [Pre-WWI](https://www.geographicus.com/P/AntiqueMap/newyorkcity-usgs-1915), but allows maintaining the modern silhouette of the area. This 1901 map is also the main inspiration for composition and projection. For the Nations, British and Dutch Colonies along with Native Peoples make this a bit of an amalgamation of the 17th - 20th centuries Other elevation differences come from [Topographic Map](https://en-gb.topographic-map.com/map-6sm14/New-York/?center=40.63067%2C-73.89158&zoom=11) [Tribal Nation Names and Info](https://en.wikipedia.org/wiki/History_of_Long_Island) [Additional Tribal Names/Info](https://libguides.pratt.edu/c.php?g=1088684&p=9380209) --------- Co-authored-by: Evan <evanpelle@gmail.com>
MapGenerator
This is a tool to generate map files for OpenFront.
Installation
- Install go https://go.dev/doc/install
- Install dependencies:
go mod download - Run the generator:
go run .
Creating a new map
- Create a new folder in
assets/maps/<map_name> - Create image.png
- Create info.json with name and countries
- Add the map name in main.go
- Run the generator:
go run . - Find the output folder at
../resources/maps/<map_name>
By default, this will process all defined maps.
Use --maps to process a single map:
go run . --maps=fourislands
To process a subset of maps, pass a comma-separated list:
go run . --maps=northamerica,world
Create image.png
- Download world map (warning very large file)
- Crop the file (recommend Gimp)
- We recommend roughly 2 million pixels for performance reasons
- Do not go over 4 million pixels.
Create info.json
- Look at existing info.json for structure
- Use country codes found here
Example:
{
"name": "MySampleMap",
"nations": [
{
"coordinates": [396, 364],
"name": "United States",
"strength": 3,
"flag": "us"
}
]
}
To Enable In-Game
- Add a translation for the map name to
resources/lang/en.json - Add the MapDescription
src/client/components/Maps.ts - Add the numPlayersConfig
src/core/configuration/DefaultConfig.ts - Add the GameMapType
src/core/game/Game.ts - To add to the map playlist, modify
src/server/MapPlaylist.ts
Notes
- Islands smaller than 30 tiles (pixels) are automatically removed by the script.
- Bodies of water smaller than 200 tiles (pixels) are also removed.
🛠️ Development Tools
-
Format map-generator code:
go fmt .