Files
Terrarum/work_files/DataFormats/just-json-it-saveformat.md
2021-08-25 11:16:21 +09:00

2.0 KiB

Following code is an example savegame JSON files.

savegame.json

{
    savename: "Test World 1",
    genver: 4, /* generator version in integer */
    terrseed: "84088805e145b555",
    randseed: "19b25856e1c150ca834cffc8b59b23ad",
    weatseed: "e5e72beb4e3c6926d3dc9e3e2ef7833b",
    playerid: 9545698,
    creation_t: <creation time in real-world unix time>,
    lastplay_t: <last play time in real-world unix time>,
    playtime_t: <total play time in real-world unix time>,
    thumb: <Ascii85-encoded gzipped thumbnail image in TGA>,
    
    blocks: <BlockCodex serialised>,
    items: <ItemCodex serialised>,
    itemd: <DynamicItems serialised>,
    wires: <WireCodex serialised>,
    fluids: <FluidCodex serialised>,
    materials: <MaterialCodex serialised>,
    loadorder: <LoadOrder serialised>,
    worlds: [1,2,6,7]
}

world1.json

File is named as "world"+world_index+".json". The fields are auto-generated by GDX's JSON serialiser.

{
    worldName: "New World",
    worldIndex: 1,
    width: 8192,
    height: 2048,
    spawnX: 4096,
    spawnY: 248,
    creationTime: 1629857065,
    lastPlayTime: 1629857065,
    totalPlayTime: 0,
    layerTerrain: {
        h: "a441b15fe9a3cf56661190a0b93b9dec7d04127288cc87250967cf3b52894d11",
        b: <Ascii85-encoded gzipped terrain layerdata>,
        x: 8192,
        y: 2048
    },
    layerWall: {
        h: <SHA-256 hash of 'b'>,
        b: <Ascii85-encoded gzipped wall layerdata>,
        x: 8192,
        y: 2048
    },
    wallDamages:{},
    terrainDamages: {},
    fluidTypes: {}
    fluidFills: {},
    wirings: {},
    wiringGraph: {},
    gravitation: {y:9.8}
    globalLight: {
        r:0.8826928,
        g:0.8901961,
        b:0.9055425,
        a:0.93691504
    },
    averageTemperature: 288,
    generatorSeed: 0,
    worldTime: 27874,
    tileNumberToNameMap: {}
}

actors.json

The fields are auto-generated by GDX's JSON serialiser.

{
    <actor id>: { actor serialised in JSON },
    ...
}