Skip to content

What to do with the Log Guide? #4

@xpdota

Description

@xpdota

This discussion was mostly in discord, but I want to get it documented here since it's easier to follow long-running conversations.

Currently, I have a fork of the log guide: https://github.com/xpdota/guide-scratch/blob/master/3pty/LogGuide.md

It would be nice if there were a better central log resource. Currently, the Cactbot log guide is the de-facto resource, but it has a couple issues:

  1. Since portions are auto-genned from Cactbot code, it means contributors may need to set up an entire dev environment depending on what kind of change they're making.
  2. There was also a problem in the past of not being able to document new fields added to existing lines, because it breaks line parsing for CN/KR until they get the patch.
  3. If a field, especially one that doesn't currently have a descriptive name, is renamed, this may break stuff in Cactbot, so it would need the ability to have "alternate" field names or some other backwards compatibility mechanism.
  4. The fields currently lack type and representation info (e.g. whether a field is base-10 or base-16).
  5. Since they also lack descriptions, adding a new field or clarifying an existing field typically requires manual changes to the log guide anyway.
  6. Some fields, such as the flags/value pairs on 21/22, or the trios on 38/42, should almost always be treated as an array of things, rather than querying specific indices (since it makes the logic a lot more brittle even in circumstances where it tends to work).

So, in terms of what to do, there's two options that come to mind:

  1. Significantly improve the field defs in Cactbot, including type info (as well as how to convert it, e.g. b10 vs b16, or 1.23 vs 0x3F9D70A4), array types, alt names, and whatever else might be needed. Then, improve the auto-gen with all of that. The advantage is that you might be able to pull more type safety into the actual line parsing as well as reduce boilerplate.
  2. Split out the Cactbot-specific guidance from the more general log information. Don't auto-gen the generalized guide. From the standpoint of the change I've made, the auto-gen doesn't cover the parts that require the most effort anyway (like the mess that is ability effects), so it really wouldn't be a problem to just have me or someone else write those portions manually. In addition, it

I think the ideal way would be to represent fields in a table, like this:

Line 21

Index Data Type Representation Cactbot Name* Description
0 Line Number Base 10 N/A Line Number
1 Timestamp yyyy-MM-dd etc timestamp The time at which the event occurred
2 Entity ID Base 16 sourceId The caster of the ability
... ... ... ... ...
(8, 10, ...22) Four Bytes Base 16 flags1...flags8 For each pair, this determines the type of effect as well as extra effect-specific flags
(9, 11, ...23) Four Bytes Base 16 value1...value8 For each pair, this effect-specific value determines the main "value", e.g. damage taken or which status effect was applied

* If going with option 1

I think there's also value in exploring if there's a nice way of representing fields that "go together" (e.g. ability ID + name, or target ID + name + xyz/heading + HP + etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions