Difficulty Scaling Overview
Overview
Game object balancing is configured through configuration files. Each entity type has its own configuration asset, where you can define behavior parameters such as damage, health, movement speed, and other characteristics.
Configs path: Assets/StaticAssets/Configs/...
Stickman
EnemyConfig
Health, reward
Tentacle
TentacleConfig
Health
Player
PlayerConfig
Health, movement speed
Rocket
RocketConfig
Damage
Turret
TurretConfig
Attack interval, ammo count
Projectile
ProjectileConfig
Damage
Notes (Optional, but recommended)
All configs are implemented as ScriptableObject assets.
Difficulty scaling can be achieved by adjusting these configuration values without modifying code.
Configs can be reused across multiple levels or game modes.
Balance Parameter Calculation
The calculation of balance parameters in the game is handled by three core classes: PlayerStats, TentacleStats, and EnemyStats.
Each class reads values from configuration assets (ScriptableObjects) and computes runtime stats, including health, damage, speed, and other characteristics.
PlayerStats
Handles the player’s runtime stats such as health, movement speed, projectile damage, rocket damage, and ammo count. It uses configuration files and the player’s upgrade levels to calculate values dynamically.
Key Features:
Reads values from
PlayerConfig,ProjectileConfig,TurretConfig, andRocketConfig.Calculates:
Current health (
CurrentHealth)Movement speed (
CurrentSpeed)Turret damage (
CurrentDamage)Rocket damage (
RocketDamage)Ammo count (
CurrentBullets) and low-bullets thresholdFire interval (
FireInterval)
Supports upgrade level scaling via
IPlayerContext.
TentacleStats
Manages health and damage for Tentacle-type enemies.
Key Features:
Reads values from
TentacleConfig.Calculates:
Current health (
CurrentHealth)Damage based on health ratio (
CurrentDamage)
Supports level-based scaling.
EnemyStats
Manages health and damage for general enemies.
Key Features:
Reads values from
EnemyConfig.Calculates:
Current health (
CurrentHealth)Damage scaled by health ratio (
CurrentDamage)
Supports level-based scaling.
Adding New Statistics
You can extend or modify existing statistics to customize gameplay.
Custom Formulas: Replace the default calculation formulas in PlayerStats, TentacleStats, or EnemyStats with your own formulas to adjust values such as health, damage, speed, or fire rate.
Gameplay Tuning: Changing formulas allows you to tweak difficulty, pacing, and the overall game feel without modifying core game logic.
Last updated