Interesting, I had never looked into just where exactly SC4TF got its cities from, but seeing as every region I play has passed through this program at some point, this caught my attention.
I wonder what other data was in there?
So, armed with Reader and a free afternoon, I dug into this one. It gets interesting. I did some basic checks on the SC4TF Large and Medium templates, but focused on the Small template. So I then compared the Small template with a few small cities created directly in the game.
First, a few big differences that jumped out at me while I tried to create a file that most closely matched the SC4TF template. Some of these might matter, most probably don't so much.
- Small, Medium, and Large cities don't all have their data in the same place. For example, what might be at Number 109 in a Small city, might be Number 125 in a different size city's file. TGIs, however, are consistent.
- The SC4TF template TGIs are generally better organized (ie easier to read, line breaks, etc.). I don't know if this is just how Reader parses the files or any actual difference - at the end of the day it's all just a stream of bytes anyway. Doesn't look like the TGIs actually contain extra line breaks coded into them.
- The SC4TF template files are in French (merci, Wou). While this probably only impacts those parts of the savegame file that contain text strings, it does account for roughly half the differences between my test file and the SC4TF file. It also means that the .dat Compare Tool flags a whole bunch of TGIs for having different sizes, because something "written in English" and "écrit en français" end up having different text string lengths. I think the only way to control for this would be to have someone check a SC4TF file against a control file from a French version of the game.
- SC4TF template files are at a constant elevation of 252m, while the water based region I created was a constant elevation of 192m. IIRC this can be controlled for, but that's what came up when I created the region. This also accounts for some of the differences between the two files, however. For example the terrain map (a9dd6ff4 e98f9525 00000001), and reconcile edges data (the other four Type a9dd6ff4 files).
- The savegame file changes between God Mode and Mayor Mode, as you might expect, adds some TGIs, changes others. Going forward though, I used only files that were last saved in God Mode and hadn't been established yet - because the SC4TF created files always load in God Mode.
- Plugins matter. See below.
So first, I created a new region, all land, and ran that file against the SC4TF template file, which is how I figured out that the SC4TF files are water based. Although, the elevation in them is 252m, so they're just barely water. I controlled for that by creating a new region, all water, to eliminate any differences that might pop up with one being land and the other being water.
This left four TGIs that still had a large difference - and by large I mean my test city had them at over 12kb and the SC4TF template had them at ~100
bytes. All four of these were interestingly right around 12k in size and had similar Type IDs: A98F9D3B, A98F9D28, C98F9D4A, and C98F9D17, note that only the 1st, 7th, and 8th digit change. Don't know if this is significant. All four of these are considered unknown properties as far as I know. On a whim, I figured these might be plugin related, so I removed my plugins, dropped a blank plugins folder in my game, and started a new, water based region, picked a small city, saved it in God Mode, and fired up Reader again.
This turned out to be the magic key - all four of those properties now matched the SC4TF template file in size and only differed in text. Sizes were down around the SC4TF template file sizes, roughly 70-120 bytes. Likewise, the .sc4 file sizes were much closer, mine at 115kb, the SC4TF template at 125kb (previously mine had been 188kb). With this, I ran a difference check, and followed up on that by checking the two files to see what those differences were.
Roughly half the TGIs reported different sizes, however nearly all of these were files that contained text strings - Ordinances, Advisors, Taxes, Rewards (0a413481), City Data (8990c372 and ca027edb), etc. and I mark this up to the language difference. Generally, size differences were small, within 50-100 bytes. The .png files also differed in size, as did the directory file (same number of entries though, probably due to recording different file sizes). The Terrain Array (2990c1bc) also differed in size, but not by much. The contents of this also looked pretty similar, I figure some of the difference is due to the cities being at different elevations, but I didn't dig deeper into this one.
Then there were roughly a dozen TGIs that were identical. Mostly these dealt with the png files or appeared to be blank filler, some are unknown properties. The most interesting one was at Number 0 (499b23fe). Which is not however at the beginning of the file, but somewhere 50kb deep. Don't know what this TGI does, but it's about 600 bytes of actual data.
Now, the ones that differed only in the contents of the TGI, which is most likely where the differences you spotted are occurring. Some of these were Advice (6a3848db, 6a9335de, 8a09f5f4 and aa371c32) files, others were My Sim (0bf606a5 and 4a1dbbbf) files. A huge chunk of these files fell into the category of TGIs that were never decoded as far as I know, and most of these are relatively tiny, often under 100 bytes, which tells me they are probably either flags of some sort, single value settings, etc. - what exactly though, I have no idea. The terrain map and reconcile edges data also fell into this category, as expected.
The more interesting TGIs (with names at least) that differed in text only are:
- Number 51 - Historical Data/Graphs (89efa536)
- Number 57 - Water Pollution (8990c065)
- Number 59 - Pathfinding (6a0f82b2)
- Number 60 - Sims to Jobs Match (6990c1aa)
- Number 63 - Situation Manager (4be372cd)
- Number 82 - Power Simulator (0990c005)
This same chunk of locations also contained several TGIs that are undefined, pretty much Numbers 27 through 107 are more or less unknown TGIs that differed in text only. Interesting notes I picked up along the way are that the Historical Data appears to only be a template, in cities that have been played that file gets much larger. Also, in a small city (with 4096 squares) the water pollution file only appears to have 2048 entries.
That's all I have for now. If anyone has decoded more of the TGIs than what were posted way back when, I'd love to know. Especially since I'm working to get all that old technical info onto the Wiki. It would of course also be immensely helpful here for figuring out what all those unknown TGIs do.
Edit: Changed "Location" to "Number" and added Type IDs (full TGIs where necessary) to the names above.