PBug90 / w3gjs

A native JavaScript WarCraft 3 replay parser implementation.
MIT License
44 stars 17 forks source link

Hero Levels bugged #74

Closed Stowkabruh closed 2 years ago

Stowkabruh commented 3 years ago

The parser was used here https://warcraft3.info/replays/50537 For some reason it shows Keeper of the Grove at Level 19. The actual level was 6. There was no Tome of Retraining used. Replay link if you need it: replay.zip

PBug90 commented 3 years ago

This has got to do with the amount of actions sent over the network by the player. In this case a lot of Tranqulity-Heroskill-Actions were sent, probably because the player spammed the button in a fight and also had connection issues at the same time. This resulted in a sequence of Heroskill-Orders being recorded in short time intervals as visible in the JSON below.

    "level": 19,
    "abilities": {
      "AEfn": 2,
      "AEer": 3,
      "AEtq": 14
    },
    "id": "Ekee",
    "abilityOrder": [
      {
        "type": "ability",
        "time": 126467,
        "value": "AEfn"
      },
      {
        "type": "ability",
        "time": 178541,
        "value": "AEer"
      },
      {
        "type": "ability",
        "time": 534905,
        "value": "AEfn"
      },
      {
        "type": "ability",
        "time": 1016408,
        "value": "AEer"
      },
      {
        "type": "ability",
        "time": 1907059,
        "value": "AEer"
      },
      {
        "type": "ability",
        "time": 2091683,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2093068,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2093226,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2093357,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2093505,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2093617,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2093738,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2093847,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2094002,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2094137,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2094271,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2094393,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2094526,
        "value": "AEtq"
      },
      {
        "type": "ability",
        "time": 2094671,
        "value": "AEtq"
      }
    ],
    "retrainingHistory": []
  }

One solution would be to assert the hero ability and deduce that the ultimate ability can only be skilled once. Nevertheless, for normal spells it can be hard to determine a correct sequence, for example if a warden spends all her skillpoints in rapid succession when hitting level 3. It seems reasonable that the parser caps the ultimate ability at 1 and standard abilities at 3 to determine hero levels (not including tome of retraining usage).

PBug90 commented 3 years ago

Issue will be tracked in #75

PBug90 commented 2 years ago

Fixed in 2.4.3