Replies: 1 (Who?), Viewed: 3954 times.
Test Subject
Original Poster
#1 Old 6th Sep 2014 at 1:19 AM Last edited by clown : 6th Sep 2014 at 1:58 AM.
Default Protocol buffer (aka the game save format) reverse engineering
Sims 4's python code includes protocol buffers, a library from google to perform binary serialization of structured data, as well as a bunch of python serialization classes (in Game/Bin/Python/generated.zip) generated using that system.

protocol buffers works using a compiler that reads text files describing the data structures to serialize and generate classes that implement those.
It turns out that a serialized form of those descriptions are included as strings within the generated classes, so I have written a quick and dirty program to extract them, then I was able to simply use the protobuf library to deserialize those descriptions and regenerate the corresponding .proto files.

Those files are in the attached ts4-protocolbuffers.zip file.

Those files can therefore be used to regenerate serialization classes for in any programming language to read, manipulate and write whatever data sims 4 stores using this.

I don't know all the places where this type of binary serialization is used, but so far at least it seems used to store most of the game save data. .sav files from My Documents/The Sims 4/Saves can be opened with s4pe and contain one resource of type 0x0000000D, which contains a serialized SaveGameData message (whose definition is in FileSerialization.proto). This is basically the state of every lot/object/sim/game options and such, in a structured format.
I have been able to browse the content of a save as a big tree view using those .proto files and an extremely unwieldy protobuf data editing tool (http://protobufeditor.sourceforge.net/), but it should be relatively easy to build a dedicated save editing tool from those .proto files.

[Edit: I had attached the wrong zip file which included more crap than necessary, fixed now]
Download - please read all instructions before downloading any files!
File Type: zip ts4-protobuf.zip (58.8 KB, 361 downloads) - View custom content
Advertisement
Pettifogging Legalist!
retired moderator
#2 Old 2nd Nov 2014 at 2:27 PM
Moving to Resources, since it is one.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Back to top