{
  "version": 1,
  "canonical": "https://xaede.net/writing/world-of-warcraft",
  "title": "World of Warcraft",
  "description": "Building Combat Performance Reports from World of Warcraft logs: parsing events, constructing statistics and turning a player’s questions into a data-processing problem.",
  "language": "en",
  "manifest": "https://xaede.net/representations/index.json",
  "contentHtml": "<article class=\"reading-page\"><header class=\"reading-header\"><nav class=\"page-breadcrumb\" aria-label=\"Breadcrumb\"><ol><li><a href=\"/\">Home</a></li><li><a href=\"/writing\">Writing</a></li><li><span aria-current=\"page\">World of Warcraft</span></li></ol></nav><div class=\"article-label\"><span>Archive edition / Legacy Xaede</span><time datetime=\"2009-07-22\">July 22, 2009</time><span>6 MIN READ</span></div><h1>World of Warcraft</h1><p class=\"byline\"><a href=\"/about\" rel=\"author\">Josh English</a></p><p class=\"edition-note\">From the original Xaede archive. This is historical writing, preserved in a new reading edition. Technical advice, tools and project status reflect the time of publication.</p></header><div class=\"reading-body prose\"><p>The concept behind the Combat Performance Reports – <a href=\"http://www.wowcpr.com\" rel=\"noopener noreferrer\">www.wowcpr.com</a>.</p>\n<p>A friend of mine is an avid <a href=\"http://www.worldofwarcraft.com\" rel=\"noopener noreferrer\">World of Warcraft</a> player that has been a long-time fan of both the game as well as reviewing statistics about his game-play. He had been paying for some online 3rd-party services to generate statistical reports from his game combat logs, and he felt that the services he was paying for were becoming stagnant. He began looking for alternative solutions to his game-play performance analytical needs, and determined that the existing websites that provide these services were either difficult to use or simply not reporting the information that he was looking for. He and I decided to work together to create our own website to fulfill this need. This article is a description of the summarization engine I created to populate the RDBMS database that powers the corresponding website – <a href=\"http://www.wowcpr.com\" rel=\"noopener noreferrer\">www.wowcpr.com</a>.</p>\n<p><figure><img src=\"/media/legacy-4405ef791b-wowcprss01.jpg\" alt=\"wowcprss01\" loading=\"lazy\"></figure></p>\n<p>The data-summarization engine in overview parses a World of Warcraft combat log into a series of events from which it creates a series of statistical summaries that are then inserted into the database. In order to rapidly develop this application, I began by using my rapid application development (RAD) framework – Project Asgard (www.projectasgard.org).</p>\n<p>I wanted to be able to read the data from the combat logs very quickly so I first implemented a background thread that performed optimized reads on the log file and placed the data into an in-memory buffer – i.e. a read-ahead system - that I could parse events from.</p>\n<p>I next created a component that could recognize every event type from the combat log, and turn each event into a structure that could be analyzed by higher application layers. To validate these event data structures I created a managed set of b+tree indexes that contained every known player spell, power, event type, event-attribute type, and character classes. I then utilized these indexes to validate every event read from the combat log so that a known data-set will be analyzed by the higher application layers, which made the logic implementation predictive as well as mitigating the garbage-in-garbage-out effect.</p>\n<p>Given that I didn’t want to store all of this meta-data in code or configuration files, I created a simple SQL database schema to store both the meta-data as well as the set of statistical summaries I wanted to generate. I determined the summaries by creating a simple spreadsheet of each game-play event, and determined what the various event commonalties are. For example, the Spell Heal, Spell Period Heal, and Spell Leech events all can contribute to the Healing summary. From which, I created a simple SQL API, with a plug-in for the RDMBS I chose to implement the project with, namely PostgreSQL. I next began the implementation of a data-access layer for the specific application-layer touch-points to the database.</p>\n<p>I also added a simple system to turn any given event into a unique key so that I could persist event-indexes to an ISAM database for automated log-event merging. How this works is when the engine detects an existing index when processing an event, it performs an SQL lookup of the existing statistical summary or summaries that the event contributed too, and then retains the summary in-memory for application of summary-updates with any additional contributing events the engine discovers later in the log file.</p>\n<p>Since a given log file may contain multiple game-play scenarios, such as raids, boss fights, or multiple days worth of play, I created a trigger system to partition each the log file into multiple child summarizations as well as the main log-file summary. The trigger system is designed as a state engine to reflect the current state of the game. From this, the various triggers will automatically activate based upon changes in the state machine, which is set based upon events parsed from the log file.</p>\n<p>For each character noted by the engine (including players, pets, and NPCs) a unique summary record is created for the log file as well as each child-summary noted by the trigger system. This summary contains general information about character, including the character’s name, GUID, class and number of seconds spent playing the game.</p>\n<p>Finally, I created a simple framework that allowed me to contain multiple summary types, indexed by both the character that initiated the event, as well as the character the event effected. From this framework any summary can be added dynamically by the engine as events parsed from the log file are considered. Once the summarization engine completes parsing of the file, the summaries are obtained from the framework, and inserted into the database for each game-play scenario determined by the trigger system, as well as the full log summary. For any summary that was obtained from the database during for automated log-merging, any summary that had an update applied to it is then updated, and a meta-record is created in the database noting that the parsed log file contributed data to the updated summary.</p>\n<p>Here is an example of what the engine reports once it has completed processing a log file:</p>\n<pre>-=-=-=-=-=-=-=-=- WoW CPR Processing Report -=-=-=-=-=-=-=-=-\n[CprReport] file statistics:\n[CprReport]      name                   : wowstats.testfile\n[CprReport]      owner                  : [email]@[domain]\n[CprReport]      region code            : US\n[CprReport]      realm name             : Draenor\n[CprReport]      realm ID               : 0\n[CprReport]      event year             : 2009\n[CprReport]      event type             : Raid\n[CprReport]      byte length            : 9701594\n[CprReport]      line count             : 65537\n[CprReport]      invalid lines          : 0 (0.00 %)\n[CprReport]      avg bytes per line     : 148\n[CprReport]      processing time        : 3.771135\n[CprReport] event statistics:\n[CprReport]      valid count            : 65536 (100.00 %)\n[CprReport]      invalid count          : 1 (0.00 %)\n[CprReport]      unknown count          : 0 (0.00 %)\n[CprReport]      duplicate count        : 0 (0.00 %)\n[CprReport]      total parsing time     : 0.108922\n[CprReport]      avg parsing time       : 0.000002\n[CprReport]      total processing time  : 0.423945\n[CprReport]      avg processing time    : 0.000006\n[CprReport]      key hash time          : 0.380303\n[CprReport]      avg key hash time      : 0.000006\n[CprReport]      merge index time       : 0.000000\n[CprReport]      avg merge index time   : 0.000000\n[CprReport] player statistics:\n[CprReport]      valid count            : 131072 (200.00 %)\n[CprReport]      invalid count          : 0 (0.00 %)\n[CprReport]      summary records        : 475\n[CprReport]      player exists count    : 0 (0.00 %)\n[CprReport]      new player count       : 0 (0.00 %)\n[CprReport]      database access time   : 0.000000\n[CprReport]      avg access time        : 0.000000\n[CprReport]      link index update time : 0.006813\n[CprReport]      index update time      : 0.117868\n[CprReport]      avg index update time  : 0.000002\n[CprReport] summarization statistics:\n[CprReport]      valid events count     : 30744 (46.91 %)\n[CprReport]      invalid events count   : 0 (0.00 %)\n[CprReport]      not-applicable count   : 34792 (53.09 %)\n[CprReport]      index updates          : 30744 (100.00 %)\n[CprReport]      index update failures  : 0 (0.00 %)\n[CprReport]      construction time      : 0.117316\n[CprReport]      avg construction time  : 0.000002\n[CprReport]      index update time      : 0.133505\n[CprReport]      avg index update time  : 0.000002\n[CprReport]      summary records        : 0\n[CprReport]      database merges        : 0 (nan %)\n[CprReport]      database updates       : 0 (nan %)\n[CprReport]      database update time   : 0.000000\n[CprReport]      avg update time        : nan\n\nProcessing complete, total run time: 3.956268 seconds</pre></div><footer class=\"article-footer\"><span class=\"eyebrow\">PUBLICATION RECORD</span><p>Recovered article · Legacy Xaede · July 22, 2009</p><p>Originally published on Xaede. The recovered text is included in this reading edition.</p><p class=\"small\">Original authorship and publication date are preserved. This edition restores the reading layout. Recovered historical images are hosted here; unavailable images are identified where relevant.</p></footer></article>",
  "structuredData": {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "Person",
        "@id": "https://xaede.net/#josh-english",
        "name": "Josh English",
        "url": "https://xaede.net/about",
        "sameAs": [
          "https://github.com/josh-english-2k18",
          "https://medium.com/@jengas",
          "https://www.linkedin.com/in/joshua-s-english",
          "https://x.com/JoshSeriesAI"
        ],
        "jobTitle": "VP of Engineering",
        "description": "Josh English is VP of Engineering at Chronicle Media and was previously CTO of Series Entertainment. His career spans more than twenty-five years of distributed systems, game technology and engineering leadership. At Google he worked as a lead engineer on large-scale services and applied ML; at Big Run Studios he led multidisciplinary technology teams across seven time zones and four countries. At Series he directed engineering, QA, DevOps and infrastructure supporting live commercial games and AI-enabled production. He also builds personal games and developer tools to investigate how emerging capabilities work in practice, and writes about engineering judgment, organisation design and product economics.",
        "mainEntityOfPage": {
          "@id": "https://xaede.net/about#webpage"
        }
      },
      {
        "@type": "WebSite",
        "@id": "https://xaede.net/#website",
        "url": "https://xaede.net/",
        "name": "Xaede",
        "alternateName": [
          "Xaede.net",
          "Josh English — Xaede"
        ],
        "inLanguage": "en",
        "publisher": {
          "@id": "https://xaede.net/#josh-english"
        }
      },
      {
        "@type": "WebPage",
        "@id": "https://xaede.net/writing/world-of-warcraft#webpage",
        "url": "https://xaede.net/writing/world-of-warcraft",
        "name": "World of Warcraft",
        "description": "Building Combat Performance Reports from World of Warcraft logs: parsing events, constructing statistics and turning a player’s questions into a data-processing problem.",
        "inLanguage": "en",
        "isPartOf": {
          "@id": "https://xaede.net/#website"
        },
        "about": {
          "@id": "https://xaede.net/#josh-english"
        },
        "mainEntity": {
          "@id": "https://xaede.net/writing/world-of-warcraft#article"
        },
        "breadcrumb": {
          "@id": "https://xaede.net/writing/world-of-warcraft#breadcrumbs"
        }
      },
      {
        "@type": "Article",
        "@id": "https://xaede.net/writing/world-of-warcraft#article",
        "name": "World of Warcraft",
        "headline": "World of Warcraft",
        "description": "Building Combat Performance Reports from World of Warcraft logs: parsing events, constructing statistics and turning a player’s questions into a data-processing problem.",
        "author": {
          "@id": "https://xaede.net/#josh-english"
        },
        "inLanguage": "en",
        "mainEntityOfPage": {
          "@id": "https://xaede.net/writing/world-of-warcraft#webpage"
        },
        "genre": "Archive edition",
        "datePublished": "2009-07-22",
        "wordCount": 1169,
        "url": "https://xaede.net/writing/world-of-warcraft"
      },
      {
        "@type": "BreadcrumbList",
        "@id": "https://xaede.net/writing/world-of-warcraft#breadcrumbs",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://xaede.net/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "Writing",
            "item": "https://xaede.net/writing"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "World of Warcraft",
            "item": "https://xaede.net/writing/world-of-warcraft"
          }
        ]
      }
    ]
  }
}
