Modding:Save File Format

From the Dyson Sphere Program Wiki
Revision as of 05:16, 10 February 2021 by imported>76561198054818918 (Added up through CargoTraffic)

This page defines the Dyson Sphere Program save file format .dsv. On Windows by default save files are stored in %USERPROFILE%\Documents\Dyson Sphere Program\Save\.

GameSave
{
    "VFSAVE"
    int64_t fileStreamLength
    int32_t saveFileFormatNumber = 4
    int32_t majorGameVersion
    int32_t minorGameVersion
    int32_t releaseGameVersion
    int64_t gameTick
    int64_t nowTicks
    int32_t sizeOfPngFile
    uint8_t screenShotPngFile[sizeOfPngFile]
    GameData
}

GameData
{
    int32_t version = 2
    string gameName
    GameDesc gameDesc
    int64_t gameTick
    GamePrefsData preferences (version >= 1)
    GameHistoryData
    uint8_t bool hidePlayerModel (version >= 2)
    uint8_t bool disableController (version >= 2)
    GameStatData statistics
    int32_t planetId
    Player mainPlayer
    int32_t factoryCount
    GalacticTransport
    PlanetFactory[factoryCount]
    int32_t galaxyStarCount: Must equal GameDesc::starCount or the game will crash.
    int32_t numDysonSpheres
    [numDysonSpheres] {
        int32_t dysonSphereDataIsAvailableFlag: Must be 0 or 1 or the game will crash.
        DysonSphere (dysonSphereDataIsAvailableFlag == 1)
    }
}

GameDesc
{
    int32_t version = 2
    int32_t galaxyAlgo
    int32_t galaxySeed
    int32_t starCount
    int32_t playerProto
    float resourceMultiplier (version >= 2)
    int32_t numThemeIds (version >= 1)
    int32_t themeIds[numThemeIds] (version >= 1)
}

GamePrefsData
{
    int32_t version = 2
    double cameraUPosX
    double cameraUPosY
    double cameraUPosZ
    float cameraURotX
    float cameraURotY
    float cameraURotZ
    float cameraURotW
    int32_t reformCursorSize (version >= 1)
    int32_t numReplicatorMultipliers (version >= 1)
    replicatorMultipliers[numReplicatorMultipliers] (version >= 1) {
        int32_t key
        int32_t value
    }
    float bool detailPower
    float bool detailVein
    float bool detailSpaceGuide
    float bool detailSign
    float bool detailIcon
    int32_t numTutorialShowing (version >= 2)
    int32_t tutorialShowing[numTutorialShowing] (version >= 2)
}

GameHistoryData
{
    int32_t version = 2
    int32_t numRecipeUnlocked
    int32_t recipeUnlocked[numRecipeUnlocked]
    int32_t numTutorialUnlocked (version >= 2)
    int32_t tutorialUnlocked[numTutorialUnlocked] (version >= 2)
    int32_t numFeatureKeys
    int32_t featureKeys[numFeatureKeys]
    int32_t numTechState
    [numTechState] {
        int32_t techProtoIndex
        uint8_t bool TechState_unlocked
        int32_t TechState_curLevel
        int32_t TechState_maxLevel
        int64_t TechState_hashUploaded
        int64_t TechState_hashNeeded
    }
    uint8_t bool autoManageLabItems
    int32_t currentTech
    int32_t numTechQueue (version >= 1)
    int32_t techQueue_TechStateKey[numTechQueue]
    int32_t universeObserveLevel
    float solarSailLife
    float solarEnergyLossRate
    uint8_t bool useIonLayer
    int32_t inserterStackCount
    float logisticDroneSpeed
    float logisticDroneSpeedScale
    int32_t logisticDroneCarries
    float logisticShipSailSpeed
    float logisticShipWarpSpeed
    float logisticShipSpeedScale
    float bool logisticShipWarpDrive
    int32_t logisticShipCarries
    float miningCostRate
    float miningSpeedScale
    int32_t storageLevel
    int32_t labLevel
    int32_t techSpeed
    float dysonNodeLatitude
    int64_t universeMatrixPointUploaded
    float bool missionAccomplished
}

GameStatData
{
    int32_t version = 0
    int32_t numTechHashedHistory
    int32_t techHashedHistory[numTechHashedHistory]
    ProductionStatistics
}

ProductionStatistics
{
    int32_t version = 0
    int32_t numFactoryStatPool
    FactoryProductionStat factoryStatPool[numFactoryStatPool]
    int32_t numFirstCreateIds
    int32_t firstCreateIds[numFirstCreateIds]
    int32_t numFavoriteIds
    int32_t favoriteIds[numFavoriteIds]
}

FactoryProductionStat
{
    int32_t version = 1
    int32_t productCapacity
    int32_t productCursor
    ProductStat productPool[productCursor]
    int32_t numPowerPool, max 5
    PowerStat powerPool[numPowerPool]
    int32_t numProductIndices
    int32_t productIndices[numProductIndices]
    int64_t energyConsumption (version >= 1)
}

