Amineri Posted May 4, 2014 Share Posted May 4, 2014 I'm starting a new topic to begin work on a community project. Similar to the flags project to add some more countries, but in this case I'd like to add additional cities to each of the 16 Funding Council countries in the game. Currently there are 86 Cities that are created in XCOM Enemy Within. The number of cities in each country is not uniform -- some countries have as many as 10 cities (e.g. U.S.A.), while others have as few as 3 (e.g. Egypt). Here is the complete list of city names, as defined within the XComStrategyGame.int localization file (there should be similar localized versions for other languages) : CityTypeNames[eCity_NewYork]="New York" CityTypeNames[eCity_Miami]="Miami" CityTypeNames[eCity_LA]="Los Angeles" CityTypeNames[eCity_Seattle]="Seattle" CityTypeNames[eCity_Chicago]="Chicago" CityTypeNames[eCity_Houston]="Houston" CityTypeNames[eCity_Dallas]="Dallas" CityTypeNames[eCity_KansasCity]="Kansas City" CityTypeNames[eCity_Baltimore]="Baltimore" CityTypeNames[eCity_SanFrancisco]="San Francisco" CityTypeNames[eCity_Montreal]="Montreal" CityTypeNames[eCity_Edmonton]="Edmonton" CityTypeNames[eCity_Toronto]="Toronto" CityTypeNames[eCity_Vancouver]="Vancouver" CityTypeNames[eCity_Calgary]="Calgary" CityTypeNames[eCity_Ottowa]="Ottawa" CityTypeNames[eCity_MexicoCity]="Mexico City" CityTypeNames[eCity_Chihuahua]="Chihuahua" CityTypeNames[eCity_Tijuana]="Tijuana" CityTypeNames[eCity_Acapulco]="Acapulco" CityTypeNames[eCity_Guadalajara]="Guadalajara" CityTypeNames[eCity_Leon]="Leon" CityTypeNames[eCity_London]="London" CityTypeNames[eCity_Birmingham]="Birmingham" CityTypeNames[eCity_Glasgow]="Glasgow" CityTypeNames[eCity_Liverpool]="Liverpool" CityTypeNames[eCity_Manchester]="Manchester" CityTypeNames[eCity_Leeds]="Leeds" CityTypeNames[eCity_Paris]="Paris" CityTypeNames[eCity_Lyons]="Lyons" CityTypeNames[eCity_Marseille]="Marseille" CityTypeNames[eCity_Lille]="Lille" CityTypeNames[eCity_StJohns]="St. John's" CityTypeNames[eCity_Berlin]="Berlin" CityTypeNames[eCity_Hamburg]="Hamburg" CityTypeNames[eCity_Munich]="Munich" CityTypeNames[eCity_Cologne]="Cologne" CityTypeNames[eCity_Moscow]="Moscow" CityTypeNames[eCity_Novgorod]="Novgorod" CityTypeNames[eCity_Volgograd]="Volgograd" CityTypeNames[eCity_SaintPetersburg]="Saint Petersburg" CityTypeNames[eCity_Mumbai]="Mumbai" CityTypeNames[eCity_Delhi]="Delhi" CityTypeNames[eCity_Bangalore]="Bangalore" CityTypeNames[eCity_Kolkata]="Kolkata" CityTypeNames[eCity_Tokyo]="Tokyo" CityTypeNames[eCity_Osaka]="Osaka" CityTypeNames[eCity_Nagoya]="Nagoya" CityTypeNames[eCity_Sapporo]="Sapporo" CityTypeNames[eCity_Fukuoka]="Fukuoka" CityTypeNames[eCity_Sydney]="Sydney" CityTypeNames[eCity_Melbourne]="Melbourne" CityTypeNames[eCity_Brisbane]="Brisbane" CityTypeNames[eCity_Perth]="Perth" CityTypeNames[eCity_HongKong]="Hong Kong" CityTypeNames[eCity_Beijing]="Beijing" CityTypeNames[eCity_Shanghai]="Shanghai" CityTypeNames[eCity_Guangzhou]="Guangzhou" CityTypeNames[eCity_Chongqing]="Chongqing" CityTypeNames[eCity_Lagos]="Lagos" CityTypeNames[eCity_Kano]="Kano" CityTypeNames[eCity_Ibadan]="Ibadan" CityTypeNames[eCity_Kaduna]="Kaduna" CityTypeNames[eCity_PortHarcourt]="Port Harcourt" CityTypeNames[eCity_BeninCity]="Benin City" CityTypeNames[eCity_Johannesburg]="Johannesburg" CityTypeNames[eCity_Durban]="Durban" CityTypeNames[eCity_CapeTown]="Cape Town" CityTypeNames[eCity_Pretoria]="Pretoria" CityTypeNames[eCity_PortElizabeth]="Port Elizabeth" CityTypeNames[eCity_Bloemfontein]="Bloemfontein" CityTypeNames[eCity_Cairo]="Cairo" CityTypeNames[eCity_Alexandria]="Alexandria" CityTypeNames[eCity_Gizeh]="Gizeh" CityTypeNames[eCity_PortSaid]="Port Said" CityTypeNames[eCity_Bogota]="Bogota" CityTypeNames[eCity_BuenosAires]="Buenos Aires" CityTypeNames[eCity_Cordoba]="Cordoba" CityTypeNames[eCity_Mendoza]="Mendoza" CityTypeNames[eCity_Rosario]="Rosario" CityTypeNames[eCity_SaoPaulo]="Sao Paulo" CityTypeNames[eCity_RiodeJaneiro]="Rio de Janeiro" CityTypeNames[eCity_Salvador]="Salvador" CityTypeNames[eCity_Brasilia]="Brasilia" CityTypeNames[eCity_Manaus]="Manaus" CityTypeNames[eCity_Fortaleza]="Fortaleza" Since the list of city names is in the localization, that means that it is a static array (contrasted to the dynamic arrays used in config arrays) and is tied to the enum XComStrategyGame.XGStrategyActorNativeBase.ECityTypeName. There is a class XGCity that is used to contain the information about each city. These XGCity instances are stored in two places :1) In XGWorld.m_arrCities2) In XGCountry.m_arrCities The country version contains only the cities located within that country (as would be expected), while the world version contains a list of all cities in the world. Fortunately both of these arrays are dynamic arrays, which makes life a little easier. The XGCity class contains the following variable data : int m_iCountry int m_iID int m_iTerrorized string m_strName Vector2D m_v2Coords Everything but the m_iTerrorized must be filled out when the game initializes. Most of this is hard-coded, filled out via the function XGWorld.BuildCity : function BuildCity(int iCity, int iCountry, Vector2D v2Coords) { local XGCity kCity; kCity = Spawn(class'XGCity'); kCity.m_iID = iCity; kCity.m_strName = class'XGLocalizedData'.default.CityTypeNames[iCity]; kCity.m_iCountry = iCountry; kCity.m_v2Coords = v2Coords; m_arrCities[iCity] = kCity; Country(iCountry).m_arrCities.AddItem(iCity); //return; } Only the m_strName field is filled out from localized data. The other fields are filled out from parameters, which are hard-coded into the hex in XGWorld.CreateCities -- for example : BuildCity(8, 0, vect2d(0.2860, 0.2810)); BuildCity(9, 0, vect2d(0.160, 0.2860)); BuildCity(10, 15, vect2d(0.2970, 0.2430)); BuildCity(11, 15, vect2d(0.1720, 0.1830)); Each entry specifies a city ID, the country the city is in (0 = eCountry_UnitedStates, while 15=eCountry_Canada), and a 2d vector position giving the cities location in the SituationRoom/Geoscape. From Wikipedia and CreateCities, -the lat/lon of New York City, USA is 40°40′N / 73°56′W, (0.709768, -1.290380) in radians, while XCOM has the coordinates vect2d(0.2970, 0.2690)-the lat/lon of Moscow, Russia is 55°45′N / 37°37′E, (0.973021, 0.656535 ) in radians, while XCOM has the coordinates vect2d(0.60, 0.180)- the lat/lon of Buenos Aires, Argentina is 34°36′S / 58°23′W, (-0.603884, -1.018981), while XCOM has the coordinates vect2d(0.3370, 0.6880) All XCOM 2d geoscape coordinates appear to fall within the bounds (0.0, 1.0). It seems then the the 2nd XCOM coordinate is north/south, with 0.0 = north pole, becoming more positive going south, andthat the 1st XCOM coordinate is east/west, with 0.0 = 180º longitude near the int'l dateline, becoming more positive going west. The coordinates for Tokyo, Japan support this : vect2d(0.8880, 0.30), with the first coordinate being fairly close to 1.0.The city with the east-most coordinate of vect2d(0.9240, 0.6480) is Brisbane, Australia, and the city with the west-most coordinate of vect2d(0.1560, 0.2390) is Seattle, United States.Since the range of possible lats in radians goes from -pi/2 to +pi/2 (so pi total breadth), while the range of possible lons in radians goes from -pi to pi (so 2*pi in total breadth), while the XCOM scales (0.0, 1.0) in both directions, the scaling is probably not uniform. Translating the above 3 cities lat/lon coordinates into XCOM x/y coordinates yields using y = (pi/2 - lat) / pi, and x = (pi + lon) / (2 * pi):New York City : (0.29463, 0.274074)Moscow : (0.604491, 0.1902778)Buenos Aires : (0.337824, 0.692222) These values computed from the Wikipedia lat/lon coordinates are close enough to the XCOM coordinates to convince me that the conversion is correct. --------------------- To add additional cities will require the following :1) Extending the ECityType enum. I know how to do this, and could expand the enum to up to 255 values.2) Defining additional CityTypeName entries in XComStrategyGame.int localization file (or language localization of choice)One of:3a) Recoding XGWorld.CreateCities with the country / 2d coordinates for each city being added3b) Recoding XGWorld.CreateCities to read from a config variable containing the country / 2d Coordinates Link to comment Share on other sites More sharing options...
Amineri Posted May 4, 2014 Author Share Posted May 4, 2014 Made some very definite progress on this ... 1) Extended the ECityType enum This enum has now been sized up to 255 entries. This requires resizing the upk up by 540 bytes. UPKmodder file to make change : MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=UNSPECIFIED // no hex references in file FUNCTION=ECityType@XGStrategyActorNativeBase RESIZE=540 //extend CityType enum to 255 entries to hold more cities [BEFORE_HEX] 57 00 00 00 //size <|eCity_NewYork|> 00 00 00 00 <|eCity_Miami|> 00 00 00 00 <|eCity_LA|> 00 00 00 00 <|eCity_Seattle|> 00 00 00 00 <|eCity_Chicago|> 00 00 00 00 <|eCity_Houston|> 00 00 00 00 <|eCity_Dallas|> 00 00 00 00 <|eCity_KansasCity|> 00 00 00 00 <|eCity_Baltimore|> 00 00 00 00 <|eCity_SanFrancisco|> 00 00 00 00 <|eCity_Montreal|> 00 00 00 00 <|eCity_Edmonton|> 00 00 00 00 <|eCity_Toronto|> 00 00 00 00 <|eCity_Vancouver|> 00 00 00 00 <|eCity_Calgary|> 00 00 00 00 <|eCity_Ottowa|> 00 00 00 00 <|eCity_MexicoCity|> 00 00 00 00 <|eCity_Chihuahua|> 00 00 00 00 <|eCity_Tijuana|> 00 00 00 00 <|eCity_Acapulco|> 00 00 00 00 <|eCity_Guadalajara|> 00 00 00 00 <|eCity_Leon|> 00 00 00 00 <|eCity_London|> 00 00 00 00 <|eCity_Birmingham|> 00 00 00 00 <|eCity_Glasgow|> 00 00 00 00 <|eCity_Liverpool|> 00 00 00 00 <|eCity_Manchester|> 00 00 00 00 <|eCity_Leeds|> 00 00 00 00 <|eCity_Paris|> 00 00 00 00 <|eCity_Lyons|> 00 00 00 00 <|eCity_Marseille|> 00 00 00 00 <|eCity_Lille|> 00 00 00 00 <|eCity_StJohns|> 00 00 00 00 <|eCity_Berlin|> 00 00 00 00 <|eCity_Hamburg|> 00 00 00 00 <|eCity_Munich|> 00 00 00 00 <|eCity_Cologne|> 00 00 00 00 <|eCity_Moscow|> 00 00 00 00 <|eCity_Novgorod|> 00 00 00 00 <|eCity_Volgograd|> 00 00 00 00 <|eCity_SaintPetersburg|> 00 00 00 00 <|eCity_Mumbai|> 00 00 00 00 <|eCity_Delhi|> 00 00 00 00 <|eCity_Bangalore|> 00 00 00 00 <|eCity_Kolkata|> 00 00 00 00 <|eCity_Tokyo|> 00 00 00 00 <|eCity_Osaka|> 00 00 00 00 <|eCity_Nagoya|> 00 00 00 00 <|eCity_Sapporo|> 00 00 00 00 <|eCity_Fukuoka|> 00 00 00 00 <|eCity_Sydney|> 00 00 00 00 <|eCity_Melbourne|> 00 00 00 00 <|eCity_Brisbane|> 00 00 00 00 <|eCity_Perth|> 00 00 00 00 <|eCity_HongKong|> 00 00 00 00 <|eCity_Beijing|> 00 00 00 00 <|eCity_Shanghai|> 00 00 00 00 <|eCity_Guangzhou|> 00 00 00 00 <|eCity_Chongqing|> 00 00 00 00 <|eCity_Lagos|> 00 00 00 00 <|eCity_Kano|> 00 00 00 00 <|eCity_Ibadan|> 00 00 00 00 <|eCity_Kaduna|> 00 00 00 00 <|eCity_PortHarcourt|> 00 00 00 00 <|eCity_BeninCity|> 00 00 00 00 <|eCity_Johannesburg|> 00 00 00 00 <|eCity_Durban|> 00 00 00 00 <|eCity_CapeTown|> 00 00 00 00 <|eCity_Pretoria|> 00 00 00 00 <|eCity_PortElizabeth|> 00 00 00 00 <|eCity_Bloemfontein|> 00 00 00 00 <|eCity_Cairo|> 00 00 00 00 <|eCity_Alexandria|> 00 00 00 00 <|eCity_Gizeh|> 00 00 00 00 <|eCity_PortSaid|> 00 00 00 00 <|eCity_Bogota|> 00 00 00 00 <|eCity_BuenosAires|> 00 00 00 00 <|eCity_Cordoba|> 00 00 00 00 <|eCity_Mendoza|> 00 00 00 00 <|eCity_Rosario|> 00 00 00 00 <|eCity_SaoPaulo|> 00 00 00 00 <|eCity_RiodeJaneiro|> 00 00 00 00 <|eCity_Salvador|> 00 00 00 00 <|eCity_Brasilia|> 00 00 00 00 <|eCity_Manaus|> 00 00 00 00 <|eCity_Fortaleza|> 00 00 00 00 <|eCity_MAX|> 00 00 00 00 [/BEFORE_HEX] [AFTER_HEX] FF 00 00 00 //size <|eCity_NewYork|> 00 00 00 00 <|eCity_Miami|> 00 00 00 00 <|eCity_LA|> 00 00 00 00 <|eCity_Seattle|> 00 00 00 00 <|eCity_Chicago|> 00 00 00 00 <|eCity_Houston|> 00 00 00 00 <|eCity_Dallas|> 00 00 00 00 <|eCity_KansasCity|> 00 00 00 00 <|eCity_Baltimore|> 00 00 00 00 <|eCity_SanFrancisco|> 00 00 00 00 <|eCity_Montreal|> 00 00 00 00 <|eCity_Edmonton|> 00 00 00 00 <|eCity_Toronto|> 00 00 00 00 <|eCity_Vancouver|> 00 00 00 00 <|eCity_Calgary|> 00 00 00 00 <|eCity_Ottowa|> 00 00 00 00 <|eCity_MexicoCity|> 00 00 00 00 <|eCity_Chihuahua|> 00 00 00 00 <|eCity_Tijuana|> 00 00 00 00 <|eCity_Acapulco|> 00 00 00 00 <|eCity_Guadalajara|> 00 00 00 00 <|eCity_Leon|> 00 00 00 00 <|eCity_London|> 00 00 00 00 <|eCity_Birmingham|> 00 00 00 00 <|eCity_Glasgow|> 00 00 00 00 <|eCity_Liverpool|> 00 00 00 00 <|eCity_Manchester|> 00 00 00 00 <|eCity_Leeds|> 00 00 00 00 <|eCity_Paris|> 00 00 00 00 <|eCity_Lyons|> 00 00 00 00 <|eCity_Marseille|> 00 00 00 00 <|eCity_Lille|> 00 00 00 00 <|eCity_StJohns|> 00 00 00 00 <|eCity_Berlin|> 00 00 00 00 <|eCity_Hamburg|> 00 00 00 00 <|eCity_Munich|> 00 00 00 00 <|eCity_Cologne|> 00 00 00 00 <|eCity_Moscow|> 00 00 00 00 <|eCity_Novgorod|> 00 00 00 00 <|eCity_Volgograd|> 00 00 00 00 <|eCity_SaintPetersburg|> 00 00 00 00 <|eCity_Mumbai|> 00 00 00 00 <|eCity_Delhi|> 00 00 00 00 <|eCity_Bangalore|> 00 00 00 00 <|eCity_Kolkata|> 00 00 00 00 <|eCity_Tokyo|> 00 00 00 00 <|eCity_Osaka|> 00 00 00 00 <|eCity_Nagoya|> 00 00 00 00 <|eCity_Sapporo|> 00 00 00 00 <|eCity_Fukuoka|> 00 00 00 00 <|eCity_Sydney|> 00 00 00 00 <|eCity_Melbourne|> 00 00 00 00 <|eCity_Brisbane|> 00 00 00 00 <|eCity_Perth|> 00 00 00 00 <|eCity_HongKong|> 00 00 00 00 <|eCity_Beijing|> 00 00 00 00 <|eCity_Shanghai|> 00 00 00 00 <|eCity_Guangzhou|> 00 00 00 00 <|eCity_Chongqing|> 00 00 00 00 <|eCity_Lagos|> 00 00 00 00 <|eCity_Kano|> 00 00 00 00 <|eCity_Ibadan|> 00 00 00 00 <|eCity_Kaduna|> 00 00 00 00 <|eCity_PortHarcourt|> 00 00 00 00 <|eCity_BeninCity|> 00 00 00 00 <|eCity_Johannesburg|> 00 00 00 00 <|eCity_Durban|> 00 00 00 00 <|eCity_CapeTown|> 00 00 00 00 <|eCity_Pretoria|> 00 00 00 00 <|eCity_PortElizabeth|> 00 00 00 00 <|eCity_Bloemfontein|> 00 00 00 00 <|eCity_Cairo|> 00 00 00 00 <|eCity_Alexandria|> 00 00 00 00 <|eCity_Gizeh|> 00 00 00 00 <|eCity_PortSaid|> 00 00 00 00 <|eCity_Bogota|> 00 00 00 00 <|eCity_BuenosAires|> 00 00 00 00 <|eCity_Cordoba|> 00 00 00 00 <|eCity_Mendoza|> 00 00 00 00 <|eCity_Rosario|> 00 00 00 00 <|eCity_SaoPaulo|> 00 00 00 00 <|eCity_RiodeJaneiro|> 00 00 00 00 <|eCity_Salvador|> 00 00 00 00 <|eCity_Brasilia|> 00 00 00 00 <|eCity_Manaus|> 00 00 00 00 <|eCity_Fortaleza|> 00 00 00 00 <|eCity_MAX|> 00 00 00 00 <|eCity_MAX|> 00 00 00 01 <|eCity_MAX|> 00 00 00 02 <|eCity_MAX|> 00 00 00 03 <|eCity_MAX|> 00 00 00 04 <|eCity_MAX|> 00 00 00 05 <|eCity_MAX|> 00 00 00 06 <|eCity_MAX|> 00 00 00 07 <|eCity_MAX|> 00 00 00 08 <|eCity_MAX|> 00 00 00 09 <|eCity_MAX|> 00 00 00 0A <|eCity_MAX|> 00 00 00 0B <|eCity_MAX|> 00 00 00 0C <|eCity_MAX|> 00 00 00 0D <|eCity_MAX|> 00 00 00 0E <|eCity_MAX|> 00 00 00 0F <|eCity_MAX|> 00 00 00 10 <|eCity_MAX|> 00 00 00 11 <|eCity_MAX|> 00 00 00 12 <|eCity_MAX|> 00 00 00 13 <|eCity_MAX|> 00 00 00 14 <|eCity_MAX|> 00 00 00 15 <|eCity_MAX|> 00 00 00 16 <|eCity_MAX|> 00 00 00 17 <|eCity_MAX|> 00 00 00 18 <|eCity_MAX|> 00 00 00 19 <|eCity_MAX|> 00 00 00 1A <|eCity_MAX|> 00 00 00 1B <|eCity_MAX|> 00 00 00 1C <|eCity_MAX|> 00 00 00 1D <|eCity_MAX|> 00 00 00 1E <|eCity_MAX|> 00 00 00 1F <|eCity_MAX|> 00 00 00 20 <|eCity_MAX|> 00 00 00 21 <|eCity_MAX|> 00 00 00 22 <|eCity_MAX|> 00 00 00 23 <|eCity_MAX|> 00 00 00 24 <|eCity_MAX|> 00 00 00 25 <|eCity_MAX|> 00 00 00 26 <|eCity_MAX|> 00 00 00 27 <|eCity_MAX|> 00 00 00 28 <|eCity_MAX|> 00 00 00 29 <|eCity_MAX|> 00 00 00 2A <|eCity_MAX|> 00 00 00 2B <|eCity_MAX|> 00 00 00 2C <|eCity_MAX|> 00 00 00 2D <|eCity_MAX|> 00 00 00 2E <|eCity_MAX|> 00 00 00 2F <|eCity_MAX|> 00 00 00 30 <|eCity_MAX|> 00 00 00 31 <|eCity_MAX|> 00 00 00 32 <|eCity_MAX|> 00 00 00 33 <|eCity_MAX|> 00 00 00 34 <|eCity_MAX|> 00 00 00 35 <|eCity_MAX|> 00 00 00 36 <|eCity_MAX|> 00 00 00 37 <|eCity_MAX|> 00 00 00 38 <|eCity_MAX|> 00 00 00 39 <|eCity_MAX|> 00 00 00 3A <|eCity_MAX|> 00 00 00 3B <|eCity_MAX|> 00 00 00 3C <|eCity_MAX|> 00 00 00 3D <|eCity_MAX|> 00 00 00 3E <|eCity_MAX|> 00 00 00 3F <|eCity_MAX|> 00 00 00 40 <|eCity_MAX|> 00 00 00 41 <|eCity_MAX|> 00 00 00 42 <|eCity_MAX|> 00 00 00 43 <|eCity_MAX|> 00 00 00 44 <|eCity_MAX|> 00 00 00 45 <|eCity_MAX|> 00 00 00 46 <|eCity_MAX|> 00 00 00 47 <|eCity_MAX|> 00 00 00 48 <|eCity_MAX|> 00 00 00 49 <|eCity_MAX|> 00 00 00 4A <|eCity_MAX|> 00 00 00 4B <|eCity_MAX|> 00 00 00 4C <|eCity_MAX|> 00 00 00 4D <|eCity_MAX|> 00 00 00 4E <|eCity_MAX|> 00 00 00 4F <|eCity_MAX|> 00 00 00 50 <|eCity_MAX|> 00 00 00 51 <|eCity_MAX|> 00 00 00 52 <|eCity_MAX|> 00 00 00 53 <|eCity_MAX|> 00 00 00 54 <|eCity_MAX|> 00 00 00 55 <|eCity_MAX|> 00 00 00 56 <|eCity_MAX|> 00 00 00 57 <|eCity_MAX|> 00 00 00 58 <|eCity_MAX|> 00 00 00 59 <|eCity_MAX|> 00 00 00 5A <|eCity_MAX|> 00 00 00 5B <|eCity_MAX|> 00 00 00 5C <|eCity_MAX|> 00 00 00 5D <|eCity_MAX|> 00 00 00 5E <|eCity_MAX|> 00 00 00 5F <|eCity_MAX|> 00 00 00 60 <|eCity_MAX|> 00 00 00 61 <|eCity_MAX|> 00 00 00 62 <|eCity_MAX|> 00 00 00 63 <|eCity_MAX|> 00 00 00 64 <|eCity_MAX|> 00 00 00 65 <|eCity_MAX|> 00 00 00 66 <|eCity_MAX|> 00 00 00 67 <|eCity_MAX|> 00 00 00 68 <|eCity_MAX|> 00 00 00 69 <|eCity_MAX|> 00 00 00 6A <|eCity_MAX|> 00 00 00 6B <|eCity_MAX|> 00 00 00 6C <|eCity_MAX|> 00 00 00 6D <|eCity_MAX|> 00 00 00 6E <|eCity_MAX|> 00 00 00 6F <|eCity_MAX|> 00 00 00 70 <|eCity_MAX|> 00 00 00 71 <|eCity_MAX|> 00 00 00 72 <|eCity_MAX|> 00 00 00 73 <|eCity_MAX|> 00 00 00 74 <|eCity_MAX|> 00 00 00 75 <|eCity_MAX|> 00 00 00 76 <|eCity_MAX|> 00 00 00 77 <|eCity_MAX|> 00 00 00 78 <|eCity_MAX|> 00 00 00 79 <|eCity_MAX|> 00 00 00 7A <|eCity_MAX|> 00 00 00 7B <|eCity_MAX|> 00 00 00 7C <|eCity_MAX|> 00 00 00 7D <|eCity_MAX|> 00 00 00 7E <|eCity_MAX|> 00 00 00 7F <|eCity_MAX|> 00 00 00 80 <|eCity_MAX|> 00 00 00 81 <|eCity_MAX|> 00 00 00 82 <|eCity_MAX|> 00 00 00 83 <|eCity_MAX|> 00 00 00 84 <|eCity_MAX|> 00 00 00 85 <|eCity_MAX|> 00 00 00 86 <|eCity_MAX|> 00 00 00 87 <|eCity_MAX|> 00 00 00 88 <|eCity_MAX|> 00 00 00 89 <|eCity_MAX|> 00 00 00 8A <|eCity_MAX|> 00 00 00 8B <|eCity_MAX|> 00 00 00 8C <|eCity_MAX|> 00 00 00 8D <|eCity_MAX|> 00 00 00 8E <|eCity_MAX|> 00 00 00 8F <|eCity_MAX|> 00 00 00 90 <|eCity_MAX|> 00 00 00 91 <|eCity_MAX|> 00 00 00 92 <|eCity_MAX|> 00 00 00 93 <|eCity_MAX|> 00 00 00 94 <|eCity_MAX|> 00 00 00 95 <|eCity_MAX|> 00 00 00 96 <|eCity_MAX|> 00 00 00 97 <|eCity_MAX|> 00 00 00 98 <|eCity_MAX|> 00 00 00 99 <|eCity_MAX|> 00 00 00 9A <|eCity_MAX|> 00 00 00 9B <|eCity_MAX|> 00 00 00 9C <|eCity_MAX|> 00 00 00 9D <|eCity_MAX|> 00 00 00 9E <|eCity_MAX|> 00 00 00 9F <|eCity_MAX|> 00 00 00 A0 <|eCity_MAX|> 00 00 00 A1 <|eCity_MAX|> 00 00 00 A2 <|eCity_MAX|> 00 00 00 A3 <|eCity_MAX|> 00 00 00 A4 <|eCity_MAX|> 00 00 00 A5 <|eCity_MAX|> 00 00 00 A6 <|eCity_MAX|> 00 00 00 A7 <|eCity_MAX|> 00 00 00 A8 [/AFTER_HEX] 2) Defined additional CityTypeName entries in XComStrategyGame.int localization file (or language localization of choice) This requires increasing the size of the XGLocalizedData.CityTypeNames localization variable to 255 : MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=UNSPECIFIED // no hex references in file FUNCTION=CityTypeNames@XGLocalizedData // resize config variable to hold more localized city names [BEFORE_HEX] {|CountryNames@XGLocalizedData|} <|None|> 00 00 00 00 {|CountryNames@XGLocalizedData|} 56 00 00 00 // size 02 80 40 00 // flags 00 00 00 00 // flags <|None|> 00 00 00 00 {|ECityType@XGStrategyActorNativeBase|} [/BEFORE_HEX] [AFTER_HEX] {|CountryNames@XGLocalizedData|} <|None|> 00 00 00 00 {|CountryNames@XGLocalizedData|} FF 00 00 00 // size 02 80 40 00 // flags 00 00 00 00 // flags <|None|> 00 00 00 00 {|ECityType@XGStrategyActorNativeBase|} [/AFTER_HEX] These two changes expand the number of localizable city names from vanilla 86 to 255. Once this is done the CityTypeNames localization data in Localization/XComStrategyGame.int can be added to. Additional city entries will require numeric values, as there aren't any new enumeration names added. For example: CityTypeNames[eCity_Manaus]="Manaus" CityTypeNames[eCity_Fortaleza]="Fortaleza" CityTypeNames[87]="New City 1" CityTypeNames[88]="New City 2" --------------- The last step was the trickiest, as I opted to try and implement the most easily configurable option :3b) Recoding XGWorld.CreateCities to read from a config variable containing the country / 2d Coordinates What I ended up doing was using an unused dynamic array XGFacility_Engineering.m_arrAlloyProjects and converting it into a config dynamic array of type TSatellite (this structure allows Vector2D definition). The new config data is defined as part of DefaultGameData.ini. The first step is converting m_arrAlloyProjects to a config variable, which requires 2 changes : MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=UNSPECIFIED // no hex references in file FUNCTION=m_arrAlloyProjects@XGFacility_Engineering //convert to config array [BEFORE_HEX] 01 00 00 00 00 00 40 00 00 00 00 00 //flags -- <|None|> 00 00 00 00 00 00 00 00 {|m_arrAlloyProjects@m_arrAlloyProjects@XGFacility_Engineering|} [/BEFORE_HEX] [AFTER_HEX] 01 00 00 00 00 40 40 00 00 00 00 00 //flags -- <|None|> 00 00 00 00 00 00 00 00 {|m_arrAlloyProjects@m_arrAlloyProjects@XGFacility_Engineering|} [/AFTER_HEX] MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=UNSPECIFIED // no hex references in file FUNCTION=m_arrAlloyProjects@m_arrAlloyProjects@XGFacility_Engineering //change struct type from TAlloyProject to TSatellite [BEFORE_HEX] <|None|> 00 00 00 00 00 00 00 00 01 00 00 00 00 00 40 00 00 00 00 00 // flags <|None|> 00 00 00 00 00 00 00 00 {|TAlloyProject@XGStrategyActorNativeBase|} [/BEFORE_HEX] [AFTER_HEX] <|None|> 00 00 00 00 00 00 00 00 01 00 00 00 00 40 40 00 00 00 00 00 // flags -- "config" added <|None|> 00 00 00 00 00 00 00 00 {|TSatellite@XGStrategyActorNativeBase|} // changed to struct TSatellite [/AFTER_HEX] After this is done the m_arrAlloyProjects variable needs to be unlinked from the CheckpointRecord_XGFacility_Engineering, and the existing UpdateAlloyProjects call has to be removed from XGFacility_Engineering.Update. MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=UNSPECIFIED // no hex references in file FUNCTION=m_arrFoundryProjects@CheckpointRecord_XGFacility_Engineering@XGFacility_Engineering //unlink m_arrAlloyProjects from the Checkpoint Record [BEFORE_HEX] {|m_arrAlloyProjects@CheckpointRecord_XGFacility_Engineering@XGFacility_Engineering|} <|None|> 00 00 00 00 {|m_arrAlloyProjects@CheckpointRecord_XGFacility_Engineering@XGFacility_Engineering|} 01 00 00 00 00 00 40 00 00 00 00 00 <|None|> 00 00 00 00 00 00 00 00 {|m_arrFoundryProjects@m_arrFoundryProjects@CheckpointRecord_XGFacility_Engineering@XGFacility_Engineering|} [/BEFORE_HEX] [AFTER_HEX] {|m_arrItemProjects@CheckpointRecord_XGFacility_Engineering@XGFacility_Engineering|} <|None|> 00 00 00 00 {|m_arrItemProjects@CheckpointRecord_XGFacility_Engineering@XGFacility_Engineering|} 01 00 00 00 00 00 40 00 00 00 00 00 <|None|> 00 00 00 00 00 00 00 00 {|m_arrFoundryProjects@m_arrFoundryProjects@CheckpointRecord_XGFacility_Engineering@XGFacility_Engineering|} [/AFTER_HEX] MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=BB 93 C6 C8 D2 91 82 44 87 9B 79 9B 49 5B 8D E9 // XComStrategyGame EW Patch 3.upk FUNCTION=Update@XGFacility_Engineering //disable call to UpdateAlloyProjects [BEFORE_HEX] [code] //UpdateFoundryProjects() 1B 30 34 00 00 00 00 00 00 16 //UpdateAlloyProjects() 1B F9 33 00 00 00 00 00 00 16 [/CODE] [/BEFORE_HEX] [AFTER_HEX] [code] //UpdateFoundryProjects() 1B 30 34 00 00 00 00 00 00 16 //null ops 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B [/CODE] [/AFTER_HEX] After this is done, the XGWorld functions that fills out the m_arrCities structure when a new game is created have to be reworked to retrieve data from the newly created config variables. The existing CreateCities function had no local variables, so I chose instead to build the functionality directly in BuildCity. The new BuildCity code looks like : m_arrCities.Add(255); iCity = 0; J0x18: // End:0x272 [Loop If] if(iCity < class'XGFacility_Engineering'.default.m_arrAlloyProjects.Length) { kCity = Spawn(class'XGCity'); kCity.m_iID = class'XGFacility_Engineering'.default.m_arrAlloyProjects[iCity].iType; kCity.m_strName = class'XGLocalizedData'.default.CityTypeNames[kCity.m_iID]; kCity.m_iCountry = class'XGFacility_Engineering'.default.m_arrAlloyProjects[iCity].iCountry; kCity.m_v2Coords = class'XGFacility_Engineering'.default.m_arrAlloyProjects[iCity].v2Loc; m_arrCities[kCity.m_iID] = kCity; Country(kCity.m_iCountry).m_arrCities.AddItem(kCity.m_iID); ++ iCity; // [Loop Continue] goto J0x18; } return; It initializes m_arrCities to hold up to 255 cities, then loops over the m_arrAlloyProjects config array to retrieve the data. Localized city names are still retrieved from XGLocalizedData.CityTypeNames, so this will support different localizations. The UPKmodder file for BuildCity: MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=BB 93 C6 C8 D2 91 82 44 87 9B 79 9B 49 5B 8D E9 // XComStrategyGame EW Patch 3.upk FUNCTION=BuildCity@XGWorld RESIZE=100 // repurpose to replace XGWorld.CreateCities, reading data from config file [BEFORE_HEX] [HEADER] 38 01 00 00 C4 00 00 00 [/HEADER] [code] //kCity = Spawn(class'XGCity') 0F 00 18 56 00 00 1C 50 FD FF FF 20 E5 2A 00 00 4A 4A 4A 4A 4A 4A 4A 16 //kCity.m_iID = iCity 0F 19 00 18 56 00 00 09 00 D8 2A 00 00 00 01 D8 2A 00 00 00 1B 56 00 00 //kCity.m_strName = class'XGLocalizedData'.default.CityTypeNames[iCity] 0F 19 00 18 56 00 00 09 00 D9 2A 00 00 00 01 D9 2A 00 00 1A 00 1B 56 00 00 12 20 B5 43 00 00 09 00 AD 43 00 00 00 02 AD 43 00 00 //kCity.m_iCountry = iCountry 0F 19 00 18 56 00 00 09 00 D7 2A 00 00 00 01 D7 2A 00 00 00 1A 56 00 00 //kCity.m_v2Coords = v2Coords 0F 19 00 18 56 00 00 09 00 DA 2A 00 00 00 01 DA 2A 00 00 00 19 56 00 00 //m_arrCities[iCity] = kCity 0F 10 00 1B 56 00 00 01 C2 55 00 00 00 18 56 00 00 //Country(iCountry).m_arrCities.AddItem(iCity) 55 19 1B 3F 07 00 00 00 00 00 00 00 1A 56 00 00 16 09 00 A2 2B 00 00 00 01 A2 2B 00 00 0A 00 00 1B 56 00 00 16 //return 04 0B //EOS 53 [/CODE] [/BEFORE_HEX] [AFTER_HEX] [HEADER] B0 02 00 00 C4 01 00 00 [/HEADER] [code] //m_arrCities.Add(255) 54 01 C2 55 00 00 2C FF 16 //iCity = 0 0F 00 1B 56 00 00 25 //if(iCity < class'XGFacility_Engineering'.default.m_arrAlloyProjects.Length) 07 72 02 96 00 1B 56 00 00 36 12 20 18 36 00 00 09 00 AD 43 00 00 00 02 47 34 00 00 16 //kCity = Spawn(class'XGCity') 0F 00 18 56 00 00 1C 50 FD FF FF 20 E5 2A 00 00 4A 4A 4A 4A 4A 4A 4A 16 //kCity.m_iID = class'XGFacility_Engineering'.default.m_arrAlloyProjects[iCity].iType 0F 19 00 18 56 00 00 09 00 D8 2A 00 00 00 01 D8 2A 00 00 35 3A 03 00 00 3B 03 00 00 00 00 10 00 1B 56 00 00 12 20 18 36 00 00 09 00 AD 43 00 00 00 02 47 34 00 00 //kCity.m_strName = class'XGLocalizedData'.default.CityTypeNames[kCity.m_iID] 0F 19 00 18 56 00 00 09 00 D9 2A 00 00 00 01 D9 2A 00 00 1A 19 00 18 56 00 00 09 00 D8 2A 00 00 00 01 D8 2A 00 00 12 20 B5 43 00 00 09 00 AD 43 00 00 00 02 AD 43 00 00 //kCity.m_iCountry = class'XGFacility_Engineering'.default.m_arrAlloyProjects[iCity].iCountry 0F 19 00 18 56 00 00 09 00 D7 2A 00 00 00 01 D7 2A 00 00 35 37 03 00 00 3B 03 00 00 00 00 10 00 1B 56 00 00 12 20 18 36 00 00 09 00 AD 43 00 00 00 02 47 34 00 00 //kCity.m_v2Coords = class'XGFacility_Engineering'.default.m_arrAlloyProjects[iCity].v2Loc 0F 19 00 18 56 00 00 09 00 DA 2A 00 00 00 01 DA 2A 00 00 35 39 03 00 00 3B 03 00 00 00 00 10 00 1B 56 00 00 12 20 18 36 00 00 09 00 AD 43 00 00 00 02 47 34 00 00 //m_arrCities[kCity.m_iID] = kCity 0F 10 19 00 18 56 00 00 09 00 D8 2A 00 00 00 01 D8 2A 00 00 01 C2 55 00 00 00 18 56 00 00 //Country(kCity.m_iCountry).m_arrCities.AddItem(kCity.m_iID) 55 19 1B 3F 07 00 00 00 00 00 00 19 00 18 56 00 00 09 00 D7 2A 00 00 00 01 D7 2A 00 00 16 09 00 A2 2B 00 00 00 01 A2 2B 00 00 1F 00 19 00 18 56 00 00 09 00 D8 2A 00 00 00 01 D8 2A 00 00 16 //++iCity A3 00 1B 56 00 00 16 //while loop 06 18 00 //return 04 0B //null ops 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B //EOS 53 [/CODE] [/AFTER_HEX] Making this change required converting the three parameters in BuildCity into local variables : MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=UNSPECIFIED // no hex references in file FUNCTION=iCity@BuildCity@XGWorld // change from parameter to local [BEFORE_HEX] 01 00 00 00 //size 80 00 00 00 00 00 00 00 //flags <|None|> 00 00 00 00 [/BEFORE_HEX] [AFTER_HEX] 01 00 00 00 //size 00 00 00 00 00 00 00 00 //flags <|None|> 00 00 00 00 [/AFTER_HEX] MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=BB 93 C6 C8 D2 91 82 44 87 9B 79 9B 49 5B 8D E9 // XComStrategyGame EW Patch 3.upk FUNCTION=iCountry@BuildCity@XGWorld // change from parameter to local [BEFORE_HEX] 01 00 00 00 //size 80 00 00 00 00 00 00 00 //flags <|None|> 00 00 00 00 [/BEFORE_HEX] [AFTER_HEX] 01 00 00 00 //size 00 00 00 00 00 00 00 00 //flags <|None|> 00 00 00 00 [/AFTER_HEX] MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=BB 93 C6 C8 D2 91 82 44 87 9B 79 9B 49 5B 8D E9 // XComStrategyGame EW Patch 3.upk FUNCTION=v2Coords@BuildCity@XGWorld // change from parameter to local [BEFORE_HEX] 01 00 00 00 //size 80 00 00 00 00 00 00 00 //flags <|None|> 00 00 00 00 [/BEFORE_HEX] [AFTER_HEX] 01 00 00 00 //size 00 00 00 00 00 00 00 00 //flags <|None|> 00 00 00 00 [/AFTER_HEX] Finally, in XGWorld.InitNewGame, the call to CreateCities is redirected to BuildCity : MODFILEVERSION=4 UPKFILE=XComStrategyGame.upk GUID=BB 93 C6 C8 D2 91 82 44 87 9B 79 9B 49 5B 8D E9 // XComStrategyGame EW Patch 3.upk FUNCTION=InitNewGame@XGWorld //redirect CreateCities initialization to BuildCity [BEFORE_HEX] [code] //CreateContinents() 1B 65 07 00 00 00 00 00 00 16 //CreateCountries() 1B 66 07 00 00 00 00 00 00 16 //CreateCities() 1B 63 07 00 00 00 00 00 00 16 //CreateSatNodes() 1B 78 07 00 00 00 00 00 00 16 [/CODE] [/BEFORE_HEX] [AFTER_HEX] [code] //CreateContinents() 1B 65 07 00 00 00 00 00 00 16 //CreateCountries() 1B 66 07 00 00 00 00 00 00 16 //BuildCity() 1B 0A 05 00 00 00 00 00 00 16 //CreateSatNodes() 1B 78 07 00 00 00 00 00 00 16 [/CODE] [/AFTER_HEX] There are a fair number of object changes here, but most of them are pretty small. Once this is done, city data will no longer be read from the hard-coded CreateCities function, but will instead be read from the (newly created) m_arrAlloyProjects config variable in DefaultGameData.ini. Each line of data has the format : m_arrAlloyProjects=(iType=0, v2Loc=(X=0.2970, Y=0.2690), iCountry=0) ; New York iType is the city enum value. This value corresponds to the enum/numeric entry in the CityTypeNames localization data in XComStrategyGame.int.v2Loc is the 2d vector location of the city, as described above (0,0) is in the NW "corner", and (1,1) is in the SE "corner" of the mapiCountry is the value of the country enum that the city is in. 0, for example, is eCountry_UnitedStates Currently the vanilla EW only uses cities for the following two purposes:1) Location of Terror attacks2) Location of Abduction attacks It only draws these from Funding Council countries. So while it is possible to add cities to non-Council countries, this will have no game-impact in the vanilla game. In Long War 3.0, cities are also used for :3) Alien Base locations Again these are only possible in Funding Council countries. The block of configuration data has to be preceded with the tag : [XComStrategyGame.XGFacility_Engineering] so that the configuration data is read in. To not interfere with other config data, it should be put at the end of the DefaultGameData.ini file. Below is the complete config data to reproduce all 85 vanilla cities. This is using the vanilla XCOM values, which may or may not be particularly close to where the cities are actually located. ;place block at end of DefaultGameData.ini file [XComStrategyGame.XGFacility_Engineering] ;city definitions ;iType is city index, aka enum value ;iCountry is country city is in ;v2Loc is the 2d location of the city ; x ranges from 0.0=north pole to 1.0 south pole ; y ranges from 0.0=180 long to 180 long, starting from west of U.S.A to east of Japan ; First 85 are from vanilla XGWorld.CreateCities ;United States m_arrAlloyProjects=(iType=0, v2Loc=(X=0.2970, Y=0.2690), iCountry=0) ; New York m_arrAlloyProjects=(iType=1, v2Loc=(X=0.2750, Y=0.3590), iCountry=0) ; Miami m_arrAlloyProjects=(iType=2, v2Loc=(X=0.1640, Y=0.2970), iCountry=0) ; Los Angeles m_arrAlloyProjects=(iType=3, v2Loc=(X=0.1560, Y=0.2390), iCountry=0) ; Seattle m_arrAlloyProjects=(iType=4, v2Loc=(X=0.2600, Y=0.2680), iCountry=0) ; Chicago m_arrAlloyProjects=(iType=5, v2Loc=(X=0.2310, Y=0.3340), iCountry=0) ; Houston m_arrAlloyProjects=(iType=6, v2Loc=(X=0.2280, Y=0.3240), iCountry=0) ; Dallas m_arrAlloyProjects=(iType=7, v2Loc=(X=0.2370, Y=0.2930), iCountry=0) ; Kansas City m_arrAlloyProjects=(iType=8, v2Loc=(X=0.2860, Y=0.2810), iCountry=0) ; Baltimore m_arrAlloyProjects=(iType=9, v2Loc=(X=0.1600, Y=0.2860), iCountry=0) ; San Francisco ; Canada m_arrAlloyProjects=(iType=10, v2Loc=(X=0.2970, Y=0.2430), iCountry=10) ; Montreal m_arrAlloyProjects=(iType=11, v2Loc=(X=0.1720, Y=0.1830), iCountry=10) ; Edmonton m_arrAlloyProjects=(iType=12, v2Loc=(X=0.2800, Y=0.2530), iCountry=10) ; Toronto m_arrAlloyProjects=(iType=13, v2Loc=(X=0.1570, Y=0.2230), iCountry=10) ; Vancouver m_arrAlloyProjects=(iType=14, v2Loc=(X=0.1780, Y=0.2170), iCountry=10) ; Calgary m_arrAlloyProjects=(iType=15, v2Loc=(X=0.2860, Y=0.2420), iCountry=10) ; Ottowa m_arrAlloyProjects=(iType=32, v2Loc=(X=0.3500, Y=0.2320), iCountry=10) ; St Johns ; Mexico m_arrAlloyProjects=(iType=16, v2Loc=(X=0.2210, Y=0.3880), iCountry=21) ; Mexico City m_arrAlloyProjects=(iType=17, v2Loc=(X=0.2090, Y=0.3480), iCountry=21) ; Chihuahua m_arrAlloyProjects=(iType=18, v2Loc=(X=0.1760, Y=0.3190), iCountry=21) ; Tijuana m_arrAlloyProjects=(iType=19, v2Loc=(X=0.2250, Y=0.4030), iCountry=21) ; Acapulco m_arrAlloyProjects=(iType=20, v2Loc=(X=0.2200, Y=0.3910), iCountry=21) ; Guadalajara m_arrAlloyProjects=(iType=21, v2Loc=(X=0.2170, Y=0.3760), iCountry=21) ; Leon ; Argentina m_arrAlloyProjects=(iType=76, v2Loc=(X=0.3370, Y=0.6880), iCountry=20) ; Buenos Aires m_arrAlloyProjects=(iType=77, v2Loc=(X=0.3270, Y=0.6750), iCountry=20) ; Cordoba m_arrAlloyProjects=(iType=78, v2Loc=(X=0.3100, Y=0.6680), iCountry=20) ; Mendoza m_arrAlloyProjects=(iType=79, v2Loc=(X=0.3330, Y=0.6810), iCountry=20) ; Rosario ; Brazil m_arrAlloyProjects=(iType=80, v2Loc=(X=0.3640, Y=0.6380), iCountry=19) ; Sao Paulo m_arrAlloyProjects=(iType=81, v2Loc=(X=0.3780, Y=0.6240), iCountry=19) ; Rio de Janeiro m_arrAlloyProjects=(iType=82, v2Loc=(X=0.3900, Y=0.5710), iCountry=19) ; Salvador m_arrAlloyProjects=(iType=83, v2Loc=(X=0.3740, Y=0.5750), iCountry=19) ; Brasilia m_arrAlloyProjects=(iType=84, v2Loc=(X=0.3450, Y=0.5120), iCountry=19) ; Manaus m_arrAlloyProjects=(iType=85, v2Loc=(X=0.3920, Y=0.5130), iCountry=19) ; Fortaleza ; UK m_arrAlloyProjects=(iType=22, v2Loc=(X=0.5000, Y=0.2130), iCountry=3) ; London m_arrAlloyProjects=(iType=23, v2Loc=(X=0.4940, Y=0.2020), iCountry=3) ; Birmingham m_arrAlloyProjects=(iType=24, v2Loc=(X=0.4890, Y=0.1910), iCountry=3) ; Glasgow m_arrAlloyProjects=(iType=25, v2Loc=(X=0.4960, Y=0.2140), iCountry=3) ; Liverpool m_arrAlloyProjects=(iType=26, v2Loc=(X=0.4960, Y=0.2140), iCountry=3) ; Manchester m_arrAlloyProjects=(iType=27, v2Loc=(X=0.4950, Y=0.1980), iCountry=3) ; Leeds ; France m_arrAlloyProjects=(iType=28, v2Loc=(X=0.5040, Y=0.2300), iCountry=5) ; Paris m_arrAlloyProjects=(iType=29, v2Loc=(X=0.5120, Y=0.2460), iCountry=5) ; Lyons m_arrAlloyProjects=(iType=30, v2Loc=(X=0.5150, Y=0.2560), iCountry=5) ; Marseille m_arrAlloyProjects=(iType=31, v2Loc=(X=0.5070, Y=0.2220), iCountry=5) ; Lille ; Germany m_arrAlloyProjects=(iType=33, v2Loc=(X=0.5360, Y=0.2080), iCountry=4) ; Berlin m_arrAlloyProjects=(iType=34, v2Loc=(X=0.5270, Y=0.2010), iCountry=4) ; Hamburg m_arrAlloyProjects=(iType=35, v2Loc=(X=0.5320, Y=0.2310), iCountry=4) ; Munich m_arrAlloyProjects=(iType=36, v2Loc=(X=0.5210, Y=0.2180), iCountry=4) ; Cologne ; Russia m_arrAlloyProjects=(iType=37, v2Loc=(X=0.6000, Y=0.1800), iCountry=1) ; Moscow m_arrAlloyProjects=(iType=38, v2Loc=(X=0.6180, Y=0.1810), iCountry=1) ; Novgorod m_arrAlloyProjects=(iType=39, v2Loc=(X=0.6240, Y=0.2260), iCountry=1) ; Volgograd m_arrAlloyProjects=(iType=40, v2Loc=(X=0.5820, Y=0.1690), iCountry=1) ; Saint Petersburg ; India m_arrAlloyProjects=(iType=41, v2Loc=(X=0.7030, Y=0.3900), iCountry=7) ; Mumbai m_arrAlloyProjects=(iType=42, v2Loc=(X=0.7130, Y=0.3390), iCountry=7) ; Delhi m_arrAlloyProjects=(iType=43, v2Loc=(X=0.7160, Y=0.4330), iCountry=7) ; Bangalore m_arrAlloyProjects=(iType=44, v2Loc=(X=0.7440, Y=0.3720), iCountry=7) ; Kolkata ; Japan m_arrAlloyProjects=(iType=45, v2Loc=(X=0.8880, Y=0.3000), iCountry=6) ; Tokyo m_arrAlloyProjects=(iType=46, v2Loc=(X=0.8760, Y=0.3060), iCountry=6) ; Osaka m_arrAlloyProjects=(iType=47, v2Loc=(X=0.8800, Y=0.3040), iCountry=6) ; Nagoya m_arrAlloyProjects=(iType=48, v2Loc=(X=0.8930, Y=0.2600), iCountry=6) ; Sapporo m_arrAlloyProjects=(iType=49, v2Loc=(X=0.8620, Y=0.3150), iCountry=6) ; Fukuoka ; Australia m_arrAlloyProjects=(iType=50, v2Loc=(X=0.9200, Y=0.6840), iCountry=8) ; Sydney m_arrAlloyProjects=(iType=51, v2Loc=(X=0.9030, Y=0.7070), iCountry=8) ; Melbourne m_arrAlloyProjects=(iType=52, v2Loc=(X=0.9240, Y=0.6480), iCountry=8) ; Brisbane m_arrAlloyProjects=(iType=53, v2Loc=(X=0.8230, Y=0.6780), iCountry=8) ; Perth ; China m_arrAlloyProjects=(iType=54, v2Loc=(X=0.8170, Y=0.3740), iCountry=2) ; Hong Kong m_arrAlloyProjects=(iType=55, v2Loc=(X=0.8250, Y=0.2760), iCountry=2) ; Beijing m_arrAlloyProjects=(iType=56, v2Loc=(X=0.8370, Y=0.3280), iCountry=2) ; Shanghai m_arrAlloyProjects=(iType=57, v2Loc=(X=0.8140, Y=0.3710), iCountry=2) ; Guangzhou m_arrAlloyProjects=(iType=58, v2Loc=(X=0.7980, Y=0.3410), iCountry=2) ; Chongqing ; Nigeria m_arrAlloyProjects=(iType=59, v2Loc=(X=0.5100, Y=0.4610), iCountry=25) ; Lagos m_arrAlloyProjects=(iType=60, v2Loc=(X=0.5230, Y=0.4350), iCountry=25) ; Kano m_arrAlloyProjects=(iType=61, v2Loc=(X=0.5120, Y=0.4560), iCountry=25) ; Ibadan m_arrAlloyProjects=(iType=62, v2Loc=(X=0.5190, Y=0.4420), iCountry=25) ; Kaduna m_arrAlloyProjects=(iType=63, v2Loc=(X=0.5190, Y=0.4730), iCountry=25) ; Port Harcourt m_arrAlloyProjects=(iType=64, v2Loc=(X=0.5160, Y=0.4650), iCountry=25) ; Benin City ; South Africa m_arrAlloyProjects=(iType=65, v2Loc=(X=0.5780, Y=0.6440), iCountry=22) ; Johannesburg m_arrAlloyProjects=(iType=68, v2Loc=(X=0.5790, Y=0.6420), iCountry=22) ; Pretoria m_arrAlloyProjects=(iType=66, v2Loc=(X=0.5840, Y=0.6690), iCountry=22) ; Durban m_arrAlloyProjects=(iType=67, v2Loc=(X=0.5520, Y=0.6880), iCountry=22) ; Cape Town m_arrAlloyProjects=(iType=69, v2Loc=(X=0.5700, Y=0.6870), iCountry=22) ; Port Elizabeth m_arrAlloyProjects=(iType=70, v2Loc=(X=0.5700, Y=0.6600), iCountry=22) ; Bloemfontein ; Egypt m_arrAlloyProjects=(iType=71, v2Loc=(X=0.5880, Y=0.3390), iCountry=18) ; Cairo m_arrAlloyProjects=(iType=72, v2Loc=(X=0.5840, Y=0.3280), iCountry=18) ; Alexandria m_arrAlloyProjects=(iType=74, v2Loc=(X=0.5910, Y=0.3280), iCountry=18) ; Port Said ; New Cities ;m_arrAlloyProjects=(iType=86, v2Loc=(X=0.0000, Y=0.0000), iCountry=0) ; template for creating new city entries --------------------------- A couple of notes : 1) Cities are created when a new game is created and afterwards stored in the savefile. So these changes will have no impact on existing games -- a new game has to be started.2) The CityType enum contains 86 entries but vanilla only defines 85 cities. The localization line "CityTypeNames[eCity_Gizeh]="Gizeh" exists, but the city is not created in XGWorld.CreateCities. Link to comment Share on other sites More sharing options...
Amineri Posted May 6, 2014 Author Share Posted May 6, 2014 (edited) So there's a few major cities in the world that I think it would be fun to include, but simply aren't because they didn't happen to "make the cut" as a Council Country, despite in some cases the country having a significant military. Maybe the narrative justification is politics -- hard to say. I'd like some help from people with additional cities that people think should be included. In particular Russia only has 4 cities, which seems a bit light.The current 4 Russian cities are:Moscow, Novgorod, Volgograd, Saint Petersburg According to Wikipedia, Volgograd is the 12th biggest in Russia by population. However I'm not sure of the economic/political importance of various Russian cities, so I can't do much other than some internet research. This list seems to miss some of the bigger ones, such as:Novosbirsk, Yekaterinberg, Samara, Omsk, Kazan, and Chelyabinsk At any rate, here's some more non-Council cities I'm working on configuring: The first list is based on Wikipedia article of 20 largest cities in the world, adding those not already in-game.- Bangkok, Thailand (not available country in XCOM)- Bogata, Columbia (country 28)- Dhaka, Bangladesh (not available country in XCOM)- Istanbul, Turkey (country 11)- Jakarta, Indonesia (country 12)- Karachi, Pakistan (country 14)- Manila, Philippines (not available country in XCOM)- Seoul, South Korea (country 10) The next list adds at least 1 city to each XCOM non-Council country in the game:- Milan, Italy (country 9)- Naples, Italy (country 9)- Rome, Italy (country 9)- Madrid, Spain (country 13)- Barcelona, Spain (country 13)- Tehran, Iran (country 16)- Tel Aviv, Israel (country 17)- Warszawa, Poland (country 23)- Kyiv, Ukraine (country 24)- Athens, Greece (country 27)- Lisbon, Portugal (country 29)- Stockholm, Sweden (country 30)- Dublin, Ireland (country 31)- Glasgow, Scotland (country 32)- Oslo, Norway (country 33)- Amsterdam, Netherlands (country 34)- Antwerp, Belgium (country 35) There's one issue in that Scotland is technically part of the United Kingdom, along with England and Wales, so including a separate country ID for Scotland is a bit strange. Additional cities in Council Countries:Russia :- Novosibirsk- Yekaterinburg- Chelyabinsk - Samara- Vladivostok- Khabarovsk m_arrAlloyProjects=(iType=86, v2Loc=(X=0.730370, Y=0.194352), iCountry=1) ; Novosibirsk / 55°01′N 82°56′E m_arrAlloyProjects=(iType=87, v2Loc=(X=0.668287, Y=0.184259), iCountry=1) ; Yekaterinburg / 56°50′N 60°35′E m_arrAlloyProjects=(iType=88, v2Loc=(X=0.670462, Y=0.193611), iCountry=1) ; Chelyabinsk / 55°09′17″N 61°22′33″E m_arrAlloyProjects=(iType=89, v2Loc=(X=0.639259, Y=0.204444), iCountry=1) ; Samara / 53°12′10″N 50°08′27″E m_arrAlloyProjects=(iType=90, v2Loc=(X=0.866389, Y=0.260370), iCountry=1) ; Vladivostok / 43°08′N 131°54′E m_arrAlloyProjects=(iType=91, v2Loc=(X=0.875185, Y=0.230648), iCountry=1) ; Khabarovsk / 48°29′N 135°04′E CityTypeNames[86]="Novosibirsk" CityTypeNames[87]="Yekaterinburg" CityTypeNames[88]="Chelyabinsk" CityTypeNames[89]="Samara" CityTypeNames[90]="Vladivostok" CityTypeNames[91]="Khabarovsk" My plan is to update this list with XCOM coodinates and config file lines for each new city. It's kind of a long term project, and if anyone wants to help or has suggestions about cities, would be glad to accept the help. :smile: Edited May 7, 2014 by Amineri Link to comment Share on other sites More sharing options...
wghost81 Posted May 6, 2014 Share Posted May 6, 2014 Having Chelyabinsk will be epic. :smile: I'm from Samara and I'm actually proud wiki considers it a major city. :smile: Russia is... well... big. I'm not sure on what basis one should select a cities to add, but I believe, these should be relatively easily recognizable as major Russian cities not only by Russians (and this goes for other countries too). Federal cities (Moscow and Saint Petersburg) are already included and you can additionally include biggest cities (Novosbirsk, Yekaterinburg, Nizhny Novgorod, Kazan, Samara, Volgograd, Krasnoyarsk) and some big Far Eastern cities (Vladivostok, Khabarovsk). Link to comment Share on other sites More sharing options...
Amineri Posted May 6, 2014 Author Share Posted May 6, 2014 Vanilla U.S.A has 10 defined cities, so I'm thinking that in general no more than 10 cities per country as a rule-of-thumb seems to be a good starting point. There's a limit of 255 definiable cities (and really going beyond that might be getting a bit gratuitous). There's 36 Council countries, so there's not room for 10 cities in every Council Country, and there are also some pretty major cities in countries that aren't even defined for XCOM. The criteria I'm thinking of for cities would be :1) Major population center is a factor2) Political or economic significance is a factor3) Geographically distinct (definitely not part of another metropolitan area) So for example, Long Beach is effectively part of the Los Angeles Metropolitan area, and while San Diego isn't, it's so close that on a world map it would basically be right one top of Los Angeles. Definitely thanks for your input regarding Russian cities. My inclination would be to put in :because they are big:- Novobirsk- Yekaterinburgbecause wghost thinks they are cool:- Chelyabinsk - Samarabecause they add geographic diversity:- Vladivostok- Khabarovsk Link to comment Share on other sites More sharing options...
johnnylump Posted May 6, 2014 Share Posted May 6, 2014 I first learned of the city of Novobirsk from the original XCOM. Link to comment Share on other sites More sharing options...
Amineri Posted May 6, 2014 Author Share Posted May 6, 2014 To help with debugging city coordinates, I found a developer console command :\DrawEarthCoords <float> <float> This draw an icon on the geoscape hologlobe at the designated <x,y> coordinates, which are defined in the [0.0, 1.0] system defined above. Link to comment Share on other sites More sharing options...
wghost81 Posted May 7, 2014 Share Posted May 7, 2014 (edited) Chelyabinsk is cool because of Chelyabinsk meteorite (some people think it was UFO :smile: ) and because it's a part of one of the most known Russian meme about Chelyabinsk people being the harshest people on Earth. :smile: For the sake of geographical distinctiveness you may consider to add more northern/eastern cities, like Norilsk. And if you want more cool places, you may consider Podkamennaya Tunguska. It's a rural area, not a city, but it is also well known worldwide because of Tunguska event (even more people still believe it was UFO :smile: ). PS NovobirskNovosibirsk Edited May 7, 2014 by wghost81 Link to comment Share on other sites More sharing options...
JZTess Posted May 22, 2014 Share Posted May 22, 2014 (edited) For the US some good options to pick from (mainly for geographic diversity) PhiladelphiaBostonDetroitCincinnatiIndianapolisMinneapolisAlbuquerqueHonoluluAnchorageSt. LouisAtlantaCharlotteNashvilleNew OrleansHoustonSan AntonioDenverSalt Lake CityLas VegasSeattle And For Canada (mostly covering the major cities, which just happen to be spread out geographically) HalifaxQuebecThunder BayReginaVictoriaWinnipegSaskatoon In Russia In the south:RostovVolgogradAstrakhanIn the far north:MurmanskArkhangelskKinda covering a large gap in SiberiaIrkutskYaktusk I can compile lists for the other countries if needed and/or I can test new additions Edited May 22, 2014 by JZTess Link to comment Share on other sites More sharing options...
Recommended Posts