Battle Frequency System

Overview

The Battle Frequency System allows players to control how often their heroes are selected for battles. This gives players strategic control over which heroes participate in battles based on their preferences.

Frequency Values

The system uses four frequency levels:

Value
Label
Color
Description

0

Never

Red

DO NOT USE - Hero will never be selected for battles

3

Seldom

Orange

Low priority - Hero is rarely selected

6

Often

Yellow

Default setting - Normal selection frequency

11

Frequent

Green

High priority - Hero is frequently selected

Frontend Implementation

UI Components:

  • Frequency Toggle Button: Shows/hides frequency controls

  • Frequency Buttons: Four colored buttons (Red, Orange, Yellow, Green) for each hero

  • Frequency Legend: Explains the meaning of each frequency level

Mobile-Friendly Design:

  • Frequency buttons are hidden by default to save space

  • Toggle button allows users to show/hide frequency controls

  • Buttons are compact (32x32px) to fit in hero rows

  • Legend appears when frequency controls are visible

Usage:

1

Reveal frequency controls

Click "Show Frequency" to reveal frequency controls.

2

Set a hero's frequency

Click colored buttons next to each hero to set their frequency.

3

Visual feedback

Active frequency is highlighted with the appropriate color.

4

Persist changes

Changes are saved immediately via API calls.

Battle Selection Logic

When selecting heroes for battles, the system should:

1

Filter out excluded heroes

Filter out heroes with frequency = 0 (Never).

2

Weight remaining heroes

Weight remaining heroes by their frequency values.

3

Select based on weights

Use weighted random selection based on frequency values.

Example selection weights:

  • Frequency 3 (Seldom): 3/20 = 15% chance

  • Frequency 6 (Often): 6/20 = 30% chance

  • Frequency 11 (Frequent): 11/20 = 55% chance

Implementation Notes

  • Default frequency for new heroes is 6 (Often)

  • Frequency changes are immediately reflected in the UI

  • All frequency updates require authentication

  • The system validates frequency values (must be 0, 3, 6, or 11)

Last updated