Known global variables

From sc2k-reverse
Jump to navigationJump to search
1195
1195
SimCopter One reporting heavy traffic!
This page or section is under significant construction. It may be a large repository of data that's constantly being updated, or there may be a large rework in progress. There is a good chance the contents of this page will have dramatically changed next time you look at it.
Please check the history before making any edits to ensure any changes you make won't conflict with anyone else's.


This is a table of global variables in SimCity 2000 that have been at least partially reverse engineered and given names. It is probably going to be unpleasant to update, but at least it looks nice and you can sort it.

Data about where in the MISC chunk certain variables are located is from dfloer's sc2k-docs repository on GitHub (CC BY-SA 4.0).

Uncategorized variables
Address Type Name MISC offset Notes
0x4C702C CWnd* pCWndRootWindow Pointer to the MFC CWnd class for the "root window"
0x4C7104 BOOL bPriscillaActivated Whether or not the debug menu has been activated
0x4C71F0 BOOL bOptionsMusicEnabled 0x0FFC Whether or not music is enabled
0x4C71F4 BOOL bSoundEffectsEnabled Whether or not sound effects are enabled
0x4C7318 WORD wSimulationSpeed 0x0FEC 1-5 for Paused through African Swallow
0x4C7A9C DWORD dwSystemMetricCYHSCROLL Cached result from GetSystemMetrics(SM_CYHSCROLL)
0x4C7AC8 DWORD dwSystemMetricCYVSCROLL Cached result from GetSystemMetrics(SM_CYVSCROLL)
0x4C7ACC DWORD dwSystemMetricCXVSCROLL Cached result from GetSystemMetrics(SM_CXVSCROLL)
0x4C7AD4 DWORD dwSystemMetricCXHSCROLL Cached result from GetSystemMetrics(SM_CXHSCROLL)
0x4C85A0 DWORD dwTotalBusRiders Sum of all trips that entered the Bus Network
0x4C85A4 DWORD dwTotalTrainRiders Sum of all trips that entered the Train Network
0x4C8600 DWORD dwTotalSubwayRiders Sum of all trips that entered the Subway Network
0x4C93AC WORD wTotalGeneratedWaterTiles Total number of generated watered tiles from water sources
0x4C93B0 WORD wTotalGeneratedPowerTiles Total number of generated powered tiles from power plants
0x4C93B4 WORD wXVALTiles_TotalCount Total count of XVAL masked tiles, needed for Average Land Value.
0x4C9428 WORD wIndustrialMixPollutionBonus -1 to 2 used to calculate the map wide Pollution Divisor
0x4C942C WORD wViewRotation 0x0008 0 = north, 1 = west, 2 = south, 3 = east
0x4C94C4 DWORD dwArcologyPopulation 0x1020 Population of the city specifically in arcologies
0x4C9EE8 DWORD dwDisasterActive Set to 1 when disaster is active, overrides usual status bar messages.
0x4C9EF0 WORD[50] wArrBondData 0x0610 Array of Interest rates for each outstanding bond.
0x4CA1A0 char* pszCityName Pointer to the city name, loaded/saved as the CNAM chunk
0x4CA1BC WORD wNationalEconomyTrend 0x005C A growth modifier for the SimNation economic model that only affects interest rates. (0="Bull Market",1="Steady",2="Recession",3="Depression")
0x4CA1E8 WORD wIndustrialMixBonus This is used in RCI demand generation as a bonus (cities dominated by 1 industry receive growth bonuses)
0x4CA1DC WORD wPrisonBonus This sets if power stations get increased Police power from Prisons.
0x4CA1EC WORD wCurrentMapToolGroup Currently selected mapping tool group
0x4CA3F0 WORD wCityNeighborConnections1500 Count of all $1500 (industrial) neighbor connections (railroad, highways)
0x4CA400 DWORD dwInterestRateSum The combined Total Sum of all the interest rates of outstanding bonds
0x4CA41C WORD wSubwayXUNDCount 0x0FE8 Seems to be mostly used for budget calculations
0x4CA420 WORD wSetTriggerDisasterType 0x0070 The ID of the next disaster to occur
0x4CA42C WORD wCityMode 0x0004 0 = map editor, 1 = regular gameplay, 2 = scenario mode
0x4CA440 int dwCityLandValue 0x0028 Sum of all values in XVAL
0x4CA444 int dwCityFunds 0x0014 How much money the city has
0x4CA4C8 WORD* dwTileCount Pointer to an array of tile counts for every valid iTileID
0x4CA4CC DWORD dwNewPopulations New Populations that moved into the city's zones from last count (new immigrants).
0x4CA4D0 DWORD dwCityValue 0x0024 Appears to have something to do with bond interest rates
0x4CA5D8 BOOL bAutoGoToFlag Auto-Go To Flag
0x4CA5F0 WORD wCityGarbage 0x0040 Entirely unused. Initialized to 0 when the city is founded, goes up by dwCityPopulation on the 22nd of every month
0x4CA5F4 WORD wCityStartYear 0x000C The year the city was founded
0x4CA5F8 DWORD dwCityUnemployment (Population in "Abandoned buildings" x 100) / (Population in "Abandoned buildings" + TotalPopulation + 1)
0x4CA804 DWORD[3] dwNeighborGNP the GNP of the Neighboring city
0x4CA81C WORD wMonsterXTHGIndex Which XTHG entry the monster's Thing is
0x4CA928 DWORD dwNationalPopulation 0x0050 Population of SimNation
0x4CA92C DWORD[3] dwNeighborFame Completely unused and always 0.
0x4CA934 WORD* dwMilitaryTiles Pointer to the beginning of the military tiles in the dwTileCount array
0x4CA938 WORD wNationalFedRate 0x0058 The national base tax rate or the "fed rate", for calculating bond interest rates
0x4CA93C WORD wCurrentDisasterType The Disaster ID for the current/ongoing disaster.
0x4CAA40 DWORD dwCityOrdinances 0x0FA0 Flags for which city ordinances are enacted
0x4CAA50 DWORD dwPowerUsedPercentage Percentage of power capacity in use
0x4CAA74 DWORD dwCityPopulation 0x102C Total city population, excluding arcologies
0x4CAD10 DWORD[3] dwNeighborPopulation the Population of the Neighboring city
0x4CAD28 DWORD dwCityFame 0x0038 Completely unused
0x4CAD2C BOOL bYearEndFlag 0x0E3C Whether or not the first of the month is the start of a new year
0x4CAD44 BOOL bInScenario Whether or not this game is a scenario
0x4CAD58 neighbor_city_t[4] stNeighborCities 0x06D8 Array of four strings for the actual neighbor city's names (32 bytes each), clockwise from bottom left. Doesn't last beyond current game session.
0x4CADE0 BYTE bWeatherHeat 0x0060 Weather heat level (Temperature in Fahrenheit = [WeatherHeat - 100] as seen in newspapers)
0x4CAE04 DWORD dwCityDays 0x0010 How many days have elapsed since the city was founded
0x4CAE0C BYTE bWeatherWind 0x0064 Weather wind speed (miles per hour as seen in newspapers)
0x4CB010 WORD wCityProgression 0x0078 Flags for city reward progression
0x4CB014 DWORD dwNationalValue 0x0054 Gross National Product
0x4CB018 DWORD dwCityAdvertising 0x003C Completely unused
0x4CB01C WORD wCityCurrentMonth Which month of the year it is (0-indexed; calculated from dwCityDays)
0x4CB020 WORD wCityElapsedYears Years since the city was founded (calculated from dwCityDays)
0x4CB1A8 DWORD dwNewLocalBirthPops Seems to actually be local city newbirths in the city as opposed to new pops from immigration.
0x4CB1B8 void* pArrSpriteHeaders Pointer to the array of loaded sprite headers
0x4CB3D0 BOOL bNewspaperSubscription 0x1004 Whether or not the Subscription newspaper is checked
0x4CB3D4 BYTE bWeatherRain 0x0068 Weather humidity value (Rain in mm as seen in newspaper)
0x4CB3DC WORD wSewerBonus Whether the city has adequate wastewater treatment facilities for use in the Pollution Divisor
0x4CB3E8 WORD wCityCurrentSeason Which season it is (0 = winter, 1 = spring, 2 = summer, 3 = autumn; calculated from dwCityDays)
0x4CB38C microsim_t* dwMicroSimArr Pointer to the array of microsims
0x4CB404 WORD wCityDifficulty 0x001C Game difficulty (0 = no city founded, 1 = easy, 2 = medium, 3 = hard)
0x4CB40C BYTE bWeatherTrend 0x006C What the current weather type is
0x4CB410 DWORD bWorkforceLE Workforce Life Expectancy
0x4CB430 WORD[17] wCityInventionYears 0x0738 What years different technologies are invented in (see: Inventions)
0x4CB454 DWORD dwCityCrime 0x002C Sum of all values in XCRM
0x4CB458 WORD wCityCenterXCoord The X location of where the Simulator deems to be the "city center"
0x4CB45C WORD wCityCenterYCoord The Y location of where the Simulator deems to be the "city center"
0x4CB460 DWORD dwWorkforcePercent Workforce Percent
0x4CB464 WORD wCurrentCityToolGroup Currently selected city tool group
0x4CC4B0 BOOL bAutoBudgetFlag When set to 1, the budget window will not pop up in January nor will there be a Fiscal Warning given for negative CityFunds.
0x4CC4B4 DWORD dwWorkforceEQ Workforce Educational Quotient
0x4CC4B8 DWORD dwWaterUsedPercentage Percentage of water capacity in use
0x4CC4BC BOOL bNewspaperExtra 0x1008 Whether or not the Extra!!! newspaper is checked
0x4CC4CC void* dwBudgetArr Pointer to the budget array (needs some reverse engineering and/or documentation work)
0x4CC4D4 BOOL bNoDisasters 0x1000 Whether or not disasters should be disabled (also disables city council autonomy)
0x4CC4D8 WORD wCityNeighborConnections1000 Count of all $1000 (commercial) neighbor connections (roads)
0x4CC4DC WORD[3] wNeighborStringNameID A string lookup ID for the neighbor city's name, the appropriate string is loaded whenever map is loaded. There are 36 city names.
0x4CC4E0 WORD wStadiumSportsTypes Flags for the currently available "Sports types" (+1 Football, +2 baseball, +4 Soccer, +8 Cricket, +16 Rugby)
0x4CC4E4 BYTE bMilitaryBaseType 0x0EF4 Military base type (0 = not offered yet, 1 = declined/no location, 2 = army, 3 = air force, 4 = navy, 5 = missile silos)
0x4CC4E8 DWORD dwCityBonds 0x0018 Total number of current outstanding city bonds
0x4CC8F8 WORD wCityResidentialDemand 0x0718 Residential demand (-2000 to +2000)
0x4CC8FA WORD wCityCommericalDemand 0x071C Commercial demand (-2000 to +2000)
0x4CC8FC WORD wCityIndustrialDemand 0x0720 Industrial demand (-2000 to +2000)
0x4CC910 DWORD dwCityPollution Sum of all Pollution in city.
0x4CC918 WORD wScenarioDisasterID ID of the disaster set for the given scenario.
0x4CC91A BYTE bScenarioDisasterX X coordinate for preparing the disaster.
0x4CC91B BYTE bScenarioDisasterY Y coordinate for preparing the disaster.
0x4CC91C BYTE wScenarioTimeLimitMonths Time limit of the scenario in months.
0x4CC91E DWORD dwScenarioCitySize Target total population for the scenario exceeded.
0x4CC922 DWORD dwScenarioResPopulation Target Residential population for the scenario.
0x4CC926 DWORD dwScenarioComPopulation Target Commericial population for the scenario.
0x4CC92A DWORD dwScenarioIndPopulation Target Industrial population for the scenario.
0x4CC92E DWORD dwScenarioCashGoal Cash goal target for the scenario.
0x4CC932 DWORD dwScenarioLandValueGoal Land Value goal target for the scenario.
0x4CC936 WORD wScenarioLEGoal Workforce LE goal target for the scenario.
0x4CC938 WORD wScenarioEQGoal Workforce EQ goal target for the scenario.
0x4CC93A WORD wScenarioPollutionLimit Pollution limit for the scenario.
0x4CC93E WORD wScenarioCrimeLimit Crime limit for the scenario.
0x4CC942 WORD wScenarioTrafficLimit Traffic limit for the scenario.
0x4CC946 BYTE bScenarioBuildingGoal1 Scenario building goal one.
0x4CC947 BYTE bScenarioBuildingGoal2 Scenario building goal two.
0x4CC948 WORD wScenarioBuildingGoal1Count Scenario building goal one count.
0x4CC94A WORD wScenarioBuildingGoal2Count Scenario building goal two count.
0x4CC950 WORD wSelectedSubtoolBulldozer (*** See below) Selected Bulldozer mode (Demolish/Clear, Level Terrain, Raise Terrain, Lower Terrain, De-zone) **
0x4CC952 WORD wSelectedSubtoolNature Selected Nature mode (trees, water) (forests and stream are available in map-editing mode) **
0x4CC954 WORD wSelectedSubtoolDispatch Selected Dispatch mode (Police, Fire, Military (if facilities for the first two aren't present)) **
0x4CC956 WORD wSelectedSubtoolPower Selected Power mode (Power Lines, Power Plant) **
0x4CC958 WORD wSelectedSubtoolWater Selected Water mode (Pipes, Water Pump, Water Tower, Treatment, Desalinization) **
0x4CC95A WORD wSelectedSubtoolRewards Selected Rewards mode (Mayor's Hour, City Hall, Statue, Military Base, Braun Llama Dome, Arcologies) **
0x4CC95C WORD wSelectedSubtoolRoads Selected Roads mode (Road, Highway, Tunnel, Onramp, Bus Depot) **
0x4CC95E WORD wSelectedSubtoolRail Selected Rail mode (Rail, Subway. Rail Depot, Sub Station, Sub<-->Rail) **
0x4CC960 WORD wSelectedSubtoolPorts Selected Ports mode (Seaport, Airport) **
0x4CC962 WORD wSelectedSubtoolResidential Selected Residential mode (Light, Dense) **
0x4CC964 WORD wSelectedSubtoolCommercial Selected Commercial mode (Light, Dense) **
0x4CC966 WORD wSelectedSubtoolIndustrial Selected Industrial mode (Light, Dense) **
0x4CC968 WORD wSelectedSubtoolEducation Selected Education mode (School, College, Library, Museum) **
0x4CC96A WORD wSelectedSubtoolServices Selected Services mode (Police, Fire Station, Hospital, Prison) **
0x4CC96C WORD wSelectedSubtoolParks Selected Parks mode (Small Park, Big Park, Zoo, Stadium, Marina) **
0x4CDB68 WORD wHighlightedTileX1 The X1 coordinate of the tile area currently highlighted on the map
0x4CDB6C WORD wHighlightedTileX2 The X2 coordinate of the tile area currently highlighted on the map
0x4CDB70 WORD wHighlightedTileY1 The Y1 coordinate of the tile area currently highlighted on the map
0x4CDB74 WORD wHighlightedTileY2 The Y2 coordinate of the tile area currently highlighted on the map
0x4CDB7C DWORD dwLFSRState Randomness state for the linear feedback shift register PRNG
0x4CDB80 DWORD dwLCGState Randomness state for the linear congruential generator PRNG
0x4CE8C0 AFX_CORE_STATE pCWinApp Pointer to a CWinApp (needs reverse engineering -- maybe IDA picked this one out on its own?)
0x4E6520 DWORD dwCheatsHandlingBuffer current lookup ID for current cheat being possibly entered, and then a return value once completed?
0x4E6524 DWORD dwCheatsHandlingBufferLength current string length for the current possibly valid cheat attempting to be entered
0x4E99C0 WORD wPassengerPlanes A total count of Passenger Plane things
0x4E99C4 WORD wActiveHelicopters A total count of Helicopter things
0x4E99C8 WORD wActiveCargoships A total count of Cargo Ship things
0x4E99CC WORD wMaxisMan A total count of MaxisMan things.
0x4E99D0 WORD wSailingBoats A total count of Sailing boats from Marinas.
0x4E99D4 WORD wMonster If there is an active monster, it's set to 1.
0x4E99D8 WORD wActiveTrains A total count of Train things (train entities, not 'tiles' of train)
0x4E99DC WORD wTornados_XTHGs Active Tornado XTHGs
0x4E99E0 DWORD dwHelicopterThing A 'thing' for Helicopter thing (will return to this one day)
0x4EA7F0 WORD wTileHighlightActive Tile highlight active state: 0 - inactive, 1 - active
** The choices for each SelectedSubtool are for reference purposes only, they may not reflect the actual internal order.

*** wSelectedSubtoolBulldozer - Address 0x4CC94C (WORD array - 18 entries) - unique case to override without changing the currently selected tool.
Terrain generation variables
Address Type Name MISC offset Notes
0x4C94C0 BOOL bCityHasOcean 0x0E44 Whether or not the city was generated with an ocean, also determines if City is eligible for Naval Base.
0x4CA1E0 WORD wCityTerrainSliderHills Slider value for hill coverage during terrain generation
0x4CA818 __int16 wWaterLevel 0x0E40 Water table level
0x4CAAF8 WORD wCityTerrainSliderWater Slider vvalue for water coverage during terrain generation
0x4CADD8 WORD wCityTerrainSliderTrees Slider value for tree coverage during terrain generation
0x4CB3F8 BOOL bCityHasRiver 0x0E48 Whether or not the city was generated with a river


Map data pointers
Address Type Name MISC offset Notes
0x4C9430 void* dwMapXPLC Pointer to a 32x32 "minimap" for police coverage (1 byte per 4x4 block)
0x4C9F58 void* dwMapXTER Pointer to a 128x128 map of terrain data (1 byte of type map_XTER_t per tile)
0x4CA1F0 void* dwMapXZON Pointer to a 128x128 map of zone and corner info (1 byte of type map_XZON_t per tile)
0x4CB3EC void* dwMapXMIC Pointer to an array of type map_XMIC_t[150] containing MicroSim data.
0x4CA198 void* dwMapXLAB Pointer to an array of type map_XLAB_t[256].
0x4CA434 void* dwMapXTHG Pointer to an array of type map_XTHG_t[256] containing Things
0x4CA448 void* dwMapXPOP Pointer to a 32x32 "minimap" for population density (1 byte per 4x4 block)
0x4CA4D8 void* dwMapXCRM Pointer to a 64x64 "minimap" for crime (1 byte per 2x2 block)
0x4CA600 void* dwMapXTXT Pointer to a 128x128 map of XTXT IDs (1 byte per tile)
0x4CA828 void* dwMapXPLT Pointer to a 64x64 "minimap" for pollution (1 byte per 2x2 block)
0x4CA940 void* dwMapXTRF Pointer to a 64x64 "minimap" for traffic (1 byte per 2x2 block)
0x4CAA78 void* dwMapXFIR Pointer to a 32x32 "minimap" for fire coverage (1 byte per 4x4 block)
0x4CAB10 void* dwMapXBIT Pointer to a 128x128 map of tile flags (1 byte of type map_XBIT_t per tile)
0x4CAE10 void* dwMapALTM Pointer to a 128x128 map of altitude data (1 byte of type map_ALTM_t per tile)
0x4CB028 void* dwMapXROG Pointer to a 32x32 "minimap" of rate of growth data (1 byte of unknown type per 4x4 block)
0x4CB0A8 void* dwMapXVAL Pointer to a 64x64 "minimap" of land value (1 byte of (full value / 1000 - 1) per 2x2 block)
0x4CB1D0 void* dwMapXUND Pointer to a 128x128 map of underground map data (1 byte of type map_XUND_t per tile)
0x4CC470 void* dwMapXGRP Pointer to the historical graph data
0x4CC4F0 void* dwMapXBLD Pointer to a 128x128 map of tile IDs (1 byte of type enumTileID per tile)
0x4CC6F4 void* dwMapTempValMap1 Pointer to a 32x32 "minimap" of 4x4 parcels needed for land value calculation (pollution?).
0x4CC6F8 void* dwNaturalBeauty_ResCom Pointer to a 32x32 "minimap" of 4x4 parcels needed for land value calculation (this includes surface water, water supply, terrain slopes, parks).
0x4CC6FC void* dwMapTempValMap2 Pointer to a 32x32 "minimap" of 4x4 parcels needed for land value calculation (pollution?).
0x4CC778 void* dwNaturalBeauty_Industrial Pointer to a 32x32 "minimap" of 4x4 parcels needed for land value calculation (this includes surface water, water supply).
Simulation Arrays
Address Type Name MISC offset Notes
004C94B4 void* pRawPopTable Pointer to 20-item array for the Population Table
0x4CAA70 void* pLETable Pointer to 20-item array for the LE Table, these are as aggregate sums for the entire age group (LE/RawPop=AgeGroupLE).
0x4C94BC void* pEQTable Pointer to 20-item array for the EQ Table, these are as aggregate sums for the entire age group (EQ/RawPop=AgeGroupEQ).
0x4CB3F0 void* pIndividualIndPops Pointer to 11-item array for the Raw Populations for City Industries Table.
0x4CB3E0 void* pIndividualIndTaxRate Pointer to 11-item array for the each of the Industrial Group's Tax Rates.
0x4CA3F4 void* pIndividualIndDemands Pointer to 11-item array for the each of the Industrial Group's current Demand.
0x4CA428 void* pZonePops Pointer to 8-item array of Zone Populations (/10): AllTotalPops, Light Res, Dense Res, Light Com, Dense Com, Light Ind, Dense Ind, Abandoned.
0x4CA930 void* zonePopsBase Pointer to 3-item array of Zone (light+dense combined) Populations (/10): Residential, Commercial, Industrial
0x4CAD10 void* pNeighborData Pointer to Neighbor Populations