diff --git a/docs/RENAMING_A_PROVINCE.md b/docs/RENAMING_A_PROVINCE.md new file mode 100644 index 0000000000..4a5b0b0b04 --- /dev/null +++ b/docs/RENAMING_A_PROVINCE.md @@ -0,0 +1,79 @@ +# Renaming a Province + +This document explains the steps required to rename a province in Eagle0. + +## Files to Modify + +### 1. Province Map TSV (Server Source of Truth) + +**File:** `src/main/resources/net/eagle0/eagle/province_map.tsv` + +This is the primary source of province data. Each row contains: +- Province ID +- Province name +- Neighbor IDs +- Neighbor directions +- Province name (repeated) +- Neighbor names (dot-separated) +- Starting food + +You need to: +1. Change the province name in its own row (columns 2 and 5) +2. Update the neighbor name references in all neighboring provinces (column 6) + +Example: To rename "Fluria" to "NewName", you would need to update: +- Line 26: The Fluria row itself +- Lines 5, 10, 18, 24, 27, 38, 41: All provinces that list Fluria as a neighbor + +### 2. LLM Map Description + +**File:** `src/main/scala/net/eagle0/eagle/library/actions/llm_prompt_generators/MapDescription.scala` + +This file contains a hardcoded geographic description of the map used in LLM prompts for generating narrative text. Update any references to the old province name. + +### 3. Client Centroids JSON + +**File:** `src/main/csharp/net/eagle0/clients/unity/eagle0/Assets/Eagle/centroids.json` + +This JSON file contains province metadata used for map rendering (centroid positions, areas, orientations). Each entry has a `name` field that should be updated to match. + +Note: The actual province name displayed to players comes from the server via the `ProvinceView` proto, not from this file. However, this file should be kept in sync for consistency and because it may be used for map label positioning. + +### 4. Test Files + +**File:** `src/test/scala/net/eagle0/eagle/library/util/validations/RuntimeValidatorTest.scala` + +Update any test strings that reference the old province name. + +## How Province Names Flow to the Client + +Province names are sent from the Eagle server to the Unity client via the `ProvinceView` protobuf message: + +```protobuf +message ProvinceView { + int32 id = 1; + string name = 6; // <-- Province name sent from server + ... +} +``` + +The server reads province names from `province_map.tsv` at startup. The client receives names through the proto and displays them via `province.Name` in C# code. This means: + +- Changing the TSV automatically updates what clients see +- No C# code changes are needed (the code uses `province.Name` generically) +- The `centroids.json` name field is for map rendering/positioning, not display + +## Files That Do NOT Need Changes + +- **Hero backstory TSV files** (`heroes.tsv`, `generated_heroes.tsv`) - These don't contain province name references +- **C# client code** - Uses `province.Name` from the server proto, not hardcoded names +- **Proto definitions** - No province names are hardcoded in protos + +## Checklist + +- [ ] Update `province_map.tsv` - province's own row +- [ ] Update `province_map.tsv` - all neighbor references +- [ ] Update `MapDescription.scala` +- [ ] Update `centroids.json` +- [ ] Update any test files with province name references +- [ ] Build and run tests: `bazel test //src/test/scala/...` diff --git a/src/main/csharp/net/eagle0/clients/unity/eagle0/Assets/Eagle/centroids.json b/src/main/csharp/net/eagle0/clients/unity/eagle0/Assets/Eagle/centroids.json index 653ce872e2..807e646569 100644 --- a/src/main/csharp/net/eagle0/clients/unity/eagle0/Assets/Eagle/centroids.json +++ b/src/main/csharp/net/eagle0/clients/unity/eagle0/Assets/Eagle/centroids.json @@ -387,7 +387,7 @@ }, { "id": 40, - "name": "Faluria", + "name": "West Faluria", "centroid_x": 976.0, "centroid_y": 746.0, "area": 80344, @@ -398,7 +398,7 @@ }, { "id": 25, - "name": "Fluria", + "name": "East Faluria", "centroid_x": 1245.0, "centroid_y": 836.0, "area": 155157, diff --git a/src/main/resources/net/eagle0/eagle/province_map.tsv b/src/main/resources/net/eagle0/eagle/province_map.tsv index 39f63779f0..ec9adff546 100644 --- a/src/main/resources/net/eagle0/eagle/province_map.tsv +++ b/src/main/resources/net/eagle0/eagle/province_map.tsv @@ -1,44 +1,44 @@ id name neighbors neighborPositions hexMapName neighborNames castleCount 1 Shumal 18.36 7.5 Shumal Alah.Pemeria 3 2 Motcia 12.31.27.29.5.39 5.2.4.1.7.0 Motcia Pozia.Nikemi.Chapellia.Mesh.Musland.Kojaria 3 -3 Laufarvia 40.6.19.33 3.7.1.4 Laufarvia Faluria.Soria.Hella.Usvol 3 -4 Berkorszag 28.37.26.30.16.25.38 2.0.6.5.4.7.3 Berkorszag Kezonoria.Yuetia.Reigia.Tegrot.Oscasland.Fluria.Wichel 3 +3 Laufarvia 40.6.19.33 3.7.1.4 Laufarvia West Faluria.Soria.Hella.Usvol 3 +4 Berkorszag 28.37.26.30.16.25.38 2.0.6.5.4.7.3 Berkorszag Kezonoria.Yuetia.Reigia.Tegrot.Oscasland.East Faluria.Wichel 3 5 Musland 38.8.2.12.29 7.6.3.4.1 Musland Wichel.Atfordia.Motcia.Pozia.Mesh 3 6 Soria 32.10.11.19.3 7.1.2.3.4 Soria Ingia.Vovimaria.Garholtia.Hella.Laufarvia 2 7 Oryslia 29.36.28.34.38 3.2.7.1.5 Oryslia Mesh.Pemeria.Kezonoria.Turton.Wichel 3 8 Atfordia 5.38.22.16 3.1.7.0 Atfordia Musland.Wichel.Chipingia.Oscasland 3 -9 Bolve 26.25.23 1.0.7 Bolve Reigia.Fluria.Eivikia 3 +9 Bolve 26.25.23 1.0.7 Bolve Reigia.East Faluria.Eivikia 3 10 Vovimaria 41.11.6.32.37 7.3.4.5.1 Vovimaria Parnia.Garholtia.Soria.Ingia.Yuetia 5 -11 Garholtia 37.40.6.10.19 1.3.6.7.5 Garholtia Yuetia.Faluria.Soria.Vovimaria.Hella 4 +11 Garholtia 37.40.6.10.19 1.3.6.7.5 Garholtia Yuetia.West Faluria.Soria.Vovimaria.Hella 4 12 Pozia 5.2.27 0.1.2 Pozia Musland.Motcia.Chapellia 3 13 Al Raala 31.18.29.36 4.1.6.7 AlRaala Nikemi.Alah.Mesh.Pemeria 3 14 Onmaa 31.15 7.6 Onmaa Nikemi.Pieksa 3 15 Pieksa 31.14.39 7.2.5 Pieksa Nikemi.Onmaa.Kojaria 3 16 Oscasland 21.8.38.22.4.30 7.3.2.4.1.0 Oscasland Sigkarl.Atfordia.Wichel.Chipingia.Berkorszag.Tegrot 4 -17 Hofolen 42.40.23.25 6.7.3.1 Hofolen Grytrand.Faluria.Eivikia.Fluria 3 +17 Hofolen 42.40.23.25 6.7.3.1 Hofolen Grytrand.West Faluria.Eivikia.East Faluria 3 18 Alah 13.35.1.36 5.3.0.6 Alah Al Raala.Tumala.Shumal.Pemeria 3 -19 Hella 11.3.40.6.33 1.5.3.7.2 Hella Garholtia.Laufarvia.Faluria.Soria.Usvol 3 +19 Hella 11.3.40.6.33 1.5.3.7.2 Hella Garholtia.Laufarvia.West Faluria.Soria.Usvol 3 20 Elekes 24.34.28 1.3.5 Elekes Tatoros.Turton.Kezonoria 3 21 Sigkarl 16.30.26 3.1.7 Sigkarl Oscasland.Tegrot.Reigia 3 22 Chipingia 16.8 7.3 Chipingia Oscasland.Atfordia 3 -23 Eivikia 17.25.9 7.1.3 Eivikia Hofolen.Fluria.Bolve 2 +23 Eivikia 17.25.9 7.1.3 Eivikia Hofolen.East Faluria.Bolve 2 24 Tatoros 20.34 5.3 Tatoros Elekes.Turton 3 -25 Fluria 9.40.23.26.4.37.17 4.7.5.3.2.1.6 Fluria Bolve.Faluria.Eivikia.Reigia.Berkorszag.Yuetia.Hofolen 5 -26 Reigia 25.21.9.4.30 7.4.5.1.2 Reigia Fluria.Sigkarl.Bolve.Berkorszag.Tegrot 4 +25 East Faluria 9.40.23.26.4.37.17 4.7.5.3.2.1.6 East_Faluria Bolve.West Faluria.Eivikia.Reigia.Berkorszag.Yuetia.Hofolen 5 +26 Reigia 25.21.9.4.30 7.4.5.1.2 Reigia East Faluria.Sigkarl.Bolve.Berkorszag.Tegrot 4 27 Chapellia 2.12.39 7.5.4 Chapellia Motcia.Pozia.Kojaria 4 28 Kezonoria 20.4.7.34.38 1.7.3.2.5 Kezonoria Elekes.Berkorszag.Oryslia.Turton.Wichel 3 29 Mesh 13.2.5.7.36.31.38 2.4.5.7.1.3.6 Mesh Al Raala.Motcia.Musland.Oryslia.Pemeria.Nikemi.Wichel 7 30 Tegrot 16.21.4.26 4.5.1.7 Tegrot Oscasland.Sigkarl.Berkorszag.Reigia 4 31 Nikemi 15.39.13.2.29.14 3.4.1.7.0.2 Nikemi Pieksa.Kojaria.Al Raala.Motcia.Mesh.Onmaa 4 32 Ingia 6.10.41 3.1.7 Ingia Soria.Vovimaria.Parnia 3 -33 Usvol 40.3.19.42 1.3.5.4 Usvol Faluria.Laufarvia.Hella.Grytrand 2 +33 Usvol 40.3.19.42 1.3.5.4 Usvol West Faluria.Laufarvia.Hella.Grytrand 2 34 Turton 36.24.7.28.20 3.0.4.5.7 Turton Pemeria.Tatoros.Oryslia.Kezonoria.Elekes 3 35 Tumala 18 7 Tumala Alah 3 36 Pemeria 7.34.1.18.13.29 6.0.1.2.3.5 Pemeria Oryslia.Turton.Shumal.Alah.Al Raala.Mesh 4 -37 Yuetia 10.25.40.41.11.4.43 7.4.5.0.6.3.1 Yuetia Vovimaria.Fluria.Faluria.Parnia.Garholtia.Berkorszag.Chia 4 +37 Yuetia 10.25.40.41.11.4.43 7.4.5.0.6.3.1 Yuetia Vovimaria.East Faluria.West Faluria.Parnia.Garholtia.Berkorszag.Chia 4 38 Wichel 29.4.7.28.16.5.8 2.7.1.0.6.3.5 Wichel Mesh.Berkorszag.Oryslia.Kezonoria.Oscasland.Musland.Atfordia 6 39 Kojaria 15.31.27.2 2.0.1.3 Kojaria Pieksa.Nikemi.Chapellia.Motcia 4 -40 Faluria 37.25.17.42.3.33.19.11 1.2.3.4.6.5.7.0 Faluria Yuetia.Fluria.Hofolen.Grytrand.Laufarvia.Usvol.Hella.Garholtia 3 +40 West Faluria 37.25.17.42.3.33.19.11 1.2.3.4.6.5.7.0 West_Faluria Yuetia.East Faluria.Hofolen.Grytrand.Laufarvia.Usvol.Hella.Garholtia 3 41 Parnia 32.37.10 4.2.3 Parnia Ingia.Yuetia.Vovimaria 3 -42 Grytrand 40.17.33 1.2.3 Grytrand Faluria.Hofolen.Usvol 2 +42 Grytrand 40.17.33 1.2.3 Grytrand West Faluria.Hofolen.Usvol 2 43 Chia 37 5 Chia Yuetia 3 diff --git a/src/main/resources/net/eagle0/shardok/maps/Fluria.e0mj b/src/main/resources/net/eagle0/shardok/maps/East_Faluria.e0mj similarity index 100% rename from src/main/resources/net/eagle0/shardok/maps/Fluria.e0mj rename to src/main/resources/net/eagle0/shardok/maps/East_Faluria.e0mj diff --git a/src/main/resources/net/eagle0/shardok/maps/Faluria.e0mj b/src/main/resources/net/eagle0/shardok/maps/West_Faluria.e0mj similarity index 100% rename from src/main/resources/net/eagle0/shardok/maps/Faluria.e0mj rename to src/main/resources/net/eagle0/shardok/maps/West_Faluria.e0mj diff --git a/src/main/scala/net/eagle0/eagle/library/actions/llm_prompt_generators/MapDescription.scala b/src/main/scala/net/eagle0/eagle/library/actions/llm_prompt_generators/MapDescription.scala index a9f1c7f174..d1be5dfdca 100644 --- a/src/main/scala/net/eagle0/eagle/library/actions/llm_prompt_generators/MapDescription.scala +++ b/src/main/scala/net/eagle0/eagle/library/actions/llm_prompt_generators/MapDescription.scala @@ -37,9 +37,9 @@ object MapDescription { |Eivikia, southwest of Bolve |Hofolen, west of Eivikia |Grytrand, southwest of Hofolen - |Faluria, northwest of Grytrand and south of Yuetia - |Usvol, with a coast on the south but otherwise surrounded by Faluria - |Laufarvia, southwest of Faluria + |West Faluria, northwest of Grytrand and south of Yuetia + |Usvol, with a coast on the south but otherwise surrounded by West Faluria + |Laufarvia, southwest of West Faluria |Soria, northwest of Laufarvia |Ingia, west of Soria and southeast of Parnia | @@ -48,9 +48,9 @@ object MapDescription { | |IN THE INTERIOR |Vovimaria in the west, bordering Parnia, Yuetia, Garholtia, Soria, and Ingia - |Garholtia, east of Vovimaria and also bordering Yuetia, Faluria, Hella, and Soria - |Hella, south of Garholtia and also bordering Faluria, Laufarvia, and Soria - |Fluria, northeast of Faluria and also bordering Yuetia, Berkorszag, Reigia, Bolve, Eivikia, and Hofolen + |Garholtia, east of Vovimaria and also bordering Yuetia, West Faluria, Hella, and Soria + |Hella, south of Garholtia and also bordering West Faluria, Laufarvia, and Soria + |East Faluria, northeast of West Faluria and also bordering Yuetia, Berkorszag, Reigia, Bolve, Eivikia, and Hofolen |Tegrot, northeast of Reigia and also bordering Berkorszag, Oscasland, and Sigkarl |Wichel, north of Atfordia and also bordering Berkorszag, Kezonoria, Oryslia, Mesh, Musland, and Oscasland |Oryslia, northeast of Wichel and also bordering Kezonoria, Turton, Pemeria and Mesh diff --git a/src/test/scala/net/eagle0/eagle/library/util/validations/RuntimeValidatorTest.scala b/src/test/scala/net/eagle0/eagle/library/util/validations/RuntimeValidatorTest.scala index 378c3c2949..d8bc25b54d 100644 --- a/src/test/scala/net/eagle0/eagle/library/util/validations/RuntimeValidatorTest.scala +++ b/src/test/scala/net/eagle0/eagle/library/util/validations/RuntimeValidatorTest.scala @@ -231,12 +231,12 @@ class RuntimeValidatorTest extends AnyFlatSpec with Matchers { } it should "throw if the price index is negative" in { - val province = ProvinceC(id = 17, priceIndex = -0.4, name = "Fluria") + val province = ProvinceC(id = 17, priceIndex = -0.4, name = "East Faluria") val ex = the[EagleValidationException] thrownBy RuntimeValidator.validate(province, RoundPhase.PlayerCommands) - ex.getMessage shouldBe s"validation failed: Invalid price index -0.4 in province 17 (Fluria)" + ex.getMessage shouldBe s"validation failed: Invalid price index -0.4 in province 17 (East Faluria)" } it should "not throw if the province id is valid and the priceIndex is valid" in {