Back to Documentation
Concept

Tags

Tag-based state management - flexible key-value system for game state

Tags are the fundamental state management mechanism in Chong. They provide a flexible, string-based system for storing and querying game state.

Tag Format

Tags follow the format: category:value or category:subcategory:value

locked:true              # Boolean-like state
base:wild                # Symbol type
coin:value:5             # Numeric value
position:multiplier:2    # Position property
payline:config1:1:3      # Complex identifier

Entities

Tags are attached to entities. Common entity types:

Entity TypeID FormatExample
Positionpos_{col}_{row}pos_0_1
Symbols_{col}_{row}s_1_2
Globalglobalglobal

Tag Manager Operations

// Set a tag on an entity
tagManager.setTag('pos_0_0', 'locked:true')

// Check if entity has a tag
tagManager.hasTag('pos_0_0', 'locked:true')

// Get all tags for an entity
tagManager.getTags('pos_0_0')
// → ['locked:true', 'coin:value:5']

// Remove a tag
tagManager.removeTag('pos_0_0', 'locked:true')

// Find all entities with a tag
tagManager.getEntitiesByTag('locked:true')
// → ['pos_0_0', 'pos_1_2', 'pos_3_1']

Common Tags

Position Tags

  • locked:true - Position is locked
  • disabled:true - Position excluded from wins
  • coin:value:{N} - Coin value (H&W)
  • position:multiplier:{N} - Position multiplier

Symbol Tags

  • base:{type} - Base symbol type
  • symbol:{type} - Symbol identifier
  • winline:{N} - Part of winning line N

Global Tags

  • totalwin:{N} - Total win amount
  • hnw:payout:{N} - H&W bonus payout
  • paytable:{sym}_{count}_{value} - Paytable entry