- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Resources & Misc >
- Protocol buffer (aka the game save format) reverse engineering
- > For things that don't fit in other areas.
Replies: 1 (Who?), Viewed: 4764 times.
#1
6th Sep 2014 at 12:19 AM
Last edited by clown : 6th Sep 2014 at 12:58 AM.

Posts: 15
Thanks: 2996 in 122 Posts

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]
Attached files:
![]() |
ts4-protobuf.zip (58.8 KB, 456 downloads) - View custom content | |
0 09-05-2014 23:56 ts4-protobuf/ 1168 09-05-2014 23:38 ts4-protobuf/Animation.proto 1971 09-05-2014 23:38 ts4-protobuf/Area.proto 347 09-05-2014 23:38 ts4-protobuf/Audio.proto 297 09-05-2014 23:38 ts4-protobuf/BillingClient.proto 1259 09-05-2014 23:38 ts4-protobuf/BuildBuy.proto 380 09-05-2014 23:38 ts4-protobuf/Chat.proto 549 09-05-2014 23:38 ts4-protobuf/ChunkHeaders.proto 243 09-05-2014 23:38 ts4-protobuf/ChunkPersistence.proto 940 09-05-2014 23:38 ts4-protobuf/Commands.proto 3137 09-05-2014 23:38 ts4-protobuf/Commodities.proto 18614 09-05-2014 23:42 ts4-protobuf/Consts.proto 1258 09-05-2014 23:38 ts4-protobuf/DebugVisualization.proto 10951 09-05-2014 23:38 ts4-protobuf/Dialog.proto 342 09-05-2014 23:38 ts4-protobuf/Distributor.proto 17439 09-05-2014 23:38 ts4-protobuf/DistributorOps.proto 10567 09-05-2014 23:38 ts4-protobuf/Exchange.proto 13969 09-05-2014 23:38 ts4-protobuf/FileSerialization.proto 10769 09-05-2014 23:38 ts4-protobuf/GameplaySaveData.proto 0 09-05-2014 23:56 ts4-protobuf/google/ 0 09-05-2014 23:56 ts4-protobuf/google/protobuf/ 28878 09-05-2014 23:44 ts4-protobuf/google/protobuf/descriptor.proto 2800 09-05-2014 23:38 ts4-protobuf/InteractionOps.proto 2089 09-05-2014 23:38 ts4-protobuf/Localization.proto 435 09-05-2014 23:38 ts4-protobuf/Loot.proto 1079 09-05-2014 23:38 ts4-protobuf/LotTemplate.proto 631 09-05-2014 23:38 ts4-protobuf/Math.proto 304 09-05-2014 23:38 ts4-protobuf/Memories.proto 753 09-05-2014 23:38 ts4-protobuf/MoveInMoveOut.proto 1917 09-05-2014 23:38 ts4-protobuf/MTXCatalog.proto 330 09-05-2014 23:38 ts4-protobuf/MTXEntitlement.proto 9758 09-05-2014 23:38 ts4-protobuf/Persistence.proto 461 09-05-2014 23:38 ts4-protobuf/PersistenceBlobs.proto 645 09-05-2014 23:38 ts4-protobuf/PersistenceControl.proto 297 09-05-2014 23:38 ts4-protobuf/ResourceKey.proto 2280 09-05-2014 23:38 ts4-protobuf/Routing.proto 1426 09-05-2014 23:38 ts4-protobuf/S4Common.proto 18092 09-05-2014 23:38 ts4-protobuf/SimObjectAttributes.proto 13185 09-05-2014 23:38 ts4-protobuf/Sims.proto 200 09-05-2014 23:38 ts4-protobuf/SimsCustomOptions.proto 4970 09-05-2014 23:38 ts4-protobuf/Situations.proto 7190 09-05-2014 23:38 ts4-protobuf/Social.proto 952 09-05-2014 23:38 ts4-protobuf/Sparse.proto 694 09-05-2014 23:38 ts4-protobuf/Telemetry.proto 7713 09-05-2014 23:38 ts4-protobuf/UI.proto 651 09-05-2014 23:38 ts4-protobuf/VFX.proto --------- ------- 201930 46 files |
Advertisement
#2
2nd Nov 2014 at 2:27 PM

Posts: 11,010
Thanks: 418453 in 1110 Posts
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.
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.
Who Posted
|