Module opponents

Source
Expand description

Native port of the opponent_generation category — the single bots_settings.bots_generation_script run via [crate::BehaviorRegistry::generate_opponent] to build a PvP bot from an expected arena rating.

all the data it needs is now in the typed GameConfig:

  • available_to_bots and item-rarity code were promoted onto AbilityTemplate / ItemRarity (they previously lived only in the admin-generated content_raw).
  • ability-rarity eff is lookups.ability_rarity_eff (which content_raw_extract itself sources from the same eff).
  • character_level.ability_slots is the base ability_slots_levels lookup (from_chapter_level <= level, highest match) — same rule the real-player path (ability_slots_for_chapter_level) uses.

uuid-string) order, so the native iterates config Vecs sorted by uuid string — this matters for drain_random (picks by index) and find order.

RNG: the script draws in this order — level (1), then item_q once per inventory item-type, then drain_random once per equipped ability. rand_round/drain_random reuse the shared native logic (balance::rand_round_f64; the drain index formula).

Structs§

OpponentGenCtx
Inputs for the opponent-generation slot — mirrors the generate_opponent scope (ExpectedRating, Random) plus config/lookups the content reads.
OpponentGenerationResult
UuidIntPair

Functions§

default_opponent_generation
Port of the shipped bots_generation_script.

Type Aliases§

OpponentGenFn
Signature of an opponent-generation native fn.