Skip to content
This repository was archived by the owner on Jul 14, 2019. It is now read-only.
This repository was archived by the owner on Jul 14, 2019. It is now read-only.

Accounting for action queueing  #11

@KennethSundqvist

Description

@KennethSundqvist

As I was working on implementing turns I noticed that zone changes would sometimes happen out of order with turn changes. It is not a problem if you always let the game execute all actions before you instruct it to perform the next action, but it doesn't work when you queue up multiple actions.

Here is an example you can try with the current implementation using the game-over event:

  1. Have a minion on the board
  2. Buff the minion with several spells and then make it attack the opposing hero so the hero dies from the attack, do it very quickly so the game has only applied the first spell when you're done queueing everything
  3. The log parser will now detect and emit the game-over event before the zone-change events

I use two regexps for detecting turn changes, and they work very well:

  • Detect next turn number: /GameEntity tag=TURN value=(\d+)$/
  • Detect next turn start: /Entity=(.+) tag=TURN_START/

The main issue is that the parser does not keep track of queuing like the game does. This is very noticeable when parsing games against the computer, which always queues all actions very fast.

If this parser should grow and implement more events, like turn changes, it must handle queueing, and it should do so right away so it's easier to extend it without having to refactor the detection all the time.

Unfortunately I don't have the time to work on this right now, but I thought I'd share these findings so others can benefit from them and continue the detective work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions