gem
v0.15.0

Neutral Camps Extractor

Every creep a neutral camp spawned, and every camp stack.

Camps, creeps and stacks

Each camp is a CDOTA_NeutralSpawner entity at the camp's centre in camp_zones.json. Each creep it spawns is a CDOTA_BaseNPC_Creep_Neutral that names its spawner in m_hNeutralSpawner: it spawns when m_bIsWaitingToSpawn clears and dies when m_lifeState leaves 0. A camp is stacked when it spawns a wave while creeps from an earlier wave are still alive.

The game credits each stack to a player: the team data's m_iCampsStacked rises on the spawn tick by the number of camps that player stacked (OpenDota's camps_stacked is this counter). On the local fixtures the stacks found from the creeps equal the counter's rises at every spawn tick. When one player is credited with every camp stacked on a tick, the stack is theirs (player_exact); otherwise each camp goes to the credited player nearest it in their sampled positions 3 to 10 seconds before the spawn.

The combat log names a dying creep's unit but not its entity, so a creep's killer comes from the neutral DEATH entries on its death tick, when they agree on one attacker. A lane creep as the killer means a pull; a flooded camp's creeps that grow into their next form are recorded as dying to their camp.


Generated API

Module gem.extractors.neutral_camps

Neutral camp extractor: every creep a camp spawned, and every camp stack.

Source: src/gem/extractors/neutral_camps.py

Top-level functions

credit_stacks

python
def credit_stacks(candidates: list[CampStack], credits: Iterable[tuple[int, int, int]], positions: dict[int, list[tuple[int, float, float]]]) -> list[CampStack]

Return the candidate stacks the game credited, each with its player.

Source: src/gem/extractors/neutral_camps.py:334

resolve_killers

python
def resolve_killers(creeps: list[NeutralCreep], entries: Iterable[CombatLogEntry], kill_player: Callable[[str, str], int | None]) -> None

Set each creep's killer from the combat log's neutral DEATH entries.

Source: src/gem/extractors/neutral_camps.py:425

Top-level classes

NeutralCreep

python
class NeutralCreep

One creep a neutral camp spawned.

Source: src/gem/extractors/neutral_camps.py:83

Dataclass fields

NameTypeDefault
camp_idint | None-
spawned_tickint-
died_tickint | NoneNone
killer_namestr | NoneNone
killer_player_idint | NoneNone

CampStack

python
class CampStack

A camp stack: a spawn while an earlier wave was alive, counted by the game.

Source: src/gem/extractors/neutral_camps.py:109

Dataclass fields

NameTypeDefault
tickint-
camp_idint | None-
camp_typestr | None-
creeps_beforeint-
waves_aliveint-
player_idint | NoneNone
player_exactboolFalse

StackCredit

python
class StackCredit

One rise in a team slot's m_iCampsStacked.

Source: src/gem/extractors/neutral_camps.py:139

Dataclass fields

NameTypeDefault
tickint-
teamint-
team_slotint-
campsint-

NeutralCampExtractor

python
class NeutralCampExtractor

Collects camp creeps, spawner tiers and stack credits during a parse.

Source: src/gem/extractors/neutral_camps.py:162

Properties

_tick

Signature: def NeutralCampExtractor._tick(self) -> int

No docstring available.

Source: src/gem/extractors/neutral_camps.py:205

Methods

attach

Signature: def NeutralCampExtractor.attach(self, parser: ReplayParser) -> None

Register for spawners, camp creeps and the stack counters.

Source: src/gem/extractors/neutral_camps.py:184

finalize

Signature: def NeutralCampExtractor.finalize(self) -> tuple[list[NeutralCreep], list[CampStack]]

Return the camp creeps that spawned and the candidate stacks.

Source: src/gem/extractors/neutral_camps.py:259