Giter Club home page Giter Club logo

ark-savegame-toolkit's People

Contributors

3p1cw0mb4t avatar qowyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ark-savegame-toolkit's Issues

NullPointerException when reading arkprofile and a possible fix (PrimalPlayerData was renamed).

Starting from patch 257.0, it seems like Ark renamed its PrimalPlayerData object, resulting in a null profile when reading .arkprofile files. It was renamed to PrimalPlayerDataBP_C

In ArkProfile.java:77 there is a check on class name,

  if (object.getClassString().equals("PrimalPlayerData")) {
    profile = object;
  }

For me it's fixed when I change it to:

  if (object.getClassString().equals("PrimalPlayerData") || object.getClassString().equals("PrimalPlayerDataBP_C")) {
    profile = object;
  }

I accept both to remain backwards compatible with older profiles. Profiles only get updated when someone logs on.

Hope it helps anyone using this awesome library!

Found Unknown Version

Hey,

i get the following error:
java.lang.UnsupportedOperationException: Found unknown Version 8827 at qowyn.ark.ArkSavegame.readBinaryHeader(ArkSavegame.java:183) at qowyn.ark.ArkSavegame.readBinary(ArkSavegame.java:158) at qowyn.ark.FileFormatBase.readBinary(FileFormatBase.java:30) at qowyn.ark.ArkSavegame.<init>(ArkSavegame.java:87) at qowyn.ark.tools.CreatureListCommands.listImpl(CreatureListCommands.java:111) at qowyn.ark.tools.CreatureListCommands.tamed(CreatureListCommands.java:65) at qowyn.ark.tools.App.main(App.java:125)

my command:
java -Xmx4G -jar ark-tools.jar tamed C:\Daten\ark\Ragnarok.json C:\Daten\ark\Tamed\

Is there any failure i made or is there a change in the version number handling?

Cause your code just handle versions lower than 10 but i got the version 8827 after .getShort()

Unsupported Version 9

Please change the following in qowyn/ark/ArkSavegame.java:

