m
no edit summary
imported>76561198054818918 (Array size correction in FactoryProductionStat.) |
imported>76561198045853337 mNo edit summary |
||
(24 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
This page defines the Dyson Sphere Program save file format .dsv. On Windows by default save files are stored in <code>%USERPROFILE%\Documents\Dyson Sphere Program\Save\</code>. | |||
Return to [[Modding:Modding|Modding Hub]]. | |||
A save file parser in C++ written to the specification below is available on GitHub: [https://github.com/GreyHak/dsp-save-parser github.com/GreyHak/dsp-save-parser]. | |||
<syntaxhighlight lang="csharp"> | <syntaxhighlight lang="csharp"> | ||
float oilSpeedMultiplier = 4E-05f | |||
GameSave | GameSave | ||
{ | { | ||
Line 36: | Line 40: | ||
PlanetFactory[factoryCount] | PlanetFactory[factoryCount] | ||
int32 galaxyStarCount: Must equal GameDesc::starCount or the game will crash. | int32 galaxyStarCount: Must equal GameDesc::starCount or the game will crash. | ||
[galaxyStarCount] { | |||
[ | |||
int32 dysonSphereDataIsAvailableFlag: Must be 0 or 1 or the game will crash. | int32 dysonSphereDataIsAvailableFlag: Must be 0 or 1 or the game will crash. | ||
DysonSphere (dysonSphereDataIsAvailableFlag == 1) | DysonSphere (dysonSphereDataIsAvailableFlag == 1) | ||
Line 178: | Line 181: | ||
int32 numTotal: Saved as 7. Reads more or less, but only stores up to 7, and enforces abs. | int32 numTotal: Saved as 7. Reads more or less, but only stores up to 7, and enforces abs. | ||
int64 total[numCount] | int64 total[numCount] | ||
} | } | ||
Line 188: | Line 190: | ||
float position_y | float position_y | ||
float position_z | float position_z | ||
double uPosition_x | |||
double uPosition_y | |||
double uPosition_z | |||
float uRotation_x | float uRotation_x | ||
float uRotation_y | float uRotation_y | ||
Line 204: | Line 206: | ||
int32 inhandItemCount | int32 inhandItemCount | ||
Mecha | Mecha | ||
StorageComponent package | StorageComponent package | ||
PlayerNavigation | PlayerNavigation | ||
int32 sandCount | int32 sandCount | ||
Line 218: | Line 220: | ||
double reactorEnergy | double reactorEnergy | ||
int32 reactorItemId | int32 reactorItemId | ||
StorageComponent reactorStorage | StorageComponent reactorStorage | ||
StorageComponent warpStorage | StorageComponent warpStorage | ||
double walkPower | double walkPower | ||
Line 401: | Line 403: | ||
VeinData veinPool[veinCursor - 1] | VeinData veinPool[veinCursor - 1] | ||
int32 veinRecycle[veinRecycleCursor] | int32 veinRecycle[veinRecycleCursor] | ||
veinAnimPool[veinCursor] { | veinAnimPool[veinCursor - 1] { | ||
float time | float time | ||
float prepare_length | float prepare_length | ||
Line 423: | Line 425: | ||
uint8 modData[modDataByteCount] | uint8 modData[modDataByteCount] | ||
int32 numVeinAmounts | int32 numVeinAmounts | ||
int64 veinAmounts[numVeinAmounts] | int64 veinAmounts[numVeinAmounts]: The index is the EVeinType. This contains the total of the veinGroups's amounts which is also the total of the VeinData::amounts. | ||
int32 numVeinGroups | int32 numVeinGroups | ||
veinGroups[numVeinGroups] { | veinGroups[numVeinGroups] { | ||
Line 630: | Line 632: | ||
int32 numBelts | int32 numBelts | ||
int32 numInputPaths | int32 numInputPaths | ||
chunks[chunkCount] | uint8 buffer[bufferLength] | ||
int32 chunks[chunkCount * 3] | |||
[bufferLength] { | [bufferLength] { | ||
float pointPos_x | float pointPos_x | ||
Line 663: | Line 662: | ||
int32 tankCursor | int32 tankCursor | ||
int32 tankRecycleCursor | int32 tankRecycleCursor | ||
TankComponent tankPool[tankCursor] | TankComponent tankPool[tankCursor - 1] | ||
int32 tankRecycle[tankRecycleCursor] | int32 tankRecycle[tankRecycleCursor] | ||
} | } | ||
Line 712: | Line 711: | ||
int32 accRecycleCursor | int32 accRecycleCursor | ||
PowerAccumulatorComponent accPool[accCursor - 1] | PowerAccumulatorComponent accPool[accCursor - 1] | ||
int32 accRecycle | int32 accRecycle[accRecycleCursor] | ||
int32 exchangerCapacity | int32 exchangerCapacity | ||
int32 excCursor | int32 excCursor | ||
Line 1,156: | Line 1,155: | ||
int32 idleDroneCount | int32 idleDroneCount | ||
int32 workDroneCount | int32 workDroneCount | ||
int32 | int32: Used for allocating array sizes for workDroneDatas and workDroneOrders, and not uses for read in the arrays. | ||
DroneData workDroneDatas[ | DroneData workDroneDatas[workDroneCount] | ||
LocalLogisticOrder workDroneOrders[ | LocalLogisticOrder workDroneOrders[workDroneCount] | ||
int32 idleShipCount | int32 idleShipCount | ||
int32 workShipCount | int32 workShipCount | ||
uint64 idleShipIndices | uint64 idleShipIndices | ||
uint64 workShipIndices | uint64 workShipIndices | ||
int32: Used for allocating array sizes for workShipDatas, shipRenderers, shipUIRenderers, workShipOrders, | int32: Used for allocating array sizes for workShipDatas, shipRenderers, shipUIRenderers, workShipOrders, and not uses for read in the arrays. | ||
ShipData workShipDatas[workShipCount] | ShipData workShipDatas[workShipCount] | ||
RemoteLogisticOrder workShipOrders[workShipCount] | RemoteLogisticOrder workShipOrders[workShipCount] | ||
Line 1,294: | Line 1,293: | ||
int32 monsterCursor | int32 monsterCursor | ||
int32 monsterRecycleCursor | int32 monsterRecycleCursor | ||
MonsterComponent monsterPool[monsterCursor] | MonsterComponent monsterPool[monsterCursor - 1] | ||
int32 monsterRecycle[monsterRecycleCursor] | |||
} | } | ||
Line 1,338: | Line 1,338: | ||
int32 layerCount | int32 layerCount | ||
int32 numDysonSphereLayer | int32 numDysonSphereLayer | ||
[numDysonSphereLayer] { | [numDysonSphereLayer - 1] { | ||
int32 dysonSphereLayerIndex | int32 dysonSphereLayerIndex | ||
DysonSphereLayer (dysonSphereLayerIndex != 0) | DysonSphereLayer (dysonSphereLayerIndex != 0) | ||
Line 1,359: | Line 1,359: | ||
int32 nrdCursor | int32 nrdCursor | ||
int32 nrdRecycleCursor | int32 nrdRecycleCursor | ||
DysonNodeRData nrdPool[nrdCursor] | DysonNodeRData nrdPool[nrdCursor - 1] | ||
int32 nrdRecycle[nrdRecycleCursor] | int32 nrdRecycle[nrdRecycleCursor] | ||
} | } | ||
Line 1,393: | Line 1,393: | ||
int32 orbitCapacity | int32 orbitCapacity | ||
int32 orbitCursor | int32 orbitCursor | ||
SailOrbit orbits[orbitCursor] | SailOrbit orbits[orbitCursor - 1] | ||
int32 numExpiryOrder: Must match sailCapacity or the game will crash. | int32 numExpiryOrder: Must match sailCapacity or the game will crash. | ||
int32 expiryCursor | int32 expiryCursor | ||
Line 1,588: | Line 1,588: | ||
int32 numVertcps | int32 numVertcps | ||
int32 vertcps[numVertcps] | int32 vertcps[numVertcps] | ||
int32 | int32 vertRecycleArraySize | ||
int32 vertRecycle[ | int32 vertRecycleCursor | ||
int32 vertRecycle[vertRecycleCursor] | |||
} | } | ||
Line 1,601: | Line 1,602: | ||
float t | float t | ||
float uSpeed | float uSpeed | ||
double uPos_x | |||
double uPos_y | |||
double uPos_z | |||
float uRot_x | float uRot_x | ||
float uRot_y | float uRot_y | ||
Line 1,632: | Line 1,633: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Modding Navbox}} | |||
[[Category:Modding]] |