Jump to content
Sign In to follow this  
Karybdis

DISCOVERY: File Formats, The Savegame Formats (Terrain,Trees, etc.)

37 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

This thread is for the discussion of the various Savegame formats found in SC4's savegame files. There's over a hundred as far as I know which all store different data. We've found quite a few of those already but we're nowhere near done yet.

Here's a quick list of all the ones with no spec as of yet, followed by ones with a spec of sorts and a quick description of them.

Savegame, Taxes (e990be01, e990bffc, aa313c9f)

Savegame, Requirements (0a413481)

Savegame, Mysim (4a1dbbbf)

Savegame, Advisor (4a3ad3e1, 6a5f8755, aa5292d7, ca2c2a2f, ea19e825, eac937b4, 2a5f877d)

Savegame, Ordinance (c2bf1dc5, c2bf1e04, c2f6e81f, e0d0722e, e0d07233, 00d0723d, 02bf1dfa, 22f6e80c, 22f6e81b, 40d07236, 42bf1e18, 62bf1daa, 62bf1db9, 62f6e7cf, 815b4cef, 82b9999b, a0d07129, a2bf1ddc, a2bf1de5, a2bf1e43)

Savegame, Temp PNG (2026960b)

Savegame, Wildlife Generator (4a1628c5)

Savegame, Advice (AA371C32, 6A3848DB, 8A09F5F4, 6A9335DE)

Savegame, Deals (2B689130)

Savegame, Automata (4A5B69ED, 896E714A, AA9F4A3D, 4A222B98, 4A416254 )

Savegame, Situation Manager (4be372cd)

Savegame, Lot Retaining Walls (49c05c9f)

Savegame, Props (49c05c8f)

Savegame, My Street Sim (0bf606a5)

------------------------------------------

Files we've decoded or changed part of

------------------------------------------

Savegame, Terrain Map (A9DD6FF4)

There are actually 5 terrain maps of this type. The first and main one is the global terrain map, mapping the height of each vertice of the map with a float value. The other 4 also use float values, but we suspect they're more for neighbour connections reconciliation purposes since they're oddly shaped maps with only data on one of the sides. Its format is just a WORD of 0200 followed by 32 bit floats of all the corner values.

--

Savegame, Terrain Arrays (2990c1bc)

An Oddball format, the terrain arrays are a series of 4 maps that the game appears to use to store data with a single byte per block. The first map appears to contain the previous terrain of the city (before a save), the second appears to be blank in unfounded maps, the third appears to be some kind of map of the current terrain, and the fourth is some kind of jumbled ascii. Since they have a single byte per block, its possible to view them in notepad if you wish, and as such there's no real spec as of yet.

--

Savegame, Mayor View City Data (8990c372)

The Mayor view data contains things you see when you're inside your city, namely the name of the city, mayor etc. It also contains other data though we can not read it as of yet.

--

Savegame, Region View City Data (ca027edb)

Basically a copy of the above for Regions, it contains the data for the view of the city from region mode, probably containing job and pop data as well as the usual mayor and city name.

--

Savegame, Seperator (ea3ff4f5)

A four byte file that seems to seperate the PNG section of the DAT from the data section of the dat. It has an unknown compression type, but compressing 4 bytes would be stupid, so we'll assume its not compressed.

--

Savegame, Trees (a9c05c85)

A data file containing all the trees and their locations within the current city. The spec for this file is not complete but thanks to redlotus a significant amount is already known. Since this is the only file with a real spec so far for savegames, I'll just include redlotus' here instead of as a zip

--------------------------------------------------------

4E 00 00 00 -- This is always the same for every tree clump.

09 9D 18 34 -- Unknown. It is possible that it is part of the next set.

94 F0 40 01 -- It would be easier to think of this in reverse -- 01 40 F0 94. In this arrangement, the last two bytes increment by 5C (or a multiple of 5C) down the list. Once the last 2 bytes are filled, the next pair (01 40) increments, but not by a consistent amount. The last byte-pair then starts back to incrementing by a multiple of 5C. I have to assume that this is the identifier for each line.

03 00 04 00 00 00 00 0D 26 89 75 74 -- This is always the same in every tree clump.

40 40 40 40 -- Seems to be two, two-byte pairs. I cannot seem to nail down a pattern for this set. This is a possibility for one of the coordinates, but not likely.