Line 168:
From:
} else if (saveVersion == 7) {
To:
} else if (saveVersion >= 7) {

Unfortunately im not able to build it myself because of Maven Errors and missing knowhow about it. I can't build a normal executable jar too because Eclipse seems to doesn't find the main method.

Error while reading world files for modded maps

I'm seeing this lately for some of my modded maps.
java.lang.UnsupportedOperationException: Found unexpected Value 2 at 1438
at qowyn.ark.ArkSavegame.readBinary(ArkSavegame.java:145)
at qowyn.ark.ArkSavegame.(ArkSavegame.java:78)
at qowyn.ark.tools.CreatureListCommands.listImpl(CreatureListCommands.java:109)
at qowyn.ark.tools.CreatureListCommands.wild(CreatureListCommands.java:67)
at qowyn.ark.tools.App.main(App.java:114)

It was working for the world, however, after a wild dino wipe, it stopped working, and still continues to not work even after players have logged into the world and the world has been re-launched and saved to see if it helps.

Here's the command arguments used:
wild \ark-3\ShooterGame\Saved\SavedArks\ShigoIslands.ark \Wild\ark-3\ -p --pretty-printing

Attached is one of the world files exhibiting the issue. Hope it helps.

ShigoIslands.zip

Dino levels represented...interestingly.

Hi Qowyn. Love what you've done here. I wanted to present an issue that you may already be aware of, regarding higher level dinos. Your tool is reporting some stats as a negative value for the levels in them. Here are a couple snaps:
[
{
"x":157322.6875,
"y":-280067.4375,
"z":-11064.4912109375,
"lat":15.0,
"lon":69.7,
"id":1077986394594013586,
"tamed":true,
"team":1384325564,
"color0":14,
"color2":14,
"color4":23,
"color5":27,
"tamedAtTime":219178.6412339434,
"tamedTime":427218.4212660566,
"tribe":"Masters of the Universe",
"tamer":"Masters of the Universe",
"baseLevel":1007,
"wildLevels":{
"health":-78,
"stamina":-82,
"food":-89,
"weight":-94,
"melee":-85,
"speed":-102
},
"fullLevel":1207,
"tamedLevels":{
"health":46,
"melee":-126,
"speed":24
},
"experience":1083787.75
},
{
"x":156987.890625,
"y":-280804.65625,
"z":-10840.4287109375,
"lat":14.9,
"lon":69.6,
"id":1645493759220551812,
"tamed":true,
"team":1384325564,
"female":true,
"color0":19,
"color2":19,
"color4":28,
"color5":29,
"tribe":"Masters of the Universe",
"tamer":"Masters of the Universe",
"name":"7th DRGN of the 7th DRGN",
"baseLevel":1165,
"wildLevels":{
"health":-59,
"stamina":-56,
"food":-65,
"weight":-64,
"melee":-56,
"speed":-72
},
"fullLevel":1365,
"tamedLevels":{
"health":31,
"melee":-87
},
"experience":1.2463515E7
},
{
"x":155366.71875,
"y":-281359.0,
"z":-10874.7412109375,
"lat":14.8,
"lon":69.4,
"id":1861908537070598845,
"tamed":true,
"team":1384325564,
"color0":14,
"color2":14,
"color4":28,
"color5":27,
"tamedAtTime":643607.8628289737,
"tamedTime":2789.1996710263193,
"tribe":"Masters of the Universe",
"imprinter":"Letoric",
"baseLevel":1063,
"wildLevels":{
"health":-78,
"stamina":-56,
"food":-89,
"weight":-64,
"melee":-85,
"speed":-102
}
},
{
"x":155571.609375,
"y":-281297.90625,
"z":-10900.8984375,
"lat":14.8,
"lon":69.4,
"id":739668277274827871,
"tamed":true,
"team":1384325564,
"color0":19,
"color2":19,
"color4":23,
"color5":29,
"tamedAtTime":644981.7407703251,
"tamedTime":1415.3217296749353,
"tribe":"Masters of the Universe",
"imprinter":"Letoric",
"baseLevel":1106,
"wildLevels":{
"health":-59,
"stamina":-56,
"food":-65,
"weight":-94,
"melee":-85,
"speed":-72
}
},
{
"x":155552.3125,
"y":-281499.8125,
"z":-10862.3896484375,
"lat":14.8,
"lon":69.4,
"id":1374381456186734312,
"tamed":true,
"team":1384325564,
"color0":14,
"color2":14,
"color4":23,
"color5":27,
"tamedAtTime":646286.7964395136,
"tamedTime":110.26606048643589,
"tribe":"Masters of the Universe",
"imprinter":"Letoric",
"baseLevel":1036,
"wildLevels":{
"health":-78,
"stamina":-82,
"food":-89,
"weight":-94,
"melee":-56,
"speed":-102
}
}
]

As you can see, several values have negative values. These are not stats that exceed the 255 levels in a stat, they persist through reboots. They are high level, as you can see. Is there any other information I can provide you to help you diagnose/resolve this?

Thanks!

Error in UUID reading logic

Concerning GameObject.java line 322 ff.

public void readBinary(ArkArchive archive) {
    long highOfHigh = archive.getInt();
    long lowOfHigh = archive.getInt();
    long high = (highOfHigh << 32) + lowOfHigh;
    long highOfLow = archive.getInt();
    long lowOfLow = archive.getInt();
    long low = (highOfLow << 32) + lowOfLow;

    uuid = uuidCache.computeIfAbsent(new UUID(high, low), uuid -> uuid);

In case archive.getInt() returns a negative integer, then storing it as long the upper 32 bits are set to 1. This doesn't matter for both highOfHigh and highOfLow because these 1 bits are shifted away. But adding such a negative number in lowOfHigh or lowOfLow it gives a slighlty wrong result. Changing the type of lowOfHigh and lowOfLow to int isn't the solution, because they seem to be converted to long (with the upper 32 bits set to 1) before the addition takes place. The following code (same for the Low part) seems to do it right:

    long highOfHigh = archive.getInt();
    int lowOfHigh = archive.getInt();
    long high = (highOfHigh << 32) | (lowOfHigh & 0xffffffffL);

First getting rid of the upper 32 bits (which will be added because lowOfHigh is implicitly typecasted to long), then doing a bitwise OR, not an addition which was also semantically questionable.

For example if high is -1496803910 and low is -550970168 then the result is -6428723842525897528 but has to be -6428723838230930232. You can see it better in hex:
high A6C895BA‬,
low ‭DF28DCC8‬,
the result of the addition is ‭A6C895B9 DF28DCC8‬. Note the 9 instead of A at the end of the high part.


Another thing, the writeBinary() method writes the UUID in a different way than the readBinary() reads it:

      archive.putLong(uuid.getMostSignificantBits());
      archive.putLong(uuid.getLeastSignificantBits());

Because the file is written Little-Endian (and ArkArchive uses this byte order) the values from above are in the file as BA 95 C8 A6‬ - C8‬ DC 28 DF. It is read in two parts (marked by the dash) with the higher part first. But written as long the second and lower part is written first: C8‬ DC 28 DF - BA 95 C8 A6‬.

Additionally a GUID in the Microsoft world is written in a scrambled way. The GUID 00010203-0405-0607-0809-0A0B0C0D0E0F converted to a byte array (using C#) results into this order: 03 02 01 00 05 04 07 06 08 09 0A 0B 0C 0D 0E 0F. So I assume that reading it as four 32 bit parts isn't the right way at all. However it doesn't matter for the game if the GUIDs are treated a different way but equally.

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.