ProductStat
{
    int32_t version = 0
    int32_t numCount:  Saved as 7200.  Reads more or less, but only stores up to 7200, and enforces abs.
    int32_t count[numCount]
    int32_t numCursor:  Saved as 12.  Reads more or less, but only stores up to 12.
    int32_t cursor[numCount]
    int32_t numTotal:  Saved as 14.  Reads more or less, but only stores up to 14, and enforces abs.
    int32_t total[numCount]
    int32_t itemId
}

PowerStat
{
    int32_t version = 0
    int32_t numEnergy:  Saved as 3600.  Reads more or less, but only stores up to 3600, and enforces abs.
    int64_t energy[numCount]
    int32_t numCursor:  Saved as 6.  Reads more or less, but only stores up to 6.
    int32_t cursor[numCount]
    int32_t numTotal:  Saved as 7.  Reads more or less, but only stores up to 7, and enforces abs.
    int64_t total[numCount]
    int32_t itemId
}

Player
{
    int32_t version = 1
    int32_t planetId: Ignored on read
    float position_x
    float position_y
    float position_z
    float uPosition_x
    float uPosition_y
    float uPosition_z
    float uRotation_x
    float uRotation_y
    float uRotation_z
    float uRotation_w
    int32_t EMovementState movementState (Walk, Drift, Fly, Sail)
    float warpState
    uint8_t bool warpCommand
    double uVelocity_x
    double uVelocity_y
    double uVelocity_z
    int32_t inhandItemId
    int32_t inhandItemCount
    Mecha
    StorageComponent package[10]
    PlayerNavigation
    int32_t sandCount
}

Mecha
{
    int32_t version = 0
    double coreEnergyCap
    double coreEnergy
    double corePowerGen
    double reactorPowerGen
    double reactorEnergy
    int32_t reactorItemId
    StorageComponent reactorStorage[4]
    StorageComponent warpStorage
    double walkPower
    double jumpEnergy
    double thrustPowerPerAcc
    double warpKeepingPowerPerSpeed
    double warpStartPowerPerSpeed
    double miningPower
    double replicatePower
    double researchPower
    double droneEjectEnergy
    double droneEnergyPerMeter
    int32_t coreLevel
    int32_t thrusterLevel
    float miningSpeed
    float replicateSpeed
    float walkSpeed
    float jumpSpeed
    float maxSailSpeed
    float maxWarpSpeed
    float buildArea
    MechaForge
    MechaLab
    int32_t droneCount
    float droneSpeed
    int32_t droneMovement
    MechaDrone[droneCount]
}

StorageComponent
{
    int32_t version = 1
    int32_t id
    int32_t entityId
    int32_t previous (version >= 1)
    int32_t next (version >= 1)
    int32_t bottom (version >= 1)
    int32_t top (version >= 1)
    int32_t EStorageType type (0:Default 1:Fuel 9:Filtered)
    int32_t gridSize
    int32_t bans (version >= 1)
    grids[gridSize] {
        int32_t itemId
        int32_t filter
        int32_t count
        int32_t stackSize
    }
}

PlayerNavigation
{
    int32_t version = 0
    uint8_t bool navigating
    int32_t naviAstroId
    double naviTarget_x
    double naviTarget_y
    double naviTarget_z
    uint8_t bool useFly
    uint8_t bool useSail
    uint8_t bool useWarp
    int32_t ENaviStage stage (None, Departure, OriginOrbit, AccOrbit, Space, DestOrbit, Approaching)
    double flyThreshold
    double sailThreshold
    double warpThreshold
    double maxSailSpeed
}

GalacticTransport
{
    int32_t version = 0
}

PlanetFactory
{
    int32_t version = 1
    int32_t planetId
    PlanetData
    int32_t entityCapacity
    int32_t entityCursor
    int32_t entityRecycleCursor
    EntityData entityPool[entityCursor - 1]
    entityAnimPool[entityCursor - 1] {
        float time
        float prepare_length
        float working_length
        uint32_t state
        float power
    }
    entitySignPool[entityCursor - 1] {
        uint32_t signType
        uint32_t iconType
        uint32_t iconId0
        uint32_t iconId1
        uint32_t iconId2
        uint32_t iconId3
        float count0
        float count1
        float count2
        float count3
        float x
        float y
        float z
        float w
    }
    int32_t entityConnPool[entityCursor * 16 - 16]
    int32_t entityRecycle[entityRecycleCursor]
    int32_t prebuildCapacity
    int32_t prebuildCursor
    int32_t prebuildRecycleCursor
    PrebuildData prebuildPool[prebuildCursor - ]
    int32_t prebuildConnPool[prebuildCursor * 16 - 16]
    int32_t prebuildRecycle[prebuildRecycleCursor]
    int32_t vegeCapacity
    int32_t vegeCursor
    int32_t vegeRecycleCursor
    VegeData vegePool[vegeCursor - 1]
    int32_t vegeRecycle[vegeRecycleCursor]
    int32_t veinCapacity
    int32_t veinCursor
    int32_t veinRecycleCursor
    VeinData veinPool[veinCursor - 1]
    int32_t veinRecycle[veinRecycleCursor]
    veinAnimPool[veinCursor] {
        float time
        float prepare_length
        float working_length
        uint32_t state
        float power
    }
    CargoContainer
    CargoTraffic
    FactoryStorage
    PowerSystem
    FactorySystem
    PlanetTransport
    MonsterSystem
    PlatformSystem (version >= 1)
}