37 04 3E E8 -- GID of the tree clump exemplar

4A 28 34 65 -- TID of the tree clump exemplar

14 82 0C 2A -- Listed twice. IID of the tree clump exemplar

8B 8A 1E 41 02 EE 8D 43 98 EC 5C 41 -- Unknown. This seems to be the most likely group to contain the coordinates.

5A 68 25 00 -- Listed twice. I believe that this set contains the time that the tree clump was planted. I think that they never varied in my first test because I was planting them with the simulator paused.

00 01 -- Unknown. This may be part of the set above (date planted).

00 00 00 00 -- Unknown. This set almost always looks like this. There are only a very few exceptions.

----------------------------------------

end spec

And That's about it as they say, this concludes the final of the four DISCOVERY threads that will cover all the filetypes in the game from now on editor Happy modding all.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 
It's been a long time since we've taken a good look at the savegame files, so I decided to do a little snooping around today.  First, after looking at Kary's list, I decided to update the file list that I had sitting around since before the release of RH.  The attached file is an Excel spreadsheet of all the files that I have, along with whatever descriptions I was able to come up with.  Since this list started pre-RH, there may be files that are no longer included in the savegames.  I was also able to test a few files by deleting them in a copy of a save game and checking the results.  The results are included in the file.
 
The only other thing that I want to add regards the first DWORD in each of the files.  For a large percentage of them, this DWORD represents one of two things:
1.  Entry Length (In Bytes).  This is for 'line-item' files like the Trees file.  The basic format of these files is DWORD (Length), Data, DWORD (Length), Data... and so on and so forth.  The game does not seem to keep a running total of the number of entries in each of these files.
2.  Lenght of File (In bytes).  Basically, this is the same thing, except that the file is made up of one entry only.  I have noticed that most of the Advisor files follow this, with the Fluffy News Advisor being the only exception.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

----------------

On 12/4/2003 1:57:14 AM Karybdis wrote:

--

Savegame, Region View City Data (ca027edb)

Basically a copy of the above for Regions, it contains the data for the view of the city from region mode, probably containing job and pop data as well as the usual mayor and city name.

Seems that this is the only file needed [along with the DIR] in order to actually be able to Import and load a city. With just this file, one can Import a city and load a city [everything is blank though]. So perhaps this file holds more than just Regional data.....not much to go on I know, but what the heck.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

