Skip to content

Commit

Permalink
add struct names, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz-h committed Jan 8, 2025
1 parent 06d9803 commit 7dc9850
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 16 deletions.
43 changes: 29 additions & 14 deletions docs/SATISFACTORY_SAVE.md
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ With using the following types:
| `ByteProperty` | `int8` |
| `EnumProperty` | `FName` |
| `FloatProperty` | `float` |
| `Int8Property` | `int8` |
| `Int64Property` | `int64` |
| `IntProperty` | `int32` |
| `InterfaceProperty` | `FObjectReferenceDisc` |
Expand Down Expand Up @@ -828,20 +829,22 @@ But maps have the problem that no information about which struct type is used is
It is only possible to workaround this by manually creating a list of struct types using the parent class name and property name.
So far, the following types have been observed:

| Parent Class | Name | Key | Value | Struct Type | Notes |
|------------------------------------------------------------------|------------------------------|-----|-------|-------------------------------------------|-------------------|
| `/Game/FactoryGame/Events/BP_EventSubsystem.BP_EventSubsystem_C` | `mStoredCalendarData` | | x | `CalendarData` | |
| `/Game/FactoryGame/Events/BP_EventSubsystem.BP_EventSubsystem_C` | `mCalendarData` | | x | `CalendarData` | |
| `/Script/FactoryGame.FGFoliageRemovalSubsystem` | `mSaveData` | x | | `IntVector` | |
| `/Script/FactoryGame.FGFoliageRemovalSubsystem` | `mSaveData` | | x | `FoliageRemovalSaveDataPerCell` | |
| `/Script/FactoryGame.FGFoliageRemovalSubsystem` | `mUnresolvedSaveData` | x | | `IntVector` | |
| `/Script/FactoryGame.FGFoliageRemovalSubsystem` | `mUnresolvedSaveData` | | x | `FoliageRemovalUnresolvedSaveDataPerCell` | |
| `/Script/FactoryGame.FGStatisticsSubsystem` | `mItemsManuallyCraftedCount` | | x | `MappedItemAmount` | |
| `/Script/FactoryGame.FGStatisticsSubsystem` | `mItemsPickedUp` | | x | `MappedItemAmount` | |
| `/Script/FactoryGame.FGStatisticsSubsystem` | `mActorsBuiltCount` | | x | `ActorBuiltData` | |
| `FoliageRemovalSaveDataPerCell` | `SaveDataMap` | | x | `FoliageRemovalSaveDataForFoliageType` | |
| `FoliageRemovalUnresolvedSaveDataPerCell` | `SaveDataMap` | | x | `FoliageRemovalSaveDataForFoliageType` | |
| `LBBalancerData` | `mIndexMapping` | | x | `LBBalancerIndexing` | Mod LoadBalancers |
| Parent Class | Name | Key | Value | Struct Type | Notes |
|--------------------------------------------------------------------------------------------|------------------------------|-----|-------|-------------------------------------------|-------------------|
| `/Game/FactoryGame/Buildable/Factory/TruckStation/Build_TruckStation.Build_TruckStation_C` | `mDockingVehicleStatistics` | | x | `DockingVehicleStatistics` | |
| `/Game/FactoryGame/Events/BP_EventSubsystem.BP_EventSubsystem_C` | `mStoredCalendarData` | | x | `CalendarData` | |
| `/Game/FactoryGame/Events/BP_EventSubsystem.BP_EventSubsystem_C` | `mCalendarData` | | x | `CalendarData` | |
| `/Game/FactoryGame/Events/BP_EventSubsystem.BP_EventSubsystem_C` | `mCalendarsOpenedByPlayers` | | x | `PlayerStateSetWrapper` | |
| `/Script/FactoryGame.FGFoliageRemovalSubsystem` | `mSaveData` | x | | `IntVector` | |
| `/Script/FactoryGame.FGFoliageRemovalSubsystem` | `mSaveData` | | x | `FoliageRemovalSaveDataPerCell` | |
| `/Script/FactoryGame.FGFoliageRemovalSubsystem` | `mUnresolvedSaveData` | x | | `IntVector` | |
| `/Script/FactoryGame.FGFoliageRemovalSubsystem` | `mUnresolvedSaveData` | | x | `FoliageRemovalUnresolvedSaveDataPerCell` | |
| `/Script/FactoryGame.FGStatisticsSubsystem` | `mItemsManuallyCraftedCount` | | x | `MappedItemAmount` | |
| `/Script/FactoryGame.FGStatisticsSubsystem` | `mItemsPickedUp` | | x | `MappedItemAmount` | |
| `/Script/FactoryGame.FGStatisticsSubsystem` | `mActorsBuiltCount` | | x | `ActorBuiltData` | |
| `FoliageRemovalSaveDataPerCell` | `SaveDataMap` | | x | `FoliageRemovalSaveDataForFoliageType` | |
| `FoliageRemovalUnresolvedSaveDataPerCell` | `SaveDataMap` | | x | `FoliageRemovalSaveDataForFoliageType` | |
| `LBBalancerData` | `mIndexMapping` | | x | `LBBalancerIndexing` | Mod LoadBalancers |

