gem
v0.13.0

Fights Extractor

Fight detection (every fight, adjustable grouping), OpenDota-exact teamfights, and per-participant statistics.


Generated API

Module gem.extractors.fights

Fight detection from combat log entries.

Source: src/gem/extractors/fights.py

Top-level functions

detect_fights

def detect_fights(combat_log: list[CombatLogEntry], hero_to_slot: dict[str, int] | None = None, player_snapshots: dict[int, list[PlayerStateSnapshot]] | None = None, slot_to_team: dict[int, int] | None = None, *, window_s: float = FIGHT_WINDOW_S, radius: float | None = FIGHT_RADIUS) -> list[Fight]

Detect fights from a match combat log.

Source: src/gem/extractors/fights.py:181

detect_opendota_teamfights

def detect_opendota_teamfights(combat_log: list[CombatLogEntry], hero_to_slot: dict[str, int] | None = None, player_snapshots: dict[int, list[PlayerStateSnapshot]] | None = None, *, game_start_tick: int | None = None, duration_s: int | None = None, game_clock: GameClock | None = None, interval_samples: Sequence[IntervalSample] | None = None, aegis_events: Iterable[AegisEvent] = ()) -> list[OpenDotaTeamfight]

Project combat log entries into OpenDota-compatible teamfight output.

Source: src/gem/extractors/fights.py:453

Top-level classes

FightPlayer

class FightPlayer

Per-player stats accumulated within one fight window.

Source: src/gem/extractors/fights.py:65

Dataclass fields

NameTypeDefault
player_idint-
deathsint0
buybacksint0
damage_dealtint0
damage_takenint0
healingint0
gold_deltaint0
xp_deltaint0
ability_usesdict[str, int]field(...)
item_usesdict[str, int]field(...)

Fight

class Fight

A detected fight window with per-player breakdowns.

Source: src/gem/extractors/fights.py:94

Dataclass fields

NameTypeDefault
start_tickint-
end_tickint-
last_death_tickint-
deathsint-
first_death_tickint0
radiant_killsint0
dire_killsint0
winnerstr'unknown'
centroid_xfloat | NoneNone
centroid_yfloat | NoneNone
centroid_nint0
playerslist[FightPlayer]field(...)

OpenDotaTeamfightPlayer

class OpenDotaTeamfightPlayer

OpenDota-compatible per-player teamfight row.

Source: src/gem/extractors/fights.py:134

Dataclass fields

NameTypeDefault
deaths_posdict[str, dict[str, int]]field(...)
ability_usesdict[str, int]field(...)
ability_targetsdict[str, int]field(...)
item_usesdict[str, int]field(...)
killeddict[str, int]field(...)
deathsint0
buybacksint0
damageint0
healingint0
gold_deltaint0
xp_deltaint0
xp_startint | NoneNone
xp_endint | NoneNone

OpenDotaTeamfight

class OpenDotaTeamfight

OpenDota-compatible temporal teamfight window.

Source: src/gem/extractors/fights.py:164

Dataclass fields

NameTypeDefault
startint-
endint-
last_deathint-
deathsint-
playerslist[OpenDotaTeamfightPlayer]field(...)