Wen will it be posible to find out wat has caused a savegame to get corrupted...I still got a city i cant load 8.gif

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 
I believe that is due to plugins that were removed, right?  The game looks for something but it's not there?
I think that's also the issue with the decreasing budget thing.  23.gif

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Decius: Maybe a year or two? Really I dont know, but a long time. And that's assuming we're ever able to do it at all.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Since there seems to be a serious lack of interest or just lack of posting any known information on the savegame files, I'll give one a shot.

    File in the savegame with TID of 0x0990c005 is related to the power simulator.

    I havn't studied it a lot yet, but in cities with power plants there are numbers at the beginning with power capacity and usage (some repeated several times for some reason). I have not looked at various combinations of power neighbor deals yet.



    Following the beginning section of the file are dwords with a width and height of the current map. An array of integer values follows, mapping out power consumption tile by tile. In my small test city adding up each interger on the bitmap totaled the cities power consumption since there were no deals being made. This is the easiest way for the power simulator to track power usage in a city and where the power is being used at. There is also another section at the bottom of the file which seems to be another array which may map out power lines/powered areas of the map.



    I will try and post a more detailed spec once I try other cases and try and figure out the rest of the file.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    thanks sawtooth. looking forward to any more info you can find on it. 1.gif
     
    There's not really a lack of wanting of information. Its just that I'm taking a short break since I got simcity'd out, redlotus is working on effect dirs, and there's a group of guys making a city exchange, who are doing their web programming for it and arent at the city decoding stage yet.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online: A long, long time ago... 
     
    they got bandwidth to burn eh? I would host a little something like that, but the key is little, if it got big, it would be a blaze, n I dont have that kind of money to throw around.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    not bad at all 1.gif

    Nice to see everyones doing work again on the formats after so long hehehe 1.gif

    Thanks for the info as always. *adds to list and archives for later use*

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Ok, well here is an updated list of saved game files [it's a MS ACCESS file] for those of you/us still interested bothered with this. I've made quite a few changes, since a few items needed changing, but I've also added some additional items that weren't previously listed. It's still being changed here and there. It's by no means comprehensive, but byte by byte <ahttps://community.simtropolis.com/assets/emoticons/3.gif> it'll be done <ahttps://community.simtropolis.com/assets/emoticons/24.gif><ahttps://community.simtropolis.com/assets/emoticons/21.gif>
     
    Anything missing, anything that needs adding etc, please be sure to post it thanks [or PM].
     
    oh, and my previous post above had been edit,as I had forgotten a byte bit, 8 of them actually <ahttps://community.simtropolis.com/assets/emoticons/21.gif>
     

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Ok well, here's some stuff I've been working on [attached files]. It's not 100% complete, and it could probably do with some looking at by someone else besides myself, but it's there for the taking if anyone wants to take a look at it. There's quite a bit there hence why I've attached it all in a file.
    Any pointers and/or tips etc, if anyone has any, would be great<ahttps://community.simtropolis.com/assets/emoticons/9.gif> as I'm still learning some stuff here and there.............ok, time to take a break 25.gif<ahttps://community.simtropolis.com/assets/emoticons/26.gif><ahttps://community.simtropolis.com/assets/emoticons/22.gif>

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    wooohoo........I have finally found something I'd been looking for, for awhile35.gif35.gif
     
    TGI: 89EFA536, 299B2D1B, 00000000
    Data -Historical City data. [EDITED: since it seems graph type data is not the only thing found in this file. More on this later]. 
     
    This, is the file that contains most [if not all perhaps/] historical [& current] data on a city, for various number of things. 6.gif19.gif
    I have only just scratched the surface with this file, but with some cities it can contain quite a lot. I have managed to get a rough idea of the layout of the file. I'll see what info/specs I can gather on this file [in due time, if I'm able to], but if anyone else would like to take a look at it [too], that'd certainly be great 9.gif.
     
    I am not sure if it contains data for the Dataview maps [i doubt it], as I've not yet really ascertained the full scope of the file.
     
    *does the jig* 39.gif35.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    City Data file: 89EFA536 [Type ID]

    Contains historic/Current data for for various things.

    Specs: The below is just a rough outline of the file. Some bits/bytes may be a little off, therefore it's by no means a final format.

    Dword - File lenght.
    14 Bytes - Unknown
    [start Block]
    Dword - Data Source ID. These are mostly found in the [Graph/Trend] Exemplars. However, I have come across some other [unknown] ones that exist in the file that are not found anywhere [else] in other files [such as LUA/Exemplar/Cohort/etc].
    Dword- unknown
    Dword - unknown
    3 bytes - Date/Timing I know for fact this has to do with the date/timing, but I am having a bit of trouble deciphering the last 2 bytes of it.
    Dword - Data. This is the actual data, for the given data source ID - woohooo bingo@@. The depth of this data though can vary depending on some things it seems. For example, Funds: because it is displayed in the Graph like it is, has the last 3 values truncated [from which its Hex value is then calculated]. Not all data does this though it seems [this may actually be tied in with something else].
    [end Block]
    and repeat the Block for any subsequent data &/or [different] blocks of data.

     

    Attached is a [very long] list of [currently known] Data Source IDs, and their purpose or what they represent in the game. Also included, is a list of possible data source IDs that are unknown [i.e. not to be found anywhere else]. There may also be others apart from these that exist, but these [both known/unknown] are just ones I've come across so far.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    Ok, well I've been wanting to update this for awhile now [like so many things on my to do list 5.gif43.gif].
     
    89EFA536 (299B2D1B 00000000)
    City Historical Data file [a save game file]:
    Specs
    File contains historic & current data for a wide range of things.
    These specs are much more complete, with only part of the header and a single Dword unknown.
    ----------------------------------------------------------------------------------
    [File Header]
    Dword - File lenght.
    14 Bytes - Unknown
    [End of File Header]
    ------------------
    [Repeating chunks]
    [Start DataSourceID Header]
    Dword - Data Source ID. These are mostly found in the [Graph/Trend] Exemplars. There are other ones that exist though [there's an attached [file] list of IDs to this post].
    Dword- unknown -Possibly Data Type?? [i am not sure about this one though, as I have already seen one instance where this isn't true]
    Dword = the number of Timing & Data sections below. It's the number of Qwords that follow from here [for the given DataSourceID].
    [End of DataSourceID Header]
    ----
    [Start of Timing & Data sections for a given DataSourceID]
    Dword - Date/Timing - More on this further below.
    Dword - Data. This is the actual data, for the given Date/Timing for the given Data Source ID. More on this below
    [End of Timing & Data section-Repeat this section; See the number of Timing & Data sections Dword value above for the number of repeated sections here]
    ------------------
    Repeat 'Repeating Chunk' for Every DataSourceID ID Value [see attached file for a current list of known/unknown IDs].
    ----------------------------------------------------------------------------------

    NOTES:
    Date/Timing & Data:
    For a given DataSourceID, the very last DWORD is the Data for the Current Date/Timing. Or in other words; It is the most upto date DATA for the given Data Source ID. Also; The [decimal] difference between any two Dates might seem to be what is actually used for Plotting the points/bars on the Graphs; this is where/how the Historical Data seems to come from/works. There is some consistency from one date to the next, but some date differences seem rather different from others [i.e. 48 from one date to the next; as opposed to 31 from one date to the next]. Also; as a city progresses, & the Timing/Date increases, the [decimal] difference from one date to the next does change [it increases].
    Just with the actual Data itself, just be aware of negatives [like Negative demand for example]. Also; the deepth of detail for the actual Data will vary from one given DataSourceID to the next, as other factors have a bearing on the detail involved [such as the Exemplars; namely the Graph Data value adjuster [0x6A4AEEE2] Property for example].
     
    So, if someone were to write a little application to handle the data in this file, making use of just any single DataSourceID [preferably the first one I would think], and making use of the DWORD for the number of Timing & Data sections for the DataSourceID, it could be used to pick-up any/every DataSourceIDs that might be used in a file [not to mention the data itself9.gif], whether known or not [as a DataSourceID starts at the end of the previous DatasourceID's block, well except for the first one in the file anyhow].
     
    If any other clarification is needed for the above though, just let me know [& I'll see what I can do. I'm still yet to do part of the remaining Header section].
     
     
    EDIT: Seems like I can't attach a file at the moment for some reason. I'll update this later though.
    Attached is a [very long] list of [currently known] Data Source IDs, and their purpose or what they represent in the game. Also included, is a list of possible data source IDs that are unknown [i.e. not to be found anywhere else]. There may also be others apart from these that exist, but these [both known/unknown] are just ones I've come across so far.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    hhmm......ok, well looks like the old attach file function is back, for now at least anyhow. Anyway...
    The DataSourceID list I mentioned in my above post should be attached to this post. There is about 15 or so additional DataSourceID values added with this list, most of them unknown. I'm still keen on going through this ID list file a bit, and making the names something a lot more better/appropriate.
     
    As for the [remaining] single DWORD; I am just wondering if this is just some kind of flag of some sort. EDIT: It seems whenever there is anything in this dword, that it is the same as the Dword that follows;  [i've found that this isn't always the case-though this is with pre-incorporated cities End EDIT] but it's use is not the same as this is often zero. Though, it may have a use, it just may only be useful for the exe for some specific reason that I haven't been able to nail yet [i'm still thinking it may have something to do with the type of data, but I digress].

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Great work so far, and I'm working on a program that can at least read the values out of that section of the save game file.

    Do you have information on how to decode the dates used in it?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    The dates; specifically, well, it seems the starting Date is 59 68 25 00 [this is as it reads in the file] for any DataSourceID; and it goes from there [i can't remember if I've seen anything that doesn't conform to this].
    Anything that only keeps tabs on current data though [like Trend Bars for example] only have one/two Date/Timing sets, so their date hex values set-up will be different [containing only the most upto date date values].
    In general though; I'm not so sure whether or not the dates are of any particular format, & it may be a little difficult actually breaking it down [reason for this is there is a bit of a lack of consistency with some of the date differences]. I'm thinking the values used might just be a particular starting Hex point that Maxis used for whatever reason [for their programming purposes maybe?].
    So, to get an idea on the date format;
    For example; from one date set to the next, the difference may read 31. Now this is days [which is simly assumed since this is found near the current date/data in the file, and there is an average of 30.4 days in a month].
    Another example though; from one date set to the next, the difference may read 1. Now this may be one year, or one month, I don't know. Some others are like 181-which basically throws a bit of a spaner in the works really, makes things a lot harder to decipher.
    But as for the DWORD Date itself;
    59 68 25 00
    59 is basically what is usually changed the most;
    For example;
    59 68 25 00  + 365 [{decimal} days] would be C6 69 25 00. And so on. Basically, the whole Dword seems to be used for the date. It does not seem to actually be broken down anymore than this.
    I'll keep looking into it though, see if I can't decipher it anymore than I already have.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Attached is a python program to look at the graph data in the simcity 4 save game files.

    This version is not really meant for public use and is mainly a tool to help figure stuff out that exists in the file.

    Several programs are required to run this application as it is in source form and is not standalone.

    Programs required are:
    Python 2.3.4 http://www.python.org
    wxPython 2.5.1 http://www.wxpython.org
    Numarray http://www.pfdubois.com/numpy/

    Once these are installed and the sc4GraphView.py file is double clicked on the program should run. I hope. ;)

    The program in its current state is not very user friendly. There is currently no built in way to jump to a particular resource id, or index of any type. Just starting at one and using next thru the 143 or so sets of data in the graph file :)

    Graphing functionality is also limited at this point, no zooming or changing any settings on the graphs at present.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    For those that might be follow this;
    Attached is some updated files for sawtooth's SC4 Graph Viewer program. I have also included an updated DataSourceID Names list.
    Anyone who downloaded the inital release, these attached file should work [thanks to sawtooth for this].
    I have made some really really minor changes to the files [labels]; but I can not stress enough, how much that this is Sawtooth's program, not mine. Much thanks to him for making what we have so far.
    Same guidelines apply to the attached files as per Sawtooth's post above; it's not meant for public purposes etc etc etc [you need the mentioned programs installed. Read the README].

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Latest update to the City historical specification after a long discussion and brainstorming session with tropod last night....man I need sleep

    89EFA536 (299B2D1B 00000000)
    City Historical Data file [a save game file]:
    Specs
    File contains historic & current data for a wide range of things.
    This spec is complete with the execption of two Header DWORDS (see Info 2)
    ----------------------------------------------------------------------------------
    [File Header]
    Dword - File length.
    Dword - Unknown1
    Dword - Unknown2
    Word - Version of Data Sets (always 2)
    Dword - Number of DataSourceID Sets
    [End of File Header]
    ------------------
    [Repeating chunks]
    [start DataSourceID Header]
    Dword - Data Source ID. These are mostly found in the [Graph/Trend] Exemplars. There are other ones that exist though [there's an attached [file] list of IDs to this post].
    Dword- Graph Type Flag (See Table 1)
    Dword = the number of Timing & Data sections below. It's the number of Qwords that follow from here [for the given DataSourceID].
    [End of DataSourceID Header]
    ----
    [start of Timing & Data sections for a given DataSourceID]
    Dword - Date/Timing - Date that data is from (See Info 1)
    Dword - Data. This is the actual data, for the given Date/Timing for the given Data Source ID. More on this below
    [End of Timing & Data section-Repeat this section; See the number of Timing & Data sections Dword value above for the number of repeated sections here]
    ------------------
    Repeat 'Repeating Chunk' for Every DataSourceID ID Value [see tropod's file above for a current list of known/unknown IDs].
    ----------------------------------------------------------------------------------

    Info 1: Date/Timing

    Each Data/Timing starts from a base of 59 68 25 00 in hex, or 2451545 which translates to around ~6500 years. This is a buffer length and is how far displayed data can go before the beginning of the City, IE if there was a span of 5000 selectable, instead of the current 500 year span for graphs, this would be able to calculate a value of 0 for it. (Not sure why maxis went this way but oh well). Each integer of 1 over this number is 1 day. Dates with data may be for a day, month, or year depending on the type of graph.

    Table 1:

    Flag Type Data Timeframe Graph
    ---------------------------------------------
    00000000 Multiyear Data Per Year Line
    01000000 Single Current Day Single Value
    02000000 DoubleBar Last two Months Bar, IE demand etc. Only last value displayed
    0d160000 SingleYear Daily for year Line (I think only line, but not sure)

    Info 2:

    Unknown1 and Unknown2 appear to be some kind of Timstamp or other Marker, but change too rapidly to be a normal timestamp. They dont APPEAR to be locations, and I really cant see consistency in them

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    man.. if i could somehow integrate this into SC4LAN/ONLINE... wowzerz that would be cool.31.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    ***WARNING*** This post has been edited to fix two errors I made in two sections. The .txt file is still incorrect.

    Attached is a quick rundown of what I have from the Region View file so far. This will be updated with information on the Neighbor connection blocks when they are fully decoded.

    Here's the text of the file as well...

    ;Region View Data Structure
    ; TGI (0xCA027EDB, 0xCA027EE1, 0x00000000)
    WORD Version Major
    WORD Version Minor

    DWORD Tile X Location
    DWORD Tile Y Location
    DWORD City Size X
    DWORD City Size Y
    DWORD Residential Population
    DWORD Commercial Population
    DWORD Industrial Population
    DWORD Unknown1 ;I've seen zeros in these spots...
    DWORD Unknown2 ;might be unused population data
    DWORD Unknown3
    DWORD Unknown4
    DWORD Unknown5
    DWORD Unknown6
    DWORD Unknown7
    DWORD Unknown8 ;I think this was where early version files were different
    ;only had 3 bytes here instead of 4. This needs testing though.

    DWORD City Name Length
    PRIOR City Name ;string
    DWORD Unknown ;zeros
    DWORD Mayor Name Length
    PRIOR Mayor Name ;string
    DWORD Unknown ;zeros

    ;Seemingly unused Mayor Name next
    DWORD Unused Mayor Name Length
    PRIOR Unused Mayor Name
    DWORD Unknown

    ;More zeros
    DWORD Unknown
    DWORD Unknown
    DWORD Unknown
    DWORD Unknown
    DWORD Unknown ;Should be 0xFFFFFFFF

    ;Occupant group information. Three sets in all.

    DWORD Occupant Group 1 count
    LOOP
    DWORD Occupant Group
    DWORD Population
    ENDLOOP

    DWORD Occupant Group 2 count
    LOOP
    DWORD Occupant Group
    DWORD Population
    ENDLOOP

    DWORD Occupant Group 3 count
    LOOP
    DWORD Occupant Group
    DWORD Population
    ENDLOOP

    DWORD Count
    LOOP
    DWORD Unknown ;Values are normally the same.
    ENDLOOP

    DWORD Neighbor Connection Count




    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    This is the lookup table for the Occupant group section to actual names that I have used in my own program.

    0x1001:Maximum Res. pop.,
    0x1010:R$ Maximum pop.,
    0x1011:R$ Current pop.,
    0x1020:R$$ Maximum pop.,
    0x1021:R$$ Current pop.,
    0x1030:R$$$ Maximum pop.,
    0x1031:R$$$ Current pop.,
    0x2010:R$ Jobs,
    0x2020:R$$ Jobs,
    0x2030:R$$$ Jobs,
    0x2111:R$ Workforce EQ1,
    0x2112:R$ Workforce EQ2,
    0x2113:R$ Workforce EQ3,
    0x2114:R$ Workforce EQ4,
    0x2121:R$$ Workforce EQ1,
    0x2122:R$$ Workforce EQ2,
    0x2123:R$$ Workforce EQ3,
    0x2124:R$$ Workforce EQ4,
    0x2131:R$$$ Workforce EQ1,
    0x2132:R$$$ Workforce EQ2,
    0x2133:R$$$ Workforce EQ3,
    0x2134:R$$$ Workforce EQ4,
    0x3110:CS$ Maximum Jobs,
    0x3111:CS$ Current Jobs,
    0x3120:CS$$ Maximum Jobs,
    0x3121:CS$$ Current Jobs,
    0x3130:CS$$$ Maximum Jobs,
    0x3131:CS$$$ Current Jobs,
    0x3320:CO$$ Maximum Jobs,
    0x3321:CO$$ Current Jobs,
    0x3330:CO$$$ Maximum Jobs,
    0x3331:CO$$$ Current Jobs,
    0x4100:IA Maximum Jobs,
    0x4101:IA Current Jobs,
    0x4200:ID Maximum Jobs,
    0x4201:ID Current Jobs,
    0x4300:IM Maximum Jobs,
    0x4301:IM Current Jobs,
    0x4400:IH Maximum Jobs,
    0x4401:IH Current Jobs

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Freshly updated spec for reading neighbor connection information blocks as well.  There's still a bit of data left in this file that I'll try to figure out.  The length of this leftover block is variable, so it's not a fixed structure as far as I can tell.

    ;Region View Data Structure
    ; TGI (0xCA027EDB, 0xCA027EE1, 0x00000000)
    WORD Version Major
    WORD Version Minor

    DWORD Tile X Location
    DWORD Tile Y Location
    DWORD City Size X
    DWORD City Size Y
    DWORD Residential Population
    DWORD Commercial Population
    DWORD Industrial Population
    DWORD Unknown1 ;I've seen zeros in these spots...
    DWORD Unknown2 ;might be unused population data
    DWORD Unknown3
    DWORD Unknown4
    DWORD Unknown5
    DWORD Unknown6
    DWORD Unknown7
    DWORD Unknown8 ;I think this was where early version files were different
    ;only had 3 bytes here instead of 4.  This needs testing though.

    DWORD City Name Length
    PRIOR City Name ;string
    DWORD Unknown ;zeros
    DWORD Mayor Name Length
    PRIOR Mayor Name ;string
    DWORD Unknown ;zeros

    ;Seemingly unused City & Mayor Names next
    DWORD Unused City Name Length
    PRIOR Unused City Name
    DWORD Unknown
    DWORD Unused Mayor Name Length
    PRIOR Unused Mayor Name
    DWORD Unknown

    ;More zeros
    DWORD Unknown
    DWORD Unknown
    DWORD Unknown
    DWORD Unknown
    DWORD Unknown
    DWORD Unknown ;Should be 0xFFFFFFFF

    ;Occupant group information.  Three sets in all.

    DWORD Occupant Group 1 count
    LOOP
    DWORD Occupant Group
    DWORD Population
    ENDLOOP

    DWORD Occupant Group 2 count
    LOOP
    DWORD Occupant Group
    DWORD Population
    ENDLOOP

    DWORD Occupant Group 3 count
    LOOP
    DWORD Occupant Group
    DWORD Population
    ENDLOOP

    DWORD Count
    LOOP
    DWORD Unknown ;Values are normally the same.
    ENDLOOP

    DWORD Neighbor Connection Count

    LOOP ;Neighbor Connection Count

    ;Begin Neighbor Connection Data

    WORD Unknown ;Version Tag?
    DWORD Network Type
    DWORD Connection X
    DWORD Connection Y
    DWORD Destination Tile X ;FFFF (-1) for places off the region top and left
    DWORD Destination Tile Y ;same as above
    WORD Unknown ;usually 512 why?  who knows!
    BYTE Unknown
    DWORD Exemplar Count ;If this is zero, information for the next connection starts

    LOOP ;Exemplar Count

    DWORD Parent Cohort Type
    DWORD Parent Cohort Group
    DWORD Parent Cohort Instance
    ;I bet Maxis reads the next 4 bytes as a DWORD and picks it apart...
    ;Known data types are:
    ; 0x02 WORD
    ; 0x03 DWORD
    ; 0x09 FLOAT
    BYTE Data Type
    WORD Repeat1
    BYTE Repeat2
    IF (Repeat1 > 0)
    count = Repeat1
    ELSEIF (Repeat2 > 0)
    count = Repeat2 ;Untested...didn't come across this in the connections
    ELSE
    count = 1 ;no repeats, only one item of data
    LOOP count
    if Data Type == 0x02
    WORD Data
    if Data Type == 0x03
    DWORD Data
    if Data Type == 0x09
    FLOAT Data
    ENDLOOP ;count
    ENDLOOP ;exemplar count
    ENDLOOP ;network connection count

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    You guys who are decoding the file formats, could you please locate a datasource that reports if a lot has been marked as historical? I want to make a dataview that highlights the historical buildings ( https://www.simtropolis.com/idealbb/view.asp?topicID=59351 ), so I need a datasource,  but I was not able to find this information in the LUA files. I would greatly appreciate any help.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Unfortunately that's pretty far up in the air =\
    Don't suppose me telling you the TypeIDs a9bd882d and c9bd5d4a in the savegames store data relating to buildings would help. That's all we know... This would be more a UI question though and I dont think it relates to savegames unless you plan on decoding those with us 3.gif..... We're just too overworked at the moment on Sims2 projects and Real life, so everyone has to take on their own projects and learn to decode. Sorry I cant give a better answer.

     

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online: A long, long time ago... 
     
    Hi all -
     
    it seems like you've compiled an amazing amount of analysis of the save game files.
    I appologize in advance for what will be a long post, but you've got me excited.
     
    Unfortunately for me, I don't really understand much of what you're talking about, as
    I know very little about computer programming and such 42.gif
     
    However, I am very interested in trying to access the savegame data, as I do happen
    to know things about statistics, MS Access and other db programs, and mapmaking
    (not terrain generating... statistical maps).  So I have a bunch of questions which I'm
    hoping are already answered somewhere I haven't found, or might be answered in the
    future.
     
    I guess the best organization method for asking what is available is describing how I'd
    use it.  I'll try to start with the simple and work up.
     
    1) Census Data.  I'd love to be able to create a Census for a growing region.  This could
    range from as little as the population of each city each year (which I already do by hand)
    to a month by month tracking of population, average age, average wealth, HQ, EQ, etc.
    As much data mining as is possible, I would like to be able to collect.  (Note - I have a
    feeling this is the most realistic request, but it's also what I'm most excited about)
     
    2) I've read in other posts that it's not possible to export a grayscale .bmp of a region the
    way that we can import them to generate terrain.  If there is really a global terrain map
    that stores height data... would it be possible to grab that data as a matrix and extrapolate
    a grayscale from that?
     
    3) Ok, I'm going for broke here.  What are the odds that the terrain map contains information
    about whether or not a tile is developed.  The idea here is to be able to create temporal maps
    of development in the region ( like these ).  I'm guessing I'm shooting for the moon here, but I
    figured it might be possible, and it would make for some really amazing maps.
     
    Thanks for all the work you've done already...
    you've made SC4 a lifestyle for me instead of just a game!

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Lets see here

    1) If you look up to some of tropod and my posts on census data, that file, called the historical data file, should store info on population over set time periods. Now its not going to be readable at first, so you'd have to figure out which of the data sets it is once you have a way to read it... but you should be able to pull data for population as well as any of the other graph data sets and have them put into table form. I'm not sure if the game itself even stores multiple time periods for things such as wealth. But if it does, they're in that file and extrapolatable too. It contains everything graph and chart related to the city.
     
    Now the problem with this is that it requires making plugins to accomplish the task, and we're completely out of programmers at the moment. All programs are dead stopped from people just having a lack of energy to program C# / .NET plugins anymore, so we cant even do simple stuff at a respectible pace... anyways.
     
    2) Terrain is stored in 2 ways. First there is the main map, which is a series of float values for each corner of each tile on the map. Now here's the problem. A greyscale map has 255 values. Each simcity tile has about 2500 values... Now we've done greyscale for the terrain map as a datgen 0.6.0 plugin, but it has to have a range, so datgen can only display 255 values of the 2500 at a time. This is the problem with exportation. Now you could also create a plugin that will take that data, and compress the 2500 into the 255, but you will lose some of the information no matter how you do it. Of course once again, the problem is lack of able hands. Each side tile is again stored as a file for the reconciliation engine, and again uses the float method as a map, but only one side of the map is actually filled in. That's how the game does reconcilations instead of needing entire neighbouring cities.
     
    3) This is Theoretically possible..... now there IS a building file that stores the location of every building on a map, and there IS a file that stores the location of every road on a map. Those two put together with the terrain map Could theoretically make the kind of urban map you're talking of... There's just one problem, which is nobody has decoded the building or the road map file... lack of people again *sigh* what can I say.
     
    If anyone out there is interested in learning how to decode filetypes, I have a tutorial online at
     
     
    And if anyone else is interested in learning how to read SC4 files and make plugins to display the info, we have a chat online where we teach those things for .NET programmers (we do .NET only because that's what datgen uses.) at the IRC chat server irc.thesimsresource.com channel #datgen

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections