Git Product home page Git Product logo

ark-sa-save-tools's Introduction

Ark: Survival Ascended Save Tools

This library parses Ark: Survival Ascended world files (.ark), tribe files (.arktribe) and player files (*.arkprofile).

Usage

As the code is in an incomplete and unstable state, usage is only recommended for experienced developers. The implementation can change drastically at any moment.

Reading *.ark save files

See ArkSaSaveDatabase for a starting point.

Example usage (reads all objects with 'Character_BP_C' in their blueprint path, and outputs both binary and json formatted files):

try (ArkSaSaveDatabase arkSaSaveDatabase = new ArkSaSaveDatabase(new File("c:\\tmp\\TheIsland_WP.ark"))) {
    GameObjectReaderConfiguration readerConfiguration = GameObjectReaderConfiguration.builder()
            .blueprintNameFilter(name -> name.isPresent() && name.get().contains("Character_BP_C"))
            .binaryFilesOutputDirectory(Path.of("c:\\tmp\\out\\bin"))
            .jsonFilesOutputDirectory(Path.of("c:\\tmp\\out\\json"))
            .build();

    Map<UUID, ArkGameObject> objects = arkSaSaveDatabase.getGameObjects(readerConfiguration);
    log.info("Found {} objects", objects.size());
} catch(Exception e) {
    log.error("Something bad happened!", e);
    throw new RuntimeException("Failed to read save file", e);
}

Reading *.arktribe files

See ArkTribe as a starting point

try {
    ArkTribe arkTribe = new ArkTribe(path);
    String tribeName = arkTribe.getTribe()
            .getPropertyValue("TribeData", ArkPropertyContainer.class)
            .flatMap(tribeData -> tribeData.getPropertyValue("TribeName", String.class))
            .orElse(null);

    log.info("Tribe name: {}", tribeName);
    JsonUtils.writeJsonToFile(arkTribe, Path.of(path.toString().replace(".arktribe", ".json")));
} catch (Exception e) {
    log.error("Could not read tribe " + path, e);
}

Reading *.arkprofile files

See ArkProfile as a starting point

try {
    ArkProfile arkProfile = new ArkProfile(path);
    String playerName = arkProfile.getProfile()
            .getPropertyValue("MyData", ArkPropertyContainer.class)
            .flatMap(myData -> myData.getPropertyValue("PlayerName", String.class))
            .orElse(null);

    log.info("Player name: {}", playerName);
    JsonUtils.writeJsonToFile(arkProfile, Path.of(path.toString().replace(".arkprofile", ".json")));
} catch (Exception e) {
    log.error("Could not read profile " + path, e);
}

Reading Cryopod data

Reading Cryopod data is a bit more complex, but can be done. See src/test/java/TestCryopods.java for a starting point.

Help?

My time is limited, so I might not be able to provide extended support for using this library. But you can join the Discord I created for this project to find like-minded people.

See https://discord.gg/by2q2Tqjyr

ark-sa-save-tools's People

Contributors

kakoen avatar

Stargazers

robert avatar  avatar  avatar Cokll avatar gleed avatar Steven avatar Tiia Aurora avatar  avatar

Watchers

 avatar

Forkers

aliig

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.