feat: add melee detection to the damage dataset - #35
Open
ghaif wants to merge 1 commit into
Open
Conversation
load_damage decoded the full CCitadelUserMessage_Damage but surfaced only 10 fields, dropping ability_id, type, and citadel_type, so a hit could not be identified as melee. Surface those fields on the damage frame (ability_id, damage_type, citadel_type) and add an is_melee flag. is_melee is citadel_type == 3 (Deadlock's melee damage type) AND a hit from a melee ability (name contains "melee"). citadel_type == 3 alone is too broad: it also covers melee-typed abilities such as uppercut and hook and ownerless auto-melees (ability_id == 0). Restricting to a melee ability keeps a hero's light/heavy melee against any target (heroes, troopers, denizens) and drops the rest. The melee-id set is derived once from all_abilities(). Extend the damage schema test and add TestDamageMelee.
ghaif
force-pushed
the
feat/damage-melee-detection
branch
from
August 16, 2026 22:24
88489aa to
88819fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
damagedataset could not tell whether a hit was a melee attack.load_damagedecodes the fullCCitadelUserMessage_Damageprotobuf but surfaced only 10 of its fields, droppingability_id,type, andcitadel_type, which are the fields that identify a hit.Change
Surface those fields on the
damageframe and add anis_meleeconvenience flag:ability_id: the ability that dealt the hit (0 if none; resolve withability_names())damage_type: the rawtypebitfieldcitadel_type: Deadlock's damage-type category (3is melee damage)is_melee: a light/heavy melee attackis_meleeiscitadel_type == 3AND a hit from a melee ability (its name containsmelee).citadel_type == 3on its own is too broad: it also tags melee-typed abilities (uppercut, hook, crushing fists) and ownerless auto-melees (ability_id == 0, e.g. a trooper's own swing). Restricting to a melee ability keeps a hero's light and heavy melee against any target (heroes, troopers, denizens) and drops the rest.citadel_typestays exposed for anyone who wants the broad damage type.The melee-id set is derived once from
all_abilities(), so it is cheap and stays correct as heroes are added.Tests
crates/boon-python/tests/test_demo.py: extend thedamageschema test and addTestDamageMelee(the new fields resolve and are typed;is_meleeequalscitadel_type == 3combined with a melee-ability hit; a match lands at least one melee).