diff --git a/dev/index.html b/dev/index.html index 510269d..a92b575 100644 --- a/dev/index.html +++ b/dev/index.html @@ -52,7 +52,7 @@ Welcome to the Wynnbuilder page for developers! Here we provide documentation and specifications for our website. Read through these sections to learn more about how WynnBuilder works! -
+

This section is about the encoding schemes Wynnbuilder uses for its various saveable items (builds, crafted items, and custom items). @@ -80,6 +80,27 @@ 1337 = 0 * 4096 + 20 * 64 + 57, 0 maps to 0, 20 maps to K, and 57 maps to v.

+

+ Decoding is a little different. We can either interpret the base 64 string as a signed or unsigned number (signed: using 2s complement binary). +

+

+ Things that should be interpreted as signed are: +

+ +

+ Things that should be interpreted as unsigned are: +

+

Now that we understand the base 64 system, we can move on to the way builds, crafted items, and custom items are stored in links. @@ -104,22 +125,267 @@ powder and then 5 elements with 6 tiers of powder for each element. We will know how many available powder slots we have based on our equipment. We can then put all of these numbers in a specific order (after running Base 64 encoding) to get our build link.

+
+

+ For items, you can download the item DB here: clean.json. Each item has an id value that can be put in a map. The NoneItem ID numbers start at 10000 in the canonical order: [helmet, chestplate, leggings, boots, ring 1, ring 2, bracelet, necklace, weapon]. +

+

+ For tomes, you can download the tome DB here: tomes.json. Each tome has a tomeID value that can be put in a map. The NoneTome ID numbers start at 61 in the order [no weapon tome, no armor tome, no guild tome] so that we can store tome IDs in 1 Base 64 character. +

+

+ For powders: id numbers 1 through 30 map to Earth I, Earth II, ..., Earth VI, + etc. in the order Earth, Thunder, Water, Fire, Air. 0 is the id number for no powder. +

+

All build links will end in "#[version number]_[build hash]".

- - - +

+ Version 6 was made to account for the desire to save tomes in a build. As of the last version of this documentation, version 6 is used for encoding whenever there are tomes in the build. +

+
+ + https://hppeng-wynn.github.io/builder/#6_06W2SH0D40Qq2SK2SL02d0og0Qi191V-E0i2C1g0000100nZ6ZU6FCDo + +

+ Build hash format: +

+
    +
  • + 9 items from idMap (3 characters each): + 06W, + 2SH, + 0D4, + 0Qq, + 2SK, + 2SL, + 02d, + 0og, + 0Qi +
  • +
  • + 5 skill point totals (2 characters each): + 19, + 1V, + -E, + 0i, + 2C +
  • +
  • + 1 player level (2 characters): + 1g +
  • +
  • + A variable number of powder "blocks" (5 characters which give us 6 powders per block). +
      +
    • For each of the 5 powderable equipment fields [helmet, chestplate, leggings, boots, weapon], we will have the following:
    • +
    • 1 base 64 character that says that we need n blocks for this item.
    • +
    • n blocks of 5 base 64 characters.
    • +
    • + Since there are 4 0s (Base 64 0 = 0 unsigned) in this example, we have no powders on any of the armor piece (no blocks). +
    • +
    • + Then, we have 1 (Base 64 1 = 1 unsigned). There is 1 block of powders to decode for the weapon item. That is 00nZ6. +
    • +
        +
      • The unsigned equivalent of 00nZ6 in binary is 30 binary bits long (omitted). Each section of 5 bits directly corresponds to an powder ID.
      • +
      +
    +
  • +
  • + 7 tomes (1 character each): + ZU6FCDo +
      +
    • The order of tomes listed is [2x weapon tome, 4x armor tome, 1x guild tome].
    • +
    +
  • +
+

- + Version 5 was made to allow for the ability to save custom items. To learn the specifics about custom item encoding, refer to the Custom Items section. +

+

+ As of the last version of this documentation, version 5 is only used for encoding when there are custom items (and no tomes) in the build. +

+
+ + http://hppeng-wynn.github.io/builder/#5_06W00mCI-10000JCustom%20Chestplate0220510G020Fe0M0201a0D40Qq2SK2SL02d0og0Qi191V-E0i2C1g0000100nZ6zz++++- + +

+ Build Hash format: +

+
    +
  • + 9 items from idMap (3 characters each): + 06W, + CI-10000JCustom%20Chestplate0220510G020Fe0M0201a, + 0D4, + 0Qq, + 2SK, + 2SL, + 02d, + 0og, + 0Qi +
      +
    • Starting in this version, you can substitute in the full hash of a custom item ("CI-[gibberish]") for the 3-character hash of an item pool item, just like for crafted items.
    • +
    • Similar to crafted items, the way we can tell that an item is a custom item is when the 3-character hash of the 'item' is "CI-". No existing item has an item ID of "CI-" in base 64, so we can define a special case check for this "id number".
    • +
    • Further details on parsing and loading this custom item are in the Custom Item section.
    • +
    +
  • +
  • + 5 skill point totals (2 characters each): + 19, + 1V, + -E, + 0i, + 2C +
  • +
  • + 1 player level (2 characters): + 1g +
  • +
  • + A variable number of powder "blocks" (5 characters which give us 6 powders per block). +
      +
    • For each of the 5 powderable equipment fields [helmet, chestplate, leggings, boots, weapon], we will have the following:
    • +
    • 1 base 64 character that says that we need n blocks for this item.
    • +
    • n blocks of 5 base 64 characters.
    • +
    • + Since there are 4 0s (Base 64 0 = 0 unsigned) in this example, we have no powders on any of the armor piece (no blocks). +
    • +
    • + Then, we have 1 (Base 64 1 = 1 unsigned). There is 1 block of powders to decode for the weapon item. That is 00nZ6. +
    • +
        +
      • The unsigned equivalent of 00nZ6 in binary is 30 binary bits long (omitted). Each section of 5 bits directly corresponds to an powder ID.
      • +
      +
    +
  • +
+
+

+ It is possible that version 5 links will have an extra tome section at the end like above (see: Version 6 section). We ignore this in decoding.

- + Version 4 was made to allow for the ability to save crafted items. To learn the specifics about crafted item encoding, refer to the Crafted Items section. +

+

+ As of the last version of this documentation, version 4 is the default version and is used when there are no custom items or tomes in the build. +

+
+ + http://hppeng-wynn.github.io/builder/#4_06W2SH0D40Qq2SK2SL02d0og0Qi191V-E0i2C1g0000100nZ6zz++++- + +

+ Build Hash format: +

+
    +
  • + 9 items from idMap (3 characters each): + 06W, + 2SH, + 0D4, + 0Qq, + 2SK, + 2SL, + 02d, + 0og, + 0Qi +
  • +
  • + 5 skill point totals (2 characters each): + 19, + 1V, + -E, + 0i, + 2C +
  • +
  • + 1 player level (2 characters): + 1g +
  • +
  • + A variable number of powder "blocks" (5 characters which give us 6 powders per block). +
      +
    • For each of the 5 powderable equipment fields [helmet, chestplate, leggings, boots, weapon], we will have the following:
    • +
    • 1 base 64 character that says that we need n blocks for this item.
    • +
    • n blocks of 5 base 64 characters.
    • +
    • + Since there are 4 0s (Base 64 0 = 0 unsigned) in this example, we have no powders on any of the armor piece (no blocks). +
    • +
    • + Then, we have 1 (Base 64 1 = 1 unsigned). There is 1 block of powders to decode for the weapon item. That is 00nZ6. +
    • +
        +
      • The unsigned equivalent of 00nZ6 in binary is 30 binary bits long (omitted). Each section of 5 bits directly corresponds to an powder ID.
      • +
      +
    +
  • +
+
+
+ + https://hppeng-wynn.github.io/builder/#4_06WCR-1628i8v8v94948f210D40Qq2SK2SL02d0og0Qi1Q1V-E0l2C1g0000100nZ6zz++++- + +

+ Build Hash format: +

+
    +
  • + 9 items from idMap (3 characters each): + 06W, + CR-1628i8v8v94948f21, + 0D4, + 0Qq, + 2SK, + 2SL, + 02d, + 0og, + 0Qi +
      +
    • Starting in this version, you can substitute in the full hash of a crafted item ("CR-[gibberish]") for the 3-character hash of an item pool item.
    • +
    • The way we can tell that an item is a crafted item is when the 3-character hash of the 'item' is "CR-". No existing item has an item ID of "CR-" in base 64, so we can define a special case check for this "id number".
    • +
    • Further details on parsing and loading this custom item are in the Crafted Item section.
    • +
    +
  • +
  • + 5 skill point totals (2 characters each): + 19, + 1V, + -E, + 0i, + 2C +
  • +
  • + 1 player level (2 characters): + 1g +
  • +
  • + A variable number of powder "blocks" (5 characters which give us 6 powders per block). +
      +
    • For each of the 5 powderable equipment fields [helmet, chestplate, leggings, boots, weapon], we will have the following:
    • +
    • 1 base 64 character that says that we need n blocks for this item.
    • +
    • n blocks of 5 base 64 characters.
    • +
    • + Since there are 4 0s (Base 64 0 = 0 unsigned) in this example, we have no powders on any of the armor piece (no blocks). +
    • +
    • + Then, we have 1 (Base 64 1 = 1 unsigned). There is 1 block of powders to decode for the weapon item. That is 00nZ6. +
    • +
        +
      • The unsigned equivalent of 00nZ6 in binary is 30 binary bits long (omitted). Each section of 5 bits directly corresponds to an powder ID.
      • +
      +
    +
  • +
+
+

+ It is possible that version 4 links will have an extra tome string like above (see: Version 6 section) after the powders. You can ignore this in decoding.

@@ -142,6 +408,9 @@
+

+ http://localhost:8000/builder/#5_06W02hCI-10000HMeta%20Chestplate010Gbest%20in%20slot0240401030510G0302SG0H020Fe0I020Fe0J020Fe0K020Fe0L020Fe0M0201Y0i0200U220z0204iKK150200U22160200U22170200U22180200U22190200U220D40Qq2SK2SL02d0og0Qi191V-E0i2C1g0000100nZ6zz++++- +

diff --git a/js/sq2builder.js b/js/sq2builder.js index fc42f6d..0596f6d 100644 --- a/js/sq2builder.js +++ b/js/sq2builder.js @@ -120,10 +120,11 @@ function getTomeNameFromID(id) { function parsePowdering(powder_info) { // TODO: Make this run in linear instead of quadratic time... ew let powdering = []; + console.log(powder_info); for (let i = 0; i < 5; ++i) { let powders = ""; let n_blocks = Base64.toInt(powder_info.charAt(0)); - // console.log(n_blocks + " blocks"); + console.log(n_blocks + " blocks"); powder_info = powder_info.slice(1); for (let j = 0; j < n_blocks; ++j) { let block = powder_info.slice(0,5); @@ -241,9 +242,7 @@ function decodeBuild(url_tag) { //tome values do not appear in anything before v6. for (let i = 0; i < 7; ++i) { let tome_str = info[1].charAt(i); - for (let i in tomes) { - setValue(tomeInputs[i], getTomeNameFromID(Base64.toInt(tome_str))); - } + setValue(tomeInputs[i], getTomeNameFromID(Base64.toInt(tome_str))); } info[1] = info[1].slice(7); }