Hello SimCity 4 modders, After a hiatus of a year or two, I picked up SimCity again a few weeks ago and decided to start fresh with an entire new region and try to build it as realistic as possible.
One thing that always bugged me is that this always involves a lot of clicking "Make Historical". After all, if you've finally managed to grow the building you wanted, you don't want to see it disappear by some R§§§ mansions. Most of the time I spent 15 minutes zoning, and then 3 hours clicking "Make Historical" until I couldn't feel my wrist anymore. Given that I have some programming capabilities, back in the days I've always played with the idea to create a script that would mark all buildings within a city historical. I did some research on this topic, but all resources I could find told me that it was possible to read savegames, but impossible to modify .sc4 savegames. This was due to the CRC checksum that is added in .sc4 files, whose algorithm was apparently unknown. Seems like this discussion was closed. However, by picking SC4 up again I also noticed the work that @simmaster07 did with the Prop Pox fix. Although I never suffered from Prop Pox myself, it is without a doubt one of the most important modding achievements ever. The importance and brilliance of his work cannot be underestimated. Being a programmer myself, I got interested in the technical details behind this masterpiece and I stumbled upon this piece of code. It basically is an override of how entries in the Prop Subfile are saved. I noticed the presence of a function called xcrc32 which carried out the CRC checksum of the entry. I don't know how @simmaster07 did it, but this turned out to be the "missing CRC checksum" algorithm. I immediately hacked some stuff together and noticed that it was indeed this CRC checksum function that was also used in the Lot Subfile. I was shaking. This couldn't mean that it would make modifying savegames possible, right? Well turns out it does! I put some code together and managed to read in an .sc4 savegame, parse all entries of the Lot Subfile and turned on the bit mask that identifies a lot as historical. I saved the file again, re-calculating the CRC checksums for each lot and opened up the file in SC4. I couldn't believe my eyes. I was expecting crashes, but all lots in my entire city were marked as historical and I could continue playing the game as normal. I then did some cycles of growing new lots and running my script aftewards and everything still worked. While having limited my test case to flipping 1 bit per lot subfile, I think this shows that it is possible to modify .sc4 savegames. Another result of @simmaster07's magnificent work. I'm already thinking of what could be possible. I'm thinking for instance of plopping residential lots using the LotPlop extra cheat and then running a script that modifies them as if they were grown so that the pathfinder could work on these lots. This would be a great help for CJ builders! The options are endless, you could basically program your entire city! In order to show that this worked, I've created a small command-line utility that can be used to make all buildings within a city historical. It is available on github here: https://github.com/sebamarynissen/sc4 where I also added installation instructions. It requires some effort to set up, however if you're familiar with node.js everything should be quite straightforward. I'm also willing to offer some help with those having troubles to install. Once you've installed the tool, you should be able to run the command sc4 historical path/to/your/city.sc4 from a command prompt. By default this will not override the input city, but create another city named HISTORICAL-[city name].sc4. If you want to override, run sc4 historical --force path/to/your/city.sc4 but MAKE SURE TO ALWAYS HAVE A BACKUP. Note that this tool is merely a proof of concept that it is actually possible to modify .sc4 savegames. This tool is not meant for public use, so I can't stress enough TO ALWAYS HAVE A BACKUP OF YOUR ENTIRE REGION. I AM NOT LIABLE FOR ANY OF THE CONSEQUENCES IF SOMETHING GOES WRONG. Anyway, it would really help me if some people were able to test this and report any issues if they found one - preferrably in the Github Repository. Let me know what you guys think. I hope that this opens up new possibilities for SimCity 4 and how we can build more amazing cities than ever!   - Seba   EDIT: I've published a version with prebuilt C++ libraries on npm. You should be able to install it using npm install -g sc4 if you have node 12 or higher without the need to compile the C++ libraries.