View previous topic :: View next topic |
Author |
Message |
fleetp
Boatswain
Posts: 3743
36187 Gold -
|
Posted: Wed Sep 23, 2020 11:36 pm Post subject: City xy coordinates |
|
|
After much gut wrenching agony, I managed to open a saved game file using jlangsdo's saved game editor.
Below is some of information the saved game file has on Antigua, followed by just the xy coordinates of the other cities.
City XY coordinates
City_0_0 : V4 : 421 : x coordinate (Antigua)
City_0_1 : V4 : 117 : y coordinate
City_0_2_0 : B1 : 00000111 : ?/0/0/0/0/?/has a port/details visible
City_0_2_1 : B1 : 00000001 : city without port/0/?/news this month/grudge/indian_or_jesuit/0/? (Antigua)
City_0_2_2 : B1 : 00000000 : 0/0/0/0/0/daughter visible/grateful/unfriendly (Antigua)
City_0_2_3 : B1 : 00000000 : city_off/0/0/0/0/?/?/? (Antigua)
City_0_3_0 : C1 : 1 : Flag (English)
City_0_3_1 : C1 : 16 : Population (3200)
City_0_3_2 : C1 : 33 : Soldiers (660)
City_0_3_3 : H1 : 00 :
City_0_4 : H4 : 02000000 :
City_0_5 : V4 : 102 : Wealth (bustling with activity)
City_0_6 : V4 : 1 : Type (English City)
City_0_7 : H4 : 11010000 : ActiveEras: 1660/1680/1640/1620/----/1600/----/----
City_1_0 : V4 : 442 : x coordinate (Barbados)
City_1_1 : V4 : 74 : y coordinate
City_2_0 : V4 : 110 : x coordinate (Campeche)
City_2_1 : V4 : 147 : y coordinate
City_3_0 : V4 : 366 : x coordinate (Caracas)
City_3_1 : V4 : 47 : y coordinate
City_4_0 : V4 : 270 : x coordinate (Cartagena)
City_4_1 : V4 : 38 : y coordinate
City_5_0 : V4 : 333 : x coordinate (Coro)
City_5_1 : V4 : 55 : y coordinate
City_6_0 : V4 : 390 : x coordinate (Cumana)
City_6_1 : V4 : 42 : y coordinate
City_7_0 : V4 : 351 : x coordinate (Curacao)
City_7_1 : V4 : 64 : y coordinate
City_8_0 : V4 : 266 : x coordinate (Eleuthera)
City_8_1 : V4 : 202 : y coordinate
City_9_0 : V4 : 210 : x coordinate (Florida Keys)
City_9_1 : V4 : 199 : y coordinate
City_10_0 : V4 : 322 : x coordinate (Gibraltar)
City_10_1 : V4 : 33 : y coordinate
City_11_0 : V4 : 161 : x coordinate (Gran Granada)
City_11_1 : V4 : 61 : y coordinate
City_12_0 : V4 : 242 : x coordinate (Grand Bahama)
City_12_1 : V4 : 221 : y coordinate
City_13_0 : V4 : 421 : x coordinate (Guadeloupe)
City_13_1 : V4 : 107 : y coordinate
City_14_0 : V4 : 198 : x coordinate (Havana)
City_14_1 : V4 : 184 : y coordinate
City_15_0 : V4 : 302 : x coordinate (Leogane)
City_15_1 : V4 : 133 : y coordinate
City_16_0 : V4 : 314 : x coordinate (Maracaibo)
City_16_1 : V4 : 51 : y coordinate
City_17_0 : V4 : 395 : x coordinate (Margarita)
City_17_1 : V4 : 52 : y coordinate
City_18_0 : V4 : 431 : x coordinate (Martinique)
City_18_1 : V4 : 88 : y coordinate
City_19_0 : V4 : 418 : x coordinate (Montserrat)
City_19_1 : V4 : 113 : y coordinate
City_20_0 : V4 : 413 : x coordinate (Nevis)
City_20_1 : V4 : 117 : y coordinate
City_21_0 : V4 : 255 : x coordinate (Nassau)
City_21_1 : V4 : 204 : y coordinate
City_22_0 : V4 : 235 : x coordinate (Nombre de Dios)
City_22_1 : V4 : 35 : y coordinate
City_23_0 : V4 : 230 : x coordinate (Panama)
City_23_1 : V4 : 29 : y coordinate
City_24_0 : V4 : 300 : x coordinate (Petit-Goave)
City_24_1 : V4 : 130 : y coordinate
City_25_0 : V4 : 308 : x coordinate (Port-de-Paix)
City_25_1 : V4 : 147 : y coordinate
City_26_0 : V4 : 259 : x coordinate (Port Royale)
City_26_1 : V4 : 127 : y coordinate
City_27_0 : V4 : 229 : x coordinate (Puerto Bello)
City_27_1 : V4 : 36 : y coordinate
City_28_0 : V4 : 354 : x coordinate (Puerto Cabello)
City_28_1 : V4 : 46 : y coordinate
City_29_0 : V4 : 249 : x coordinate (Puerto Principe)
City_29_1 : V4 : 163 : y coordinate
City_30_0 : V4 : 300 : x coordinate (Rio de la Hacha)
City_30_1 : V4 : 55 : y coordinate
City_31_0 : V4 : 376 : x coordinate (San Juan)
City_31_1 : V4 : 132 : y coordinate
City_32_0 : V4 : 214 : x coordinate (Santa Catalina)
City_32_1 : V4 : 72 : y coordinate
City_33_0 : V4 : 335 : x coordinate (Santo Domingo)
City_33_1 : V4 : 133 : y coordinate
City_34_0 : V4 : 270 : x coordinate (Santiago)
City_34_1 : V4 : 147 : y coordinate
City_35_0 : V4 : 288 : x coordinate (Santa Marta)
City_35_1 : V4 : 52 : y coordinate
City_36_0 : V4 : 216 : x coordinate (St. Augustine)
City_36_1 : V4 : 247 : y coordinate
City_37_0 : V4 : 412 : x coordinate (St. Eustatius)
City_37_1 : V4 : 125 : y coordinate
City_38_0 : V4 : 410 : x coordinate (St. Kitts)
City_38_1 : V4 : 121 : y coordinate
City_39_0 : V4 : 406 : x coordinate (St. Martin)
City_39_1 : V4 : 129 : y coordinate
City_40_0 : V4 : 303 : x coordinate (Tortuga)
City_40_1 : V4 : 150 : y coordinate
City_41_0 : V4 : 432 : x coordinate (Trinidad)
City_41_1 : V4 : 45 : y coordinate
City_42_0 : V4 : 43 : x coordinate (Vera Cruz)
City_42_1 : V4 : 151 : y coordinate
City_43_0 : V4 : 88 : x coordinate (Villa Hermosa)
City_43_1 : V4 : 133 : y coordinate
City_44_0 : V4 : 140 : x coordinate (Florida Chan.)
City_44_1 : V4 : 40 : y coordinate
City_45_0 : V4 : 256 : x coordinate (Europe)
City_45_1 : V4 : 256 : y coordinate
City_46_0 : V4 : 444 : x coordinate (Europe)
City_46_1 : V4 : 50 : y coordinate
There's also similar information about where the game placed small towns, pirate havens, indian villages and the missions.
City_47_0 : V4 : 346 : x coordinate (Madrid Nuevo)
City_47_1 : V4 : 136 : y coordinate
City_47_2_0 : B1 : 00000010 : ?/0/0/0/0/?/has a port/details visible
City_47_2_1 : B1 : 00000000 : city without port/0/?/news this month/grudge/indian_or_jesuit/0/? (Madrid Nuevo)
City_47_2_2 : B1 : 00000000 : 0/0/0/0/0/daughter visible/grateful/unfriendly (Madrid Nuevo)
City_47_2_3 : B1 : 00000000 : city_off/0/0/0/0/?/?/? (Madrid Nuevo)
City_47_3_0 : C1 : 0 : Flag (Spanish)
City_47_3_1 : C1 : 5 : Population (1000)
City_47_3_2 : C1 : 12 : Soldiers (240)
City_47_3_3 : H1 : 00 :
City_47_4 : H4 : 01000000 :
City_47_5 : V4 : 193 : Wealth (brimming with wealth)
City_47_6 : V4 : 7 : Type (Settlement)
City_47_7 : H4 : 00000000 : ActiveEras: 1660/1680/1640/1620/----/1600/----/----
My first inclination on using this is to tweak the location of Paramaribo in a 'full city' mod I've been working on.
|
|
Back to top |
|
|
themodelcitizen
Gunner
Posts: 865
14671 Gold -
|
Posted: Wed Sep 23, 2020 11:51 pm Post subject: |
|
|
I think you can "upgrade" settlements such that they have a governor (?) but they don't serve as "full" cities in that manner. That's great info, those coordinates represent plot points, the hard part is converting that to the 4-byte hex code the game uses |
|
Back to top |
|
|
Pirate
Helmsman
Posts: 5589
109759 Gold -
|
Posted: Thu Sep 24, 2020 1:52 am Post subject: |
|
|
Sorry I’ve been busy on my mod to pay a lot of attention to what’s going on here but I seem to understand that you can’t land on the islands with the new settlements . Usually you don’t need to form a land party here unless it’s a buried treasure island so that could be part of it also there is a terrain file location file something like that it puts the land on the map but as to landing there I don’t know I if that’s all that’s needed or not. Location of settlements should be swappable with cities and I mean just that swap not add take away a settlement and add a city just swap locations. Really everything is possible to move around you could arrange the Caribbean into another map or a fictional landscape Even the sea an be turned into outer space and the settlements could be docking points but that’s doesn’t sound fun to tackle to me. |
|
Back to top |
|
|
fleetp
Boatswain
Posts: 3743
36187 Gold -
|
Posted: Thu Sep 24, 2020 3:06 am Post subject: |
|
|
I was unable to tweak the city location using this technique, so I fell back on using the codes from cityloc.dta (x axis code for Trinidad and the Y axis code for Nombre de Dios) to tweak the location of my St. Eustatius/Pramaribo (technique described by themodelcitizen).
Just for a lark, I started a new game (no custom mods). The game spawned settlements on the mainland and on some islands. I was able to land my ship near the settlements and walk into them (both on islands and on the mainland), just like I can for most cities (except Barbados on an unmodded game). I might try moving a Dutch settlement from where it is spawned to a vacant island near Curacao.
As has been previously stated, with the PHtrainer you can change all settlements to towns. Those converted towns can do everything an original town can do, but you can't attack an converted town. I've never messed with that particular PHTrainer feature (convert settlements to towns). I like having the indian villages, pirate havens, and Jesuit Missions in the game.
You MIGHT be able to make a city from Florida Chan. (city 44). The save game editor says it's not visible. |
|
Back to top |
|
|
themodelcitizen
Gunner
Posts: 865
14671 Gold -
|
Posted: Thu Sep 24, 2020 3:28 am Post subject: |
|
|
I didn't think Florida Channel or Europe1/2 can be manifested in actual locations but give it a shot.
The landscape file allows you to shift around certain landmasses like Bermuda and Barbados, and it seems that as long as the changes aren't too drastic, you can still land on them (the Barbados/Bermuda shifts involve changing, like, 2 lines in that file) |
|
Back to top |
|
|
fleetp
Boatswain
Posts: 3743
36187 Gold -
|
Posted: Thu Sep 24, 2020 6:50 pm Post subject: |
|
|
In the savegame file I unpacked, the X-Y coordinates place Florida Channel in the Pacific Ocean on a line north-south line just west of Campeche and an east-west line near Nombre De Dios (would be where it 'should' appear).
I messed around for a few minutes with the saved game editor, but couldn't get it to appear. This is probably due to there being no codes for it in the exe file.
Cracking the location code:
In my as yet unpublished shift St. Eustatius to Paramaribo mod,
my modified cityloc.dta file places the city at
FD 97 06 00 3B 88 00 00.
slserpent or possibly jlangsdo mentioned that the xy coordinates are little endian. I looked that up and it said Little-endian is an order in which the "little end" (least significant value in the sequence) is stored first.
I used a 'hexidecimal to base 10' converter on the reversed first four bytes 00 06 97 FD. The decimal value result was 432,125
Doing the same thing with the reversed second four bytes (00 00 88 3B)
gave me a decimal value 34,875.
When I used the saved game editor to check the X,Y coordinates of my new Paramaribo, it showed 432 for X and 35 for the Y coordinate.
|
|
Back to top |
|
|
fleetp
Boatswain
Posts: 3743
36187 Gold -
|
Posted: Thu Sep 24, 2020 9:53 pm Post subject: |
|
|
In another thread, jlando posted this on changing settlements by modding a savegame file:
Quote: | Actually, it can look like a city when sailing/marching, I was wrong.
Turns out it is very simple to make the Mayor into a Governor; just change the Type (City_.*_6) of any settlement from 7 down to 0,1,2, or 3, and it becomes a semi-city. |
|
|
Back to top |
|
|
themodelcitizen
Gunner
Posts: 865
14671 Gold -
|
Posted: Thu Sep 24, 2020 10:22 pm Post subject: |
|
|
Oh great, thanks, you can slap a grid on the map on photoshop with view/new guide layout:
https://i.imgur.com/ACCll16.jpg
In the "info" box, the "picas" option shows you the coordinate your cursor is in. For Y, you might have to subtract that number from 293, I think it counts upwards.
This should allow us to place cities, well, anywhere on the playable area. Well done matey |
|
Back to top |
|
|
themodelcitizen
Gunner
Posts: 865
14671 Gold -
|
Posted: Thu Sep 24, 2020 10:35 pm Post subject: |
|
|
as an aside, I tried putting some cities on the west coast of Mexico last night and teleporting there using Phalzyr's trainer. It was funny, they would try sending ships out to trade with each other but they disappeared as if they were stuck inland. Even though you can sail in the Pacific (with the trainer) because the water's there, the game seems to think of it as "land" in AI ship terms |
|
Back to top |
|
|
fleetp
Boatswain
Posts: 3743
36187 Gold -
|
Posted: Thu Sep 24, 2020 10:53 pm Post subject: |
|
|
EDIT: I rebooted the computer and the savedgame editor now works.
When I used it to try to change my playable character's location, the 'new' location showed correctly on the 'distant' map, but on the actual playing screen he had not moved.
On a positive note I used the change type from 7 to 3 to convert a Dutch settlement to a 'semi-city'. |
|
Back to top |
|
|
fleetp
Boatswain
Posts: 3743
36187 Gold -
|
Posted: Fri Sep 25, 2020 12:02 am Post subject: |
|
|
I tried to move my Dutch semi-city from west of Villa Hermosa to Louisiana by changing the xy coordinates in a savegame file. While the semi-city disappeared from west of Villa Hermosa, it did NOT appear in Louisiana.
Time to take a break. |
|
Back to top |
|
|
themodelcitizen
Gunner
Posts: 865
14671 Gold -
|
Posted: Fri Sep 25, 2020 12:39 am Post subject: |
|
|
Likely a miscalculation - I've misguessed the entries before and the x or y coordinate was likely miles off the map, so didn't show up at all |
|
Back to top |
|
|
fleetp
Boatswain
Posts: 3743
36187 Gold -
|
Posted: Fri Sep 25, 2020 9:44 pm Post subject: |
|
|
There are two sets of X,Y coordinates for each settlements in a savegame file. I only changed the first set. I have an errand to run right now; after that I'll make the changes and run a test. |
|
Back to top |
|
|
themodelcitizen
Gunner
Posts: 865
14671 Gold -
|
Posted: Fri Sep 25, 2020 9:48 pm Post subject: |
|
|
If the second set mirrors what you're seeing after the y coordinates in cityloc, then it's the port direction (four entries) and fort position (four entries, which may not matter for a settlement).
The first three bites are 0 and the fourth is the entry from like a 17-point clock or something, the entry for 1 is its hex equivalent (00), 2 (10), 3 (20), and so on (somewhere up to F0 which corresponds to 16 and is close to north-north-west).
Last edited by themodelcitizen on Mon Oct 18, 2021 7:23 am; edited 1 time in total |
|
Back to top |
|
|
fleetp
Boatswain
Posts: 3743
36187 Gold -
|
Posted: Fri Sep 25, 2020 11:17 pm Post subject: |
|
|
themodelcitizen wrote: | If the second set mirrors what you're seeing after the y coordinates in cityloc, then it's the port direction (four entries) and fort position (four entries, which may not matter for a settlement).
I think instead of clock numbers, it's actually 4 is east, 8 is south, 12 is west. So a southwest orientation (10) would be "00 00 00 a0" (I think?). |
Your talking about the cityloc.dta file.
I'm unsure where the settlement information is in cityloc. It might not be in there because unlike a city, a settlement doesn't have a 'fixed' location in the game. For example when I start a new game, Middelburg might be near Villa Hermosa. When I start a different new game it might be on the same island as Trinidad.
When I unpacked slot6.pirates_savegame using the perl savegame editor
this is the first set of XY coordinates for the settlement of middelburg
City_49_0 : V4 : 107 : x coordinate (Middelburg)
City_49_1 : V4 : 249 : y coordinate
Here's the second set of XY coordinates for the settlement of middelburg
CityLoc_49_0 : g4 : 107 : x coord (Middelburg)
CityLoc_49_1 : g4 : 249 : y coord
I had hoped that by matching the xy coordinates of City_49_0 and CityLoc that the settlement would appear in Louisiana. Unfortunately it did not. There might be additional files that need to be modded when moving settlements.
I might try relocating Puerto Principe to Louisiana using the cityloc.dta and cityname_enu.txt file method. |
|
Back to top |
|
|
|