PlanetData
{
    int32_t modDataByteCount
    uint8_t modData[modDataByteCount]
    int32_t numVeinAmounts
    int64_t veinAmounts[numVeinAmounts]
    int32_t numVeinGroups
    veinGroups[numVeinGroups] {
        int32_t EVeinType type ()
        float pos_x
        float pos_y
        float pos_z
        int32_t count: Read, but then set to zero
        int64_t amount: Read, but then set to zero
    }
}

EntityData
{
    uint8_t version = 0
    int32_t id
    int16_t protoId
    int16_t modelIndex
    float pos_x
    float pos_y
    float pos_z
    float rot_x
    float rot_y
    float rot_z
    float rot_w
    int32_t beltId
    int32_t splitterId
    int32_t storageId
    int32_t tankId
    int32_t minerId
    int32_t inserterId
    int32_t assemblerId
    int32_t fractionateId
    int32_t ejectorId
    int32_t siloId
    int32_t labId
    int32_t stationId
    int32_t powerNodeId
    int32_t powerGenId
    int32_t powerConId
    int32_t powerAccId
    int32_t powerExcId
    int32_t monsterId
}

PrebuildData
{
    uint8_t version = 0
    int32_t id
    int16_t protoId
    int16_t modelIndex
    float pos_x
    float pos_y
    float pos_z
    float rot_x
    float rot_y
    float rot_z
    float rot_w
    float pos2_x
    float pos2_y
    float pos2_z
    float rot2_x
    float rot2_y
    float rot2_z
    float rot2_w
    int32_t upEntity
    int16_t pickOffset
    int16_t insertOffset
    int32_t recipeId
    int32_t filterId
    int32_t refCount
    int32_t refArr[refCount]
}

VegeData
{
    uint8_t version = 0
    int32_t id
    int16_t protoId
    int16_t modelIndex
    int16_t hp
    float pos_x
    float pos_y
    float pos_z
    float rot_x
    float rot_y
    float rot_z
    float rot_w
    float scl_y
    float scl_z
    float scl_w
}

VeinData
{
    uint8_t version = 0
    int32_t id
    int16_t EVeinType (None, Iron, Copper, Silicium, Titanium, Stone, Coal, Oil, Fireice, Diamond, Fractal, Crysrub, Grat, Bamboo, Mag)
    int16_t modelIndex
    int16_t groupIndex
    int32_t amount
    int32_t productId
    float pos_x
    float pos_y
    float pos_z
    int32_t minerCount
    int32_t minerId0
    int32_t minerId1
    int32_t minerId2
    int32_t minerId3
}

CargoContainer
{
    int32_t version = 0
    int32_t poolCapacity
    int32_t cursor
    int32_t recycleBegin
    int32_t recycleEnd
    cargoPool[cursor] {
        int32_t item
        float position_x
        float position_y
        float position_z
        float rotation_x
        float rotation_y
        float rotation_z
        float rotation_w
    }
    int32_t recycleIds[poolCapacity]
}

CargoTraffic
{
    int32_t version = 0
    int32_t beltCursor
    int32_t beltCapacity
    int32_t beltRecycleCursor
    int32_t splitterCursor
    int32_t splitterCapacity
    int32_t splitterRecycleCursor
    int32_t pathCursor
    int32_t pathCapacity
    int32_t pathRecycleCursor
    BeltComponent beltPool[beltCursor - 1]
    int32_t beltRecycle[beltRecycleCursor]
    SplitterComponent splitterPool[splitterCursor - 1]
    int32_t splitterRecycle[splitterRecycleCursor]
    [pathCursor - 1] {
        int32_t cargoPathIndex
        CargoPath (cargoPathIndex != 0)
    }
    int32_t pathRecycle[pathRecycleCursor]
}

BeltComponent
{
    
}

SplitterComponent
{
    
}

CargoPath
{
    
}

FactoryStorage
{
    
}

PowerSystem
{
    
}

FactorySystem
{
    
}

PlanetTransport
{
    
}

MonsterSystem
{
    
}

PlatformSystem
{
    
}

DysonSphere
{
    
}
🍪 We use cookies to keep session information to provide you a better experience.