For more information about structs, see [Structs](#structs).

Expand Down Expand Up @@ -908,25 +911,31 @@ The following struct names were observed to be property structs:
`CalendarData`,
`CollisionResponse`,
`CustomizationDescToRecipeData`,
`DockingVehicleStatistics`,
`DroneDockingStateInfo`,
`DroneTripInformation`,
`FactoryCustomizationColorSlot`,
`FactoryCustomizationData`,
`FactoryTickFunction`,
`FeetOffset`,
`FGCachedConnectedWire`,
`FGDroneFuelRuntimeData`,
`FGPortalCachedFactoryTickData`,
`FloatInterval`,
`FloatRange`,
`FloatRangeBound`,
`FoliageRemovalSaveDataForFoliageType`,
`FoliageRemovalSaveDataPerCell`,
`FoliageRemovalUnresolvedSaveDataPerCell`,
`FoundationSideSelectionFlags`,
`GlobalColorPreset`,
`HardDriveData`,
`HeadlightParams`,
`HighlightedMarkerPair`,
`Hotbar`,
`InstanceData`,
`InventoryStack`,
`InventoryToRespawnWith`,
`ItemAmount`,
`ItemFoundData`,
`KAggregateGeom`,
Expand All @@ -942,12 +951,15 @@ The following struct names were observed to be property structs:
`MessageData`,
`MiniGameResult`,
`ParticleMap`,
`PersistentGlobalIconId`,
`PhaseCost`,
`PlayerCustomizationData`,
`PlayerRules`,
`PlayerStateSetWrapper`,
`PointerToUberGraphFrame`,
`PrefabIconElementSaveData`,
`PrefabTextElementSaveData`,
`ProjectAssemblyLaunchSequenceValue`,
`RecipeAmountStruct`,
`RemovedInstance`,
`RemovedInstanceArray`,
Expand All @@ -970,10 +982,12 @@ The following struct names were observed to be property structs:
`StreamingTextureBuildInfo`,
`StringPair`,
`SubCategoryMaterialDefault`,
`SwatchGroupData`,
`TextureParameterValue`,
`TimerHandle`,
`TimeTableStop`,
`TireTrackDecalDetails`,
`TopLevelAssetPath`,
`TrainDockingRuleSet`,
`TrainSimulationData`,
`Transform`,
Expand Down Expand Up @@ -1005,6 +1019,7 @@ The following structs are binary structs with the type described in the table:
| `Rotator` | `FRotator` | `double Pitch`<br>`double Yaw`<br>`double Roll` | |
| `SoftClassPath` | `FSoftObjectPath` | TODO | |
| `Vector2D` | `FVector2D` | `double X`<br>`double Y` | |
| `Vector4` | `FVector4` | `double X`<br>`double Y`<br>`double Z`<br>`double W` | |
| `Vector` | `FVector` | `double X`<br>`double Y`<br>`double Z` | |

## Type and Object Reference
Expand Down
11 changes: 9 additions & 2 deletions libsave/src/GameTypes/MapTypes/StructMapTypeList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@

std::string SatisfactorySave::StructMapTypeList::structNameLookup(const FName& name, const std::string& parentClassName,
bool isKey) {
if (!isKey && parentClassName == "/Game/FactoryGame/Events/BP_EventSubsystem.BP_EventSubsystem_C" &&
(name == "mStoredCalendarData" || name == "mCalendarData")) {
if (!isKey &&
parentClassName == "/Game/FactoryGame/Buildable/Factory/TruckStation/Build_TruckStation.Build_TruckStation_C" &&
name == "mDockingVehicleStatistics") {
return "DockingVehicleStatistics";
} else if (!isKey && parentClassName == "/Game/FactoryGame/Events/BP_EventSubsystem.BP_EventSubsystem_C" &&
(name == "mStoredCalendarData" || name == "mCalendarData")) {
return "CalendarData";
} else if (!isKey && parentClassName == "/Game/FactoryGame/Events/BP_EventSubsystem.BP_EventSubsystem_C" &&
name == "mCalendarsOpenedByPlayers") {
return "PlayerStateSetWrapper";
} else if (parentClassName == "/Script/FactoryGame.FGFoliageRemovalSubsystem" && name == "mSaveData") {
if (isKey) {
return "IntVector";
Expand Down
11 changes: 11 additions & 0 deletions libsave/src/GameTypes/Structs/Base/Struct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,31 @@ std::shared_ptr<SatisfactorySave::Struct> SatisfactorySave::Struct::create(const
"CalendarData",
"CollisionResponse",
"CustomizationDescToRecipeData",
"DockingVehicleStatistics",
"DroneDockingStateInfo",
"DroneTripInformation",
"FactoryCustomizationColorSlot",
"FactoryCustomizationData",
"FactoryTickFunction",
"FeetOffset",
"FGCachedConnectedWire",
"FGDroneFuelRuntimeData",
"FGPortalCachedFactoryTickData",
"FloatInterval",
"FloatRange",
"FloatRangeBound",
"FoliageRemovalSaveDataForFoliageType",
"FoliageRemovalSaveDataPerCell",
"FoliageRemovalUnresolvedSaveDataPerCell",
"FoundationSideSelectionFlags",
"GlobalColorPreset",
"HardDriveData",
"HeadlightParams",
"HighlightedMarkerPair",
"Hotbar",
"InstanceData",
"InventoryStack",
"InventoryToRespawnWith",
"ItemAmount",
"ItemFoundData",
"KAggregateGeom",
Expand All @@ -56,12 +62,15 @@ std::shared_ptr<SatisfactorySave::Struct> SatisfactorySave::Struct::create(const
"MessageData",
"MiniGameResult",
"ParticleMap",
"PersistentGlobalIconId",
"PhaseCost",
"PlayerCustomizationData",
"PlayerRules",
"PlayerStateSetWrapper",
"PointerToUberGraphFrame",
"PrefabIconElementSaveData",
"PrefabTextElementSaveData",
"ProjectAssemblyLaunchSequenceValue",
"RecipeAmountStruct",
"RemovedInstance",
"RemovedInstanceArray",
Expand All @@ -84,10 +93,12 @@ std::shared_ptr<SatisfactorySave::Struct> SatisfactorySave::Struct::create(const
"StreamingTextureBuildInfo",
"StringPair",
"SubCategoryMaterialDefault",
"SwatchGroupData",
"TextureParameterValue",
"TimerHandle",
"TimeTableStop",
"TireTrackDecalDetails",
"TopLevelAssetPath",
"TrainDockingRuleSet",
"TrainSimulationData",
"Transform",
Expand Down

0 comments on commit 7dc9850

Please sign in to comment.