Page 1 of 7 1234567 LastLast
Results 1 to 20 of 128

Thread: How to add buildings/slots to Cities - COMPLETED

  1. #1
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Icon3 How to add buildings/slots to Cities - COMPLETED

    This tutorial will show you how to add building slots to a city, so that the city will get larger and enable the building of an additional type of building (e.g. admiralty). This will require quite a lot of steps, so be patient and follow step by step.

    NOTE: The following Tutorial is based on changing a City into having 5 buildings in it. To change the city into having any other building number, will require almost the same steps, except the change of coordinates, as the process differs from number to number.

    First you will need the latest Esf Editor

    In this tutorial I will add an admiralty to Athens (I tried this for my mod purposes with Greece ETW Playable & Retexture mod)


    So let's begin:

    1) First backup the following files that we are going to edit:
    · startpos.esf (C:\Program Files\Steam\steamapps\common\empire total war\data\campaigns\main)
    · regions.esf (C:\Program Files\Steam\steamapps\common\empire total war\data\campaign_maps\global_map)

    2) Now open startpos.esf with esf editor. First, we need to clone an existing REGION_SLOT_ARRAY of any settlement building (i.e. located inside the city).

    This will be found under this path:
    CAMPAIGN_STARTPOS\CAMPAIGN_ENV\CAMPAIGN_MODEL\WORLD\REGION_MANAGER\REGIONS_ARRAY\REGIONS_ARRAY\REGION(Greece)\REGION_SLOT_MANAGER\REGION_SLOT_ARRAY right click on an existing settlement building slot and click CLONE.

    3) After cloning, a new higlighted green REGION_SLOT_ARRAY should appear. Now we need to click on the green REGION_SLOT, and change the 1st entry on the right (the Building ID, type Uint), and rewrite a random one, but be sure to keep it a 9-digit number! (the chance of rewriting an existing ID, is extremely small)

    4) Next, we need to change the 2nd entry, to a new one reflecting the building type we want to add.
    In this example it’s "settlement:greece:athens:settlement_navy-admin". Change the bold text respectively.

    ID references of other building types can be found here main.pack/db/building_chains_to_slots_tables\building_chains_to_slots under the data folder that needs the PackFileManager to be opened
    The 5th and 6th entries are the campaign map coordinates, and we will change them accordingly later on, in the process explained further down. Also for the 8th entry it decideds what type of small buildings will surround the city. I would leave it as it is, the same with all the REGION_SLOTs of the specific region. (This number should actually match with the 1st entry when you have SETTLEMENT field highlighted i.e. in my example it should be no. 3).
    We aren’t going to bother with the rest entries of this field.

    5) Now, highlight SIEGABLE_GARISSON_RESIDENCE and change the 1st entry here to be exactly the same with the Building ID of REGION_SLOT you have just randomly edited.
    Then, under the SIEGABLE_GARISSON_RESIDENCE, click on GARISSON_RESIDENCE and change the entry on the right, to the ID of the faction that owns the City. (in this example Greece) You can simply copy the entry from the other existing GARISSON_RESIDENCEs of the other existing REGION_SLOT_ARRAYs in that region.


    6) This will decide if the building slot will have a building already built in it or if it will be an empty slot

    a) For empty slot:

    Simply right click on the BUILDING field (if there is one) under BUILDING_MANAGER and click DELETE (it should turn red).

    After doing this, click on the BUILDING_MANAGER and change the 1st Boolean to “False”.

    b) For built-in slot:

    Click on the BUILDING_MANAGER and be sure the 1st Boolean is set to “True”.

    There should also be a BUILDING field present under BUILDING_MANAGER. (If there isn’t one, then simply right-click copy one from another slot). With BUILDING being highlighted, change the 3rd entry to the owner faction (i.e. in this case from “portugal” to “greece”) and the 4th entry to the owner faction government type (i.e. in this case from “gov_constitutional_monarchy” to “gov_absolute_monarchy”)
    The 2nd entry will determine the building level,so enter the appropriate text (in this example “admiralty”)

    Building IDs of other building levels can be found here main.pack/db/building_levels_tables/building_levels under the data folder that needs the PackFileManager to be opened

    7) Now, we have to add the building slot in the AI entries as well, so that the game won't crash when the building upgrades. We will follow the method of HusserlTW to do this.

    a) Go to startpos.esf\CAMPAIGN_STARTPOS\CAMPAIGN_ENV\CAMPAIGN_MODEL\CAI_INTERFACE\CAI_WORLD\CAI_WORLD_BUILDING_SLOTS and right-click on anyoneof the CAI_WORLD_BUILDING_SLOTS and click CLONE. A new highlighted-green CAI_WORLD_BUILDING_SLOTS field should appear. Click on it.

    b) Change the 1st entry on the right, which is the slot's ID, to a 4-digit random number, but this number shouldnt conflict with any other ID, so to be on the safe-side, change this to lets say "9999". (this was one of my mistakes:whistling)

    c) Then click on the CAI_BUILDING_SLOT field under CAI_WORLD_BUILDING_SLOTS we cloned. From here change the 1st entry on the right, to match exactly with our randomly created REGION_SLOT ID we created in Step 3 above. The 2nd entry should be 0, that probably indicates that the building is inside the city.

    d) The last step, is to change the 3rd entry on the right, to our Settlement's AI ID (i.e. in our example Athens' AI ID is 1681). To find this for other settlements, check out the list I prepared for all Settlements AI IDs, to save you from having to find it yourself...

    Spoiler Alert, click show to read: 

    REGION-SETTLEMENT-AI ID
    moldavia iasi 2142
    persia isfahan 1504
    bulgaria sofia 2018
    algonquin_territory niagara 3400
    naples naples 1780
    komi ust_sysolsk 2614
    malwa ujjain 2902
    don_voisko cherkassk 2054
    french_guyana cayenne 3051
    great_plains knife_river_village 3497
    ukraine kiev 2331
    croatia zagreb 1974
    maryland annapolis 3382
    leeward_islands antigua 3173
    carnatica arcot 2730
    karelia petrovskaya_sloboda 2700
    ingria st_petersburg 2657
    wurttemberg stuttgart 2103
    curacao punda 3122
    savoy turin 1928
    galicia lwow 2295
    new_andalusia caracas 3078
    flanders brussels 2243
    lithuania vilnius 2463
    iroquois_territory cayuga 3461
    norway christiania 2620
    cherokee_territory tellico 3287
    greece athens 1681
    belarus minsk 2312
    portugal lisbon 1752
    upper_louisiana fort_chartres 3327
    rhineland koln 2227
    sindh neroon_kot 2937
    azerbaijan ardabil 1732
    tripoli tripoli 1480
    arkhangelsk arkhangelsk 2671
    trinidad_tobago san_jose_de_oruna 3588
    cuba la_habana 3209
    windward_islands martinique 3132
    morocco tangier 1462
    sweden stockholm 2568
    courland jelgava 2600
    bavaria munich 2091
    guatemala antigua_guatemala 3106
    michigan_territory detroit 3388
    austria vienna 1954
    prussia konigsberg 2448
    ireland dublin 2345
    morea patras 1666
    bosnia sarajevo 1990
    rumelia constantinople 1847
    finland aabo 2683
    england london 2184
    mysore mysore 2773
    maine falmouth 3473
    virginia williamsburg 3336
    gibraltar gibraltar 2724
    iceland reykjavik 2714
    labrador agvituk 3568
    new_mexico santa_fe 3263
    silesia breslau 2285
    jamaica port_royal 3181
    serbia belgrade 2005
    new_grenada bogota 3028
    bohemia prague 2258
    bengal calcutta 2917
    anatolia angora 1702
    kashmir srinagar 3018
    newfoundland plaissance 3540
    spain madrid 1628
    bijapur satara 2805
    hungary pressburg 2113
    bashkira ufa 2514
    hyderabad hyderabad 2823
    ceylon trincomalee 2756
    tunis tunis 1541
    afghanistan kabul 1576
    mesopotamia baghdad 1558
    netherlands amsterdam 2373
    france paris 1889
    chechenya-dagestan tarki 1877
    syria damascus 1608
    the_papal_states rome 1825
    berar nagpur 2871
    acadia fort_nashwaak 3483
    new_england boston 3429
    hispaniola santo_domingo 3189
    hannover hannover 2359
    saxony dresden 2273
    milan milano 2066
    new_spain mexico 3143
    venice venice 2076
    estonia_and_livonia riga 2641
    genoa genoa 1940
    armenia yerevan 1802
    denmark copenhagen 2544
    hindustan agra 2971
    gujarat ahmedabad 2888
    carolinas charleston 3311
    georgia_usa savannah 3303
    kaintuck_territory tanase 3340
    astrakhan astrakhan 2172
    ahmadnagar ahmadnagar 2859
    huron_territory fort_sault_ste-marie 3507
    dutch_guyana paramaribo 3061
    tatariya kazan 2152
    corsica bastia 1814
    malta valletta 1660
    malabar goa 2793
    bahamas nassau 3243
    new_york albany 3412
    lower_louisiana new_orleans 3271
    georgia tbilisi 1865
    palestine jerusalem 1493
    rajpootana udaipur 2951
    poland warsaw 2428
    west_pommerania berlin 2390
    alsace strasbourg 2218
    orissa cuttack 2839
    punjab lahore 2998
    algiers algiers 1591
    baluchistan zahedan 1528
    sardinia caligari 1770
    egypt cairo 1439
    transylvania kolozsvar 2130
    ontario montreal 3447
    pennsylvania philadelphia 3352
    northwest_territories york_factory 3580
    panama panama 3094
    ruperts_land moose_factory 3554
    new_france quebec 3522
    crimea bakhchisaray 2036
    florida st_augustine 3227
    muscovy moscow 2484
    west_prussia gdansk 2410
    scotland edinburgh 2529
    tejas villa_de_bexar 3251


    After this, we are finished editing the startpos.esf, so now SAVE the file and open regions.esf with esf editor

    8) Go to global_map\regions.esf\root\region_data\regions\ and find the region that you will add a building/slot to. (in my example greece). Under regions, go to settlement_and_slots/slot_descriptions and right-click on an existing field and click CLONE.

    9) Click on the cloned green slot_descriptions, and change the 1st and 2nd entries on the right, to reflect your new building accordingly, like previously done in the startpos.esf. (i.e. in my example I will change the 1st entry to "settlement:greece:athens:settlement_navy-admin" and the 2nd entry to "settlement_navy-admin")
    The 3rd and 4th entries are probably the battle map coordinates, and we will change them accordingly later on, in the process explained further down.

    After this, SAVE changes



    To Place Building Slots correctly so that the buildings fit properly in the newly enlarged city (both campaign and battle map), use this excellent spreadsheet made by erasmus777 and follow the steps described in the spreadsheet and the additional steps below.


    a) When editing startpos.esf, go to your REGION_SLOT_ARRAY and click on your first slot. The 5th and 6th entries are X and Y coordinates respectively. Check the building type and enter the appropriate value. Do this for all the settlement slots.

    Save. Your buildings will now appear in the correct position on the campaign map!

    b) When editing regions.esf, go to slot_descriptions, under settlement_and_slots, and click on your first slot. The 3rd and 4th entries are both the coordinates X and Y separated by a ;. Check the building type and enter the appropriate value. Do this for all the settlement slots.

    Save. Your buildings will now also appear in the correct position on the battle map!

    For a full-detailed explanation of this method, check out the spoiler below
    Spoiler Alert, click show to read: 

    1) Open startpos.esf with esf editor

    2) Go to CAMPAIGN_STARTPOS\CAMPAIGN_ENV\CAMPAIGN_MODEL\WORLD\REGION_MANAGER\REGIONS_ARRAY\REGIONS_ARRAY\[Your Region] and click on SETTLEMENT\SIEGEABLE_GARRISON_RESIDENCE

    3) You'll see Int values in 10th and 11th entries; these are X (10th entry),Y (11th entry) coordinates. Write them down. All our calculations will be relative to these numbers.

    4) Convert them into map coordinates, that are more understandable, by dividing each number by 1,000,000 (this is American notation: in other words, assign 6 decimal places, starting from the right and counting left).
    e.g. 17328740/1,000,000 = 17.328740

    [Note: you can achieve the same results by leaving the Garrison coordinates unchanged and instead multiplying the offset numbers I provide by 1,000,000. If all this math makes your head hurt, ignore this note and follow the tutorial or, better yet, download the spreadsheet]

    5) We're going to offset the Garrison coordinates for each building type. This will tell us where to place the buildings. For each building, simply add the respective values below to the Garrison coordinates. Here are the offsets:

    Building X; Y
    Army -0.798581; +0.792384
    Government +0.003188; -0.009376
    Culture +0.815036; -0.821216
    Navy -0.808820; -0.821376
    Ordinance +0.819688; +0.807104
    Road +0.040256; -1.39504
    Fortification +0.040256; +1.390304

    6) After you have gotten the coordinates for all your buildings, convert them back in game format by multiplying by 1,000,000

    Example:
    Spoiler Alert, click show to read: 

    Denmark's Garrison coordinates are 88411680; 413792544:
    A) I divide each coordinate by 1,000,000
    = 88.411680; 413.792544

    B) For the Army-admin slot, I add the offsets:
    88.411680 + (-0.798581) = 87.813099
    413.792544 + 0.792384 = 414.584928

    C) Then I convert the coordinates into game format by multiplying by 1,000,000 (or just moving the decimal 6 places to the right):
    87.813099 x 1,000,000 = 87813099
    414.584928 x 1,000,000 = 414484928


    7) Go to your REGION_SLOT_ARRAY and click on your first slot. The 5th and 6th entries are X and Y coordinates respectively. Check the building type and enter the appropriate value. Do this for all the city slots.

    Save. Your buildings will now appear in the correct position on the campaign map!

    Now we need to edit the coordinates of the building slots in regions.esf, in similar fashion with the previous process. (the coordinates of regions.esf, probably affect the battle map positioning)

    1) Open regions.esf with esf editor

    2) Go to regions.esf\root\region_data\regions\regions[your region]
    and click on settlement_and_slots and there are the X and Y coordinates in the first line separated by a ' ; ', that we are going to use to calculate the other building coordinates (like done above in startpos.esf)

    3) The offsets for regions.esf are:

    Building X; Y
    Army -0.7616; +0.7557
    Government +0.003; -0.0089
    Culture +0.7773; -0.7831
    Navy -0.7714; -0.7833
    Ordnance +0.7817; +0.7698
    Road +0.0384; -1.3304
    Fortification +0.0384; +1.3259

    4) Go to slot_descriptions, under settlement_and_slots, and click on your first slot. The 3th and 4th entries are both the coordinates X and Y separated by a ;. Check the building type and enter the appropriate value. Do this for all the city slots.

    Save. Your buildings will now also appear in the correct position on the battle map!


    NOW YOU HAVE SUCCESSFULY COMPLETED THIS TUTORIAL. see the result below
    Spoiler Alert, click show to read: 

    I hope this was useful and easy to follow, even though it was a quite long process. I would like to thank erasmus777 and husserlTW for their help to complete this tutorial and their teamwork, that I really like in TWC community!
    Last edited by demis14; June 12, 2009 at 06:37 AM. Reason: update

  2. #2

    Default Re: How to add building slots to Cities

    Wonderful! This is awesome.

    Do you think adding a building with the Line of Sight boolean value of "True" to a minor nation would fix the Fog of War bug?

  3. #3
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: How to add building slots to Cities

    it might do the trick, but I never had a problem of fog of war when unlocking Greece... but of course Greece is an emergent but Denmark just a minor faction....
    I'm willing to have a look at your startpos.esf and maybe I can find the problem if you want!

    EDIT: Did you try to add a building slot to a city? I really want to know if it worked for you as well!

  4. #4

    Default Re: Breakthrough: How to add buildings/slots to Cities

    This is a brilliant tutoiral +rep.

    However, I am trying to make native American cities from minor into major cities, with more than one building slot. As the native American building chains are different, would you know how to change it into a major city (all the minor cities have settlement:blank:blank:settlement_minor)? I have tried this a few times now, and it crashes each time .

  5. #5
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Breakthrough: How to add buildings/slots to Cities

    The float point is probably the building coordinates so don't change it to something random (the slots are actually rendered in the main city if you look closely)

    No thing is everything. Every thing is nothing.

  6. #6
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: Breakthrough: How to add buildings/slots to Cities

    Quote Originally Posted by alpaca View Post
    The float point is probably the building coordinates so don't change it to something random (the slots are actually rendered in the main city if you look closely)
    You are right, actually if you click on regions field, you can see two FloatPoint entries, that i believe are the Low and High boundaries for coordinates that you can set...

    As i had recomended in the tutorial, to leave the first 3 digits the same (that in fact are those that matter) , it would have worked ... But i will change it anyway to clarify!

  7. #7
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: Breakthrough: How to add buildings/slots to Cities

    Quote Originally Posted by Irmo View Post
    This is a brilliant tutoiral +rep.

    However, I am trying to make native American cities from minor into major cities, with more than one building slot. As the native American building chains are different, would you know how to change it into a major city (all the minor cities have settlement:blank:blank:settlement_minor)? I have tried this a few times now, and it crashes each time .
    EDIT: see the above posts that might be the problem..

  8. #8

    Default Re: Breakthrough: How to add buildings/slots to Cities

    Woo! I got it working. My problem wasn't the float points, but in:

    main\startpos.esf\CAMPAIGN_STARTPOS\CAMPAIGN_ENV\CAMPAIGN_MODEL\WORLD\REGION_MANAGER\REGIONS_ARRAY\REGIONS_ARRAY\REGION\REGION_SLOT_MANAGER\REGION_SLOT_ARRAY\REGION_SLOT_ARRAY\REGION_SLOT (for your region and slot)

    If you want to change the level of the building (which I did), you have to change the 8th row to the level of the building according to the building_levels_tables\building_levels in the main.pack. Also, annoyingly, the first level building is 0, not 1, which is where my problem was. It is also 0 for no building. Also, quite a helpful file in the db building_chains_to_slots_tables\building_chains_to_slots, showing what you have to put after settlement:blank:blank: for your building chain.

    You may want to add this in, because I'm sure I'm not the only one who wants to change building levels.

    Once again, thank you very much for this tutorial, and here is the result:

    Spoiler Alert, click show to read: 

  9. #9
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: Breakthrough: How to add buildings/slots to Cities

    Quote Originally Posted by Irmo
    Woo! I got it working. My problem wasn't the float points, but in:

    main\startpos.esf\CAMPAIGN_STARTPOS\CAMPAIGN_ENV\CAMPAIGN_MODEL\WORLD\REGION_MANAGER\REGIONS_ARRAY\REGIONS_ARRAY\REGION\REGION_SLOT_MANAGER\REGION_SLOT_ARRAY\REGION_SLOT_ARRAY\REGION_SLOT (for your region and slot)

    If you want to change the level of the building (which I did), you have to change the 8th row to the level of the building according to the building_levels_tables\building_levels in the main.pack. Also, annoyingly, the first level building is 0, not 1, which is where my problem was. It is also 0 for no building. Also, quite a helpful file in the db building_chains_to_slots_tables\building_chains_to_slots, showing what you have to put after settlement:blank:blank: for your building chain.

    You may want to add this in, because I'm sure I'm not the only one who wants to change building levels.

    Once again, thank you very much for this tutorial, and here is the result:
    thank you very much for the feedback m8, and I will add that useful info as soon as i find some spare time! Im glad it worked for you as well!

  10. #10
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: How to add buildings/slots to Cities

    i have found how to edit the coordinates so that the buildings will fit properly in the newly enlarged city, and i will add this on the tutorial soon, as it's a long process

  11. #11

    Default Re: How to add buildings/slots to Cities

    Attachment 42598
    Quote Originally Posted by demis14 View Post
    i have found how to edit the coordinates so that the buildings will fit properly in the newly enlarged city, and i will add this on the tutorial soon, as it's a long process
    Some other people and I are getting CTDs when upgrading the new admiralty. Have you found anyway around this?

    I thought maybe it was the misplacement of the slots, so I went ahead and figured out how to place them properly. They look fine, but I'm still getting CTDs. I'm curious to hear how you did it to see if I missed something. Here's my method:


    How to Place City Slots:

    1) Go to CAMPAIGN_STARTPOS\CAMPAIGN_ENV\CAMPAIGN_MODEL\WORLD\REGION_MANAGER\REGIONS_ARRAY\REGIONS_ARRAY\[Your Region] and click on SETTLEMENT\SIEGEABLE_GARRISON_RESIDENCE

    2) You'll see Int values in lines 10 and 11; these are X (line 10),Y (line 11) coordinates. Write them down. All our calculations will be relative to these numbers.

    3) Convert them into map coordinates by dividing each number by 1,000,000 (this is American notation: in other words, assign 6 decimal places, starting from the right and counting left). For example, 17328740/1,000,000 = 17.328740

    [Note: you can achieve the same results by leaving the Garrison coordinates unchanged and instead multiplying the offset numbers I provide by 1,000,000. If all this math makes your head hurt, ignore this note and follow the tutorial or, better yet, download the spreadsheet ]

    4) We're going to offset the Garrison coordinates for each building type. This will tell us where to place the buildings. For each building, simply add the respective values below to the Garrison coordinates. Here are the offsets:

    Building X; Y
    Army -0.798581; 0.792384
    Government
    0.003188; -0.009376
    Culture
    0.815036; -0.821216
    Navy
    -0.808820; -0.821376
    Ordinance
    0.819688; 0.807104


    5) After you have gotten the coordinates for all your buildings, convert them back in game format by multiplying by 1,000,000

    Example:
    Spoiler Alert, click show to read: 

    Denmark's Garrison coordinates are 88411680; 413792544:
    A) I divide each coordinate by 1,000,000
    = 88.411680; 413.792544

    B) For the Army-admin slot, I add the offsets:
    88.411680 + (-0.798581) = 87.813099
    413.792544 + 0.792384 = 414.584928

    C) Then I convert the coordinates into game format by multiplying by 1,000,000 (or just moving the decimal 6 places to the right):
    87.813099 x 1,000,000 = 87813099
    414.584928 x 1,000,000 = 414484928


    6) Go to your REGION_SLOT_ARRAY and click on your first slot. Lines 5 and 6 are X and Y coordinates. Note the building type and enter the appropriate value. Do this for all the city slots.

    Save. You buildings will now appear in the correct position in game.

    I've attached a spreadsheet that does all the math for you. All you need to do is enter the values from SIEGEABLE_GARRISON_RESIDENCE. It's password protected against careless changes, but I've written the password on the document so you have full control. Edit: Spreadsheet removed for updating.
    Last edited by erasmus777; May 21, 2009 at 12:23 PM.

  12. #12
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: How to add buildings/slots to Cities

    well you did it in a similar way with me, but the only differences on how i did it are:
    1. Also follow these steps for ROAD_SLOT and FORTIFICATIONS_SLOT. I followed the following offsets:
    ROAD +0.040256 -1.39504
    FORTIFICATION +0.040256 +1.390304

    2. I did not divide the number by 1,000,000, as its not that necessary
    3. The offset values for each building, differ slightly from building to building, so mine that I used are only maybe an integer down or up... (I believe it doesnt matter)
    4. I followed a similar method, to edit this time the regions.esf, as it has coordinates as well. Go to: \regions.esf\root\region_data\regions\regions\settlement_and_slots and there are the X and Y coordinates in the first line seperated by a ' ; ', that we are going to use to calculate the other building coordinates (like done in the above post in startpos.esf)

    To change the coordinates with the new offsets we locate the building slots under this path global_map\regions.esf\root\region_data\regions\regions\settlement_and_slots\slot_descriptions and change the 3rd and 4th lines, that are identical and both contain the X and Y coordinates seperated by a ' ; '

    The offsets for regions.esf are:

    army -0.7616 +0.7557
    govern +0.003 -0.0089
    culture +0.7773 -0.7831
    navy -0.7714 -0.7833
    ordnance +0.7817 +0.7698
    road +0.0384 -1.3304
    fortification +0.0384 +1.3259

    The above steps for regions.esf, I believe are the coordinates of the buildings in battle map.... not sure though, just guessing. Also as husserlTW pointed out to me through a PM, that the 8th entry in the REGION_SLOT_ARRAY of startpos.esf, doesnt seem to be the number of building level, but a number that matches with the rest REGION_SLOT_ARRAYS and it doesnt seem to have any definite pattern, as cities with 5 buildings, all range from 3 to 5, so propably, here there might be something, but for the moment not known.

    Also, when I messed about the CAI entries in startpos, i found that each building slot in game, has an AI entry tied to it, so for any new building, a new AI entry might be needed. I tried to add one new with the relevant AI IDs, but the crashed wasnt fixed...

    I will keep trying here and there, and Im glad that it seems other people like you are trying , because this means a solution might be found earlier!

    Keep up the gd work man and anything new you find, post it here pls or even PM me for any ideas!

    EDIT: also, you might want to add the steps that I noted, in the excellent spreadsheet you prepared. I even ask if i could use it in my tutorial (of course i will credit you for that one)

  13. #13
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: How to add buildings/slots to Cities

    I will also update the tutorial soon, now that I have two posts actually explaining the steps!

  14. #14

    Default Re: How to add buildings/slots to Cities

    Quote Originally Posted by demis14 View Post
    well i did it in a similar way with me, but the only differences on how i did it are:
    1. Also follow these steps for ROAD_SLOT and FORTIFICATIONS_SLOT. I followed the following offsets:
    ROAD +0.040256 -1.39504
    FORTIFICATION +0.040256 +1.390304

    2. I did not divide the number by 1,000,000, as its not that necessary
    3. The offset values for each building, differ slightly from building to building, so mine that I used are only maybe an integer down or up... (I believe it doesnt matter)
    4. I followed a similar method, to edit this time the regions.esf, as it has coordinates as well. Go to: \regions.esf\root\region_data\regions\regions\settlement_and_slots and there are the X and Y coordinates in the first line seperated by a ' ; ', that we are going to use to calculate the other building coordinates (like done in the above post in startpos.esf)

    To change the coordinates with the new offsets we locate the building slots under this path global_map\regions.esf\root\region_data\regions\regions\settlement_and_slots\slot_descriptions and change the 3rd and 4th lines, that are identical and both contain the X and Y coordinates seperated by a ' ; '

    The offsets for regions.esf are:

    army -0.7616 +0.7557
    govern +0.003 -0.0089
    culture +0.7773 -0.7831
    navy -0.7714 -0.7833
    ordnance +0.7817 +0.7698
    road +0.0384 -1.3304
    fortification +0.0384 +1.3259

    The above steps for regions.esf, I believe are the coordinates of the buildings in battle map.... not sure though, just guessing. Also as husserlTW pointed out to me through a PM, that the 8th entry in the REGION_SLOT_ARRAY of startpos.esf, doesnt seem to be the number of building level, but a number that matches with the rest REGION_SLOT_ARRAYS and it doesnt seem to have any definite pattern, as cities with 5 buildings, all range from 3 to 5, so propably, here there might be something, but for the moment not known.

    Also, when I messed about the CAI entries in startpos, i found that each building slot in game, has an AI entry tied to it, so for any new building, a new AI entry might be needed. I tried to add one new with the relevant AI IDs, but the crashed wasnt fixed...

    I will keep trying here and there, and Im glad that it seems other people like you are trying , because this means a solution might be found earlier!

    Keep up the gd work man and anything new you find, post it here pls or even PM me for any ideas!

    EDIT: also, you might want to add the steps that I noted, in the excellent spreadsheet you prepared. I even ask if i could use it in my tutorial (of course i will credit you for that one)
    Question: Do you have any idea why the building slot coordinates in regions.esf are different from those in startpos? I haven't done all the calculations yet, but it looks like the regions.esf/startpos differences follow regular offsets as well. Edit: I just reread your battle map comment.

    The I reason I include dividing and multiplying by 1,000,000 is that it is the easiest way to explain editing coordinates regardless of the integer's length. For example, London's X coordinate is very small; it shows in startpos as something like 34567. Moving the decimal before offsetting avoids any confusion, especially for the mathematically challenged. [I've tutored basic math skills before, so perhaps I'm overly sensitive to people who are otherwise brilliant, but fall to pieces when making simple calculations.]

    Apparently great minds think alike, because I also started going through the AI entries, but haven't had much time so far.

    The first version of the spreadsheet I made was for regions.esf and has the exact offsets you posted When that failed to fix the problem, I made the other one. I'll integrate them and add the additional calculations for roads and fortifications. And of course you can use the spreadsheet in the OP or wherever else you like Feel free to make any changes.

    Thanks for all the help! I hope we can figure this out. I think this is important work not only because we're learning more about the .esf files, but also because it's becoming apparent that there are many changes that can be made to the map without need of a model converter. Perhaps it will be possible soon to make a rudimentary map editor.
    Last edited by erasmus777; May 21, 2009 at 10:17 AM.

  15. #15
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: How to add buildings/slots to Cities

    Quote Originally Posted by erasmus777 View Post
    Question: Do you have any idea why the building slot coordinates in regions.esf are different from those in startpos? I haven't done all the calculations yet, but it looks like the regions.esf/startpos differences follow regular offsets as well. Edit: I just reread your battle map comment.

    The I reason I include dividing and multiplying by 1,000,000 is that it is the easiest way to explain editing coordinates regardless of the integer's length. For example, London's X coordinate is very small; it shows in startpos as something like 34567. Moving the decimal before offsetting avoids any confusion, especially for the mathematically challenged. [I've tutored basic math skills before, so perhaps I'm overly sensitive to people who are otherwise brilliant, but fall to pieces when making simple calculations.]

    Apparently great minds think alike, because I also started going through the AI entries, but haven't had much time so far.

    The first version of the spreadsheet I made was for regions.esf and has the exact offsets you posted When that failed to fix the problem, I made the other one. I'll integrate them and add the additional calculations for roads and fortifications. And of course you can use the spreadsheet in the OP or wherever else you like Feel free to make any changes.

    Thanks for all the help! I hope we can figure this out. I think this is important work not only because we're learning more about the .esf files, but also because it's becoming apparent that there are many changes that can be made to the map without need of a model converter. Perhaps it will be possible soon to make a rudimentary map editor.
    great, so we have a mathematician in our ranks! As for the AI entries, I was sure you would had thought about it, as it seems you got the idea of startpos Watch out for a PM from me, explaining what i have already figured out about the AI, as I like the team spirit (and i certainly need it) Thnx for letting me use the spreadsheet and im expecting your upload so that I can add it to the tutorial...

    yeah, i believe when I complete the tutorial (i.e. fix the crash as well), we could link this page to the World Map Community Project, because it might be useful for their work, that of course interests me. (if they havent already figured this out)

  16. #16
    Burnoutfigs's Avatar Semisalis
    Join Date
    Apr 2009
    Location
    Fort Lewis, Wa
    Posts
    408

    Default Re: How to add buildings/slots to Cities

    can you do this with minor citys, like Dublin?

  17. #17
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: How to add buildings/slots to Cities

    Quote Originally Posted by Burnoutfigs View Post
    can you do this with minor citys, like Dublin?
    yeah, it doesnt make any difference... but note that for the moment we can add a building properly at the right place, but we still have a problem when upgrading the added building, the game crashes... so until we find the solution, I suggest to avoid adding a new building

  18. #18

    Default Re: How to add buildings/slots to Cities

    demis,

    Here's the updated spreadsheet. It was created in OpenOffice, but saved as an .xls. I hope all the formatting shows up for MS Office users. As I wrote above, feel free to make any changes you like.

    And so I don't raise false expectations, I'm definitely no math wizard: note I said that I've tutored "basic" math skills
    Last edited by erasmus777; May 21, 2009 at 08:57 PM.

  19. #19
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: How to add buildings/slots to Cities

    Quote Originally Posted by erasmus777 View Post
    demis,

    Here's the updated spreadsheet. It was created in OpenOffice, but saved as an .xls. I hope all the formatting shows up for MS Office users. As I wrote above, feel free to make any changes you like.

    And so I don't raise false expectations, I'm definitely no math wizard: note I said that I've tutored "basic" math skills
    +rep man, simply brilliant presentation!!

  20. #20

    Default Re: How to add buildings/slots to Cities

    Demis I found the solution of naval buildings crash. I'll pm you.

Page 1 of 7 1234567 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •