diff --git a/docs/docs/technical-docs/client/resources/assets.md b/docs/docs/technical-docs/client/resources/assets.md index c2e7d6b46..84358bf1f 100644 --- a/docs/docs/technical-docs/client/resources/assets.md +++ b/docs/docs/technical-docs/client/resources/assets.md @@ -67,6 +67,104 @@ This avoids leaking filesystem details into gameplay or UI code. --- +## Asset Embedding + +To ensure assets are bundled with the executable and avoid external dependencies, +assets are embedded directly into the client binary at compile time. + +### Embedding Process + +1. **Asset Discovery**: CMake script (`generate_embedded_assets.cmake`) scans the `client/assets/` directory +2. **Binary Conversion**: Python script (`bin2header.py`) converts binary files to C++ header arrays +3. **Code Generation**: Generated `.cpp` files contain asset data as `unsigned char` arrays +4. **Compilation**: Embedded assets are compiled into the client executable + +### Supported Asset Types + +The embedding system supports: +- **Images**: PNG sprites and textures +- **Fonts**: OTF and TTF font files +- **Audio**: WAV and FLAC sound files +- **Shaders**: Fragment shaders +- **Data**: JSON configuration files (animations, levels) + +### Generated Code Structure + +Each asset generates a header file with: +```cpp +namespace EmbeddedResources { + extern const unsigned char asset_name[]; + extern const unsigned int asset_name_size; +} +``` + +### Usage in Code + +Embedded assets are accessed through the `EmbeddedResourceManager`: +```cpp +auto texture = resourceManager.loadTexture("sprites/player.png"); +auto font = resourceManager.loadFont("fonts/main.otf"); +auto soundBuffer = resourceManager.loadSound("sounds/shoot.wav"); +``` + +### Build Integration + +- Run `generate_embedded_assets.cmake` during the CMake configure step +- Generated files are placed in `build/client/embedded_resources/` +- Assets are automatically linked into the client executable + +This approach ensures: +- No external asset files required at runtime +- Faster loading (no filesystem I/O) +- Self-contained executables +- Consistent asset availability across platforms + +--- + +## JSON Asset Definitions + +In addition to binary assets, the client uses JSON files to define complex asset behaviors: + +### Animation Definitions + +JSON files define sprite animations with frame sequences and timing: + +```json +{ + "sprite": "player", + "spriteId": 7, + "default_animation": "idle", + "animations": { + "idle": { + "loop": true, + "frames": [ + { "x": 0, "y": 0, "w": 33, "h": 18, "duration": 0.5 }, + { "x": 33, "y": 0, "w": 33, "h": 18, "duration": 0.5 } + ] + } + } +} +``` + +### Background Definitions + +Background layers are defined with scrolling properties: + +```json +{ + "spriteId": 101, + "scrollSpeed": -50.0, + "tileWidth": 2584.0, + "tileHeight": 720.0 +} +``` + +### Entity Definitions + +Game entities (players, enemies, power-ups) have JSON definitions for sprites, sounds, and behaviors. + +--- + ## Failure Handling - Missing or invalid assets must not crash the client diff --git a/docs/docs/technical-docs/server/engine.md b/docs/docs/technical-docs/server/engine.md index e69de29bb..f306d21c6 100644 --- a/docs/docs/technical-docs/server/engine.md +++ b/docs/docs/technical-docs/server/engine.md @@ -0,0 +1,154 @@ +--- +id: engine +title: Engine Details +sidebar_label: Engine Details +--- + +# R-TYPE Engine Details + +This document provides detailed information about the Entity Component System (ECS) components and systems implemented in the R-TYPE server engine. + +## ECS Components + +The ECS architecture uses components to define entity properties and behaviors. Below are the key components implemented: + +### Core Components + +- **Id**: Unique identifier for entities +- **Position**: 2D position (x, y) in the game world +- **Velocity**: Movement velocity (dx, dy) +- **Direction**: Facing direction vector +- **Lifetime**: Time-to-live for temporary entities + +### Combat Components + +- **Health**: Current and maximum hit points +- **Damage**: Damage value for projectiles +- **Damageable**: Marks entities that can take damage +- **Attack**: Attack properties and cooldowns +- **Projectile**: Projectile-specific properties (speed, damage, type) +- **HomingProjectile**: Homing behavior (target ID, strength, max speed) + +### Enemy AI Components + +- **AIBrain**: AI behavior state and decision-making +- **AIShoot**: AI shooting patterns and timing +- **MovementPattern**: Complex movement behaviors (sinusoidal, circular, etc.) +- **Target**: Target tracking for homing projectiles + +### Power-Up Components + +- **PowerUp**: Marks collectible power-up entities +- **PowerUpType**: Defines power-up categories (force, laser, bubble) +- **PlayerPowerUp**: Active power-up state on players +- **BubblePowerUp**: Bubble shield mechanics +- **LaserPowerUp**: Laser weapon mechanics + +### Boss Components + +- **BossPart**: Multi-part boss hitboxes with damage multipliers +- **BossPhase**: Boss phase transitions and behaviors +- **TailFollower**: Boss tail segment following logic + +### Physics Components + +- **Collision**: Collision detection properties +- **PixelCollision**: Pixel-perfect collision data +- **GravityAffected**: Entities affected by gravity fields +- **GravityField**: Gravity source entities +- **Controllable**: Player-controlled entities + +### Rendering Components + +- **Drawable**: Rendering properties (sprite ID, layer) + +### Scoring Components + +- **KillScore**: Points awarded for destroying enemies +- **Score**: Player score tracking + +### Input Components + +- **InputComponent**: Player input state + +### Background Components + +- **Background**: Background layer properties + +## ECS Systems + +Systems process entities with specific component combinations. Each system runs in order during the game loop. + +### Movement Systems + +- **MovementSystem**: Applies velocity to positions using delta-time. Updates Position components based on Velocity components. + +- **MovementPatternSystem**: Handles complex enemy movement patterns (sinusoidal waves, circular paths, etc.). + +### Combat Systems + +- **CollisionSystem**: Detects collisions between entities and applies damage. Handles projectile-enemy and projectile-player interactions. + +- **ShootingSystem**: Manages weapon firing, cooldowns, and projectile creation. + +- **PowerUpShootingSystem**: Handles special power-up weapons (laser, bubble) with unique firing mechanics. + +- **AIShootSystem**: Controls enemy shooting patterns and timing. + +- **HomingSystem**: Updates homing projectile trajectories toward targets. + +### Physics Systems + +- **GravitySystem**: Applies gravitational forces to affected entities. + +- **LifetimeSystem**: Removes entities when their lifetime expires. + +### Boss Systems + +- **BossSystem**: Manages boss behaviors, phase transitions, and multi-part logic. + +- **TailFollowerSystem**: Updates boss tail segments to follow the main body. + +### Power-Up Systems + +- **PowerUpAttachmentSystem**: Manages power-up collection and attachment to players. + +- **PowerUpBarSystem**: Updates power-up charge bars and UI. + +- **BubblePowerUpSystem**: Handles bubble shield mechanics and collision immunity. + +- **LaserPowerUpSystem**: Manages laser weapon charging and firing. + +### Utility Systems + +- **InputSystem**: Processes player input and updates controllable entities. + +- **HealthSystem**: Manages damage application and entity destruction. + +- **SnapshotSystem**: Prepares world state for network synchronization. + +- **BackgroundSystem**: Updates scrolling background layers. + +## System Execution Order + +Systems are executed in a specific order to ensure correct dependencies: + +1. InputSystem (process player input) +2. MovementSystem (apply velocities) +3. MovementPatternSystem (complex movements) +4. ShootingSystem (create projectiles) +5. PowerUpShootingSystem (special weapons) +6. AIShootSystem (AI decisions) +7. HomingSystem (update projectile paths) +8. GravitySystem (apply gravity) +9. CollisionSystem (detect and resolve collisions) +10. HealthSystem (apply damage and destroy entities) +11. LifetimeSystem (remove expired entities) +12. BossSystem (boss-specific logic) +13. TailFollowerSystem (boss tail updates) +14. PowerUpAttachmentSystem (power-up collection) +15. PowerUpBarSystem (UI updates) +16. BubblePowerUpSystem (shield mechanics) +17. LaserPowerUpSystem (laser mechanics) +18. BackgroundSystem (visual updates) +19. SnapshotSystem (network prep) \ No newline at end of file diff --git a/docs/docs/technical-docs/server/engine/audio.md b/docs/docs/technical-docs/server/engine/audio.md index 4641e7b7e..4d8efc322 100644 --- a/docs/docs/technical-docs/server/engine/audio.md +++ b/docs/docs/technical-docs/server/engine/audio.md @@ -6,18 +6,34 @@ sidebar_label: Audio # Audio System -The audio module manages all sound effects and background music. +The audio system manages sound effects and music on the server side. The server does not play audio directly - it tracks audio events and includes them in snapshots sent to clients. ## Features -- Play and stop sounds. -- Volume control per entity or global. -- Looping music tracks. -- Positional audio for immersive experience. +- Sound effect triggering for game events. +- Music track management. +- Audio state synchronization across clients. +- Volume and priority management. -## Example +## Components Used -```cpp -AudioSystem::playSound("laser.wav"); -AudioSystem::playMusic("background.mp3", loop=true); -``` \ No newline at end of file +- **Attack**: May include sound effect references +- **Projectile**: Sound effects for firing +- **Health**: Death sound effects +- **PowerUp**: Collection and activation sounds + +## Workflow + +1. Track audio events during gameplay (shots, deaths, power-ups). +2. Include audio commands in network snapshots. +3. Ensure all clients play synchronized sound effects. +4. Manage music transitions for level changes. + +## Server Audio Responsibilities + +- Determine when sounds should play +- Include audio events in authoritative snapshots +- Ensure consistent audio experience across all clients +- Handle music track changes for game phases + +Actual audio playback is handled by clients using SFML audio capabilities. \ No newline at end of file diff --git a/docs/docs/technical-docs/server/engine/ecs.md b/docs/docs/technical-docs/server/engine/ecs.md index a569cf65f..2bc1a05c7 100644 --- a/docs/docs/technical-docs/server/engine/ecs.md +++ b/docs/docs/technical-docs/server/engine/ecs.md @@ -35,19 +35,62 @@ For example: **Components are pure data** structures. Each component represents one aspect of an entity. -### Common Components in R-TYPE ECS - -- **Health**: Tracks life points, damage state, death flag. -- **Position**: Stores X/Y coordinates. -- **Velocity**: Movement speed and direction. -- **Direction**: Orientation of entity or facing vector. -- **AI_Brain**: Controls enemy behavior or NPC decision-making. -- **Drawable**: Reference to sprite, animation, or visual asset. -- **Damageable**: Marks entity as capable of receiving damage. -- **Damage**: Represents damage dealt to other entities. -- **Collision**: Defines hitboxes and interaction rules. -- **Controllable**: Marks entity as controlled by a player. -- **Attack**: Stores attack patterns, cooldowns, and projectiles. +### Complete List of Components in R-TYPE ECS + +#### Core Components +- **Id**: Unique entity identifier +- **Position**: 2D position (x, y) coordinates +- **Velocity**: Movement velocity (dx, dy) +- **Direction**: Facing direction vector +- **Lifetime**: Time-to-live for temporary entities + +#### Combat Components +- **Health**: Current and maximum hit points +- **Damage**: Damage value for projectiles +- **Damageable**: Marks entities that can take damage +- **Attack**: Attack properties and cooldowns +- **Projectile**: Projectile-specific properties (speed, damage, type) +- **HomingProjectile**: Homing behavior (target ID, strength, max speed) +- **WeaponConfig**: Weapon configuration and upgrades + +#### Enemy AI Components +- **AIBrain**: AI behavior state and decision-making +- **AIShoot**: AI shooting patterns and timing +- **MovementPattern**: Complex movement behaviors (sinusoidal, circular, etc.) +- **Target**: Target tracking for homing projectiles +- **Controllable**: Player-controlled entities + +#### Power-Up Components +- **PowerUp**: Marks collectible power-up entities +- **PowerUpType**: Defines power-up categories (force, laser, bubble) +- **PlayerPowerUp**: Active power-up state on players +- **BubblePowerUp**: Bubble shield mechanics +- **LaserPowerUp**: Laser weapon mechanics +- **PowerUpBar**: Power-up charge visualization + +#### Boss Components +- **BossPart**: Multi-part boss hitboxes with damage multipliers +- **BossPhase**: Boss phase transitions and behaviors +- **TailFollower**: Boss tail segment following logic + +#### Physics Components +- **Collision**: Collision detection properties +- **PixelCollision**: Pixel-perfect collision data +- **GravityAffected**: Entities affected by gravity fields +- **GravityField**: Gravity source entities + +#### Rendering Components +- **Drawable**: Rendering properties (sprite ID, layer) + +#### Scoring Components +- **KillScore**: Points awarded for destroying enemies +- **Score**: Player score tracking + +#### Input Components +- **InputComponent**: Player input state + +#### Background Components +- **Background**: Background layer properties - **Score**: Tracks points gained from actions. **Key points:** diff --git a/docs/docs/technical-docs/server/engine/rendering.md b/docs/docs/technical-docs/server/engine/rendering.md index aea382785..dc4cd8966 100644 --- a/docs/docs/technical-docs/server/engine/rendering.md +++ b/docs/docs/technical-docs/server/engine/rendering.md @@ -6,26 +6,34 @@ sidebar_label: Rendering # Rendering System -The rendering system handles drawing all visual elements of the game. +The rendering system handles drawing all visual elements of the game on the server side. Note that the server does not perform actual graphics rendering - it prepares rendering data that is sent to clients via snapshots. ## Features -- Sprite management and animations. +- Entity visibility management. - Background and parallax layers. -- UI rendering (score, health bars). -- Frame rate optimized for performance. +- Animation state tracking. +- Rendering data serialization for network transmission. + +## Components Used + +- **Drawable**: Contains sprite ID, layer, and rendering properties +- **Position**: Entity position for rendering +- **Background**: Background layer scrolling and tiling information ## Workflow -1. Collect all entities with `Sprite` components. -2. Sort layers for correct rendering order. -3. Draw sprites to the screen. -4. Update animations each frame. +1. Collect all entities with `Drawable` components. +2. Update background layer positions based on scroll speed. +3. Prepare rendering data for snapshot transmission. +4. Include animation states and visual effects. + +## Server-Side Rendering -## Example +Unlike client rendering, server rendering focuses on: +- Determining what entities are visible +- Calculating animation frames +- Preparing background scroll positions +- Ensuring visual state consistency for all clients -```cpp -for (auto entity : ecs.getEntitiesWith()) { - renderer.draw(entity.get().texture, entity.get()); -} -``` \ No newline at end of file +The actual drawing is performed by clients using SFML. \ No newline at end of file diff --git a/docs/docs/technical-docs/server/engine/systems.md b/docs/docs/technical-docs/server/engine/systems.md index 21564a3ab..c3c184cac 100644 --- a/docs/docs/technical-docs/server/engine/systems.md +++ b/docs/docs/technical-docs/server/engine/systems.md @@ -13,6 +13,23 @@ Current implemented systems: - `InputSystem` - `MovementSystem` +- `MovementPatternSystem` +- `CollisionSystem` +- `ShootingSystem` +- `PowerUpShootingSystem` +- `AIShootSystem` +- `HomingSystem` +- `GravitySystem` +- `LifetimeSystem` +- `BossSystem` +- `TailFollowerSystem` +- `HealthSystem` +- `PowerUpAttachmentSystem` +- `PowerUpBarSystem` +- `BubblePowerUpSystem` +- `LaserPowerUpSystem` +- `BackgroundSystem` +- `SnapshotSystem` --- @@ -69,22 +86,100 @@ Current update loop in `GameServer`: ```cpp InputSystem::update(world); MovementSystem::update(world, dt); +MovementPatternSystem::update(world, dt); +ShootingSystem::update(world, dt); +PowerUpShootingSystem::update(world, dt); +AIShootSystem::update(world, dt); +HomingSystem::update(world, dt); +GravitySystem::update(world, dt); +CollisionSystem::update(world); +HealthSystem::update(world); +LifetimeSystem::update(world); +BossSystem::update(world, dt); +TailFollowerSystem::update(world, dt); +PowerUpAttachmentSystem::update(world); +PowerUpBarSystem::update(world, dt); +BubblePowerUpSystem::update(world, dt); +LaserPowerUpSystem::update(world, dt); +BackgroundSystem::update(world, dt); +SnapshotSystem::update(world); ``` This order ensures: 1. Input modifies velocity 2. Movement uses updated velocity to modify positions +3. Complex movements are applied +4. Projectiles are created and updated +5. AI decisions are made +6. Homing projectiles track targets +7. Gravity affects entities +8. Collisions are detected and resolved +9. Damage is applied and entities die +10. Temporary entities expire +11. Boss logic and tail following +12. Power-ups are collected and managed +13. Visual updates for backgrounds +14. Snapshots are prepared for networking -Future systems might include: +## Detailed System Descriptions -* Collision resolution -* AI steering -* Projectile updates -* Damage processing -* Snapshot generation for the network +### InputSystem +Processes player input from `InputComponent` and updates `Velocity` components. Converts keyboard/gamepad input into movement intent. -These must also follow deterministic ordering rules for multiplayer synchronization. +### MovementSystem +Applies velocity to position over time: `pos.x += vel.vx * dt; pos.y += vel.vy * dt;` + +### MovementPatternSystem +Handles complex enemy movement patterns like sinusoidal waves, circular paths, and scripted behaviors defined in `MovementPattern` components. + +### CollisionSystem +Detects collisions between entities using `Collision` components. Applies damage and triggers effects when entities overlap. + +### ShootingSystem +Manages weapon firing, cooldowns, and projectile creation for basic weapons. + +### PowerUpShootingSystem +Handles special power-up weapons (laser, bubble) with unique firing mechanics and charge management. + +### AIShootSystem +Controls enemy shooting patterns and timing based on `AIShoot` components. + +### HomingSystem +Updates homing projectile trajectories to track targets specified in `HomingProjectile` components. + +### GravitySystem +Applies gravitational forces from `GravityField` entities to `GravityAffected` entities. + +### LifetimeSystem +Removes entities when their `Lifetime` expires. + +### BossSystem +Manages boss behaviors, phase transitions, and multi-part logic. + +### TailFollowerSystem +Updates boss tail segments to follow the main body with physics-based following. + +### HealthSystem +Applies damage from `Damage` components and handles entity destruction when health reaches zero. + +### PowerUpAttachmentSystem +Manages power-up collection and attachment to player entities. + +### PowerUpBarSystem +Updates power-up charge bars and UI state. + +### BubblePowerUpSystem +Handles bubble shield mechanics and collision immunity. + +### LaserPowerUpSystem +Manages laser weapon charging and firing. + +### BackgroundSystem +Updates scrolling background layers. + +### SnapshotSystem +Prepares world state snapshots for network synchronization. --- diff --git a/docs/docs/technical-docs/server/engine/world.md b/docs/docs/technical-docs/server/engine/world.md index 6825dc752..e9ee4b679 100644 --- a/docs/docs/technical-docs/server/engine/world.md +++ b/docs/docs/technical-docs/server/engine/world.md @@ -43,10 +43,41 @@ This ensures: During construction, the world registers all components required by the simulation: ```cpp +_registry.registerComponent(); _registry.registerComponent(); _registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); _registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); +_registry.registerComponent(); _registry.registerComponent(); +_registry.registerComponent(); ``` This centralizes component lifecycle management and guarantees availability. diff --git a/docs/docs/technical-docs/server/resources/levels.md b/docs/docs/technical-docs/server/resources/levels.md new file mode 100644 index 000000000..6726333cc --- /dev/null +++ b/docs/docs/technical-docs/server/resources/levels.md @@ -0,0 +1,198 @@ +--- +id: levels +title: Levels and Gameplay +sidebar_label: Levels and Gameplay +--- + +# Levels and Gameplay + +This document describes the level system, enemy definitions, power-ups, and boss mechanics implemented in the R-TYPE server. + +## Level Structure + +Levels are defined in JSON files located in the `levels/` directory. Each level contains: + +### Level Metadata +- `name`: Display name of the level +- `duration`: Total level duration in seconds +- `background`: Background scrolling configuration + +### Enemy Definitions +Enemies are defined in the `enemies` object with the following properties: + +```json +{ + "smallEnemy": { + "hp": 15, + "speed": -100, + "size": { "w": 65, "h": 66 }, + "killScore": 30, + "sprite": "enemy", + "spriteId": 2, + "shoot": { + "type": "straight", + "cooldown": 2.0, + "projectileSpeed": 130, + "damage": 50, + "muzzle": { "x": -20, "y": 50 }, + "projectileSpriteId": 9 + } + } +} +``` + +**Enemy Properties:** +- `hp`: Hit points +- `speed`: Movement speed (negative = leftward) +- `size`: Collision box dimensions +- `killScore`: Points awarded for destruction +- `sprite`: Asset identifier +- `spriteId`: Numeric sprite ID +- `shoot`: Shooting behavior configuration + +**Shooting Types:** +- `straight`: Single projectile forward +- `diagonal`: Projectiles at specified angles +- `spread`: Multiple projectiles in a fan pattern + +### Enemy Groups +Enemies can be grouped for formation spawning: + +```json +{ + "groupEnemy": { + "type": "group", + "members": [ + { + "enemyType": "mediumEnemy", + "offset": { "x": 0, "y": 0 } + }, + { + "enemyType": "smallEnemy", + "offset": { "x": 0, "y": -130 } + } + ] + } +} +``` + +### Obstacles +Levels can include environmental hazards: + +```json +{ + "gravityWell": { + "spriteId": 15, + "size": { "w": 34, "h": 34 }, + "pullStrength": 250, + "damagePerSecond": 10, + "radius": 140, + "innerRadius": 50 + } +} +``` + +### Waves +Levels are structured as a sequence of waves: + +```json +{ + "waves": [ + { + "time": 1, + "enemies": { "smallEnemy": 1 }, + "spawnPattern": "line", + "spawnY": 360 + } + ] +} +``` + +**Wave Properties:** +- `time`: Spawn time in seconds +- `enemies`: Enemy counts by type +- `spawnPattern`: "line" (centered), "spread" (distributed), or empty (random) +- `obstacleType`: Optional obstacle to spawn +- `powerUps`: Number of power-ups to spawn + +## Power-Up System + +Power-ups enhance player capabilities and are collected by flying through them. + +### Power-Up Types + +1. **Force Power-Up** (`force`): Increases projectile damage and size +2. **Laser Power-Up** (`laser`): Charges a powerful laser beam weapon +3. **Bubble Power-Up** (`bubble`): Creates a protective shield + +### Power-Up Mechanics + +- **Collection**: Player must collide with floating power-up entities +- **Attachment**: Power-ups attach to the player's ship visually +- **Activation**: Special weapons activated with dedicated input (E key) +- **Duration**: Power-ups have limited uses or time limits +- **UI**: Power-up bars show charge levels and cooldowns + +### Bubble Power-Up +- Creates expanding bubble shield around player +- Provides collision immunity for a short duration +- Automatically activates when charged + +### Laser Power-Up +- Charges over time when attached +- Fires a powerful piercing laser beam +- High damage but long cooldown + +## Boss System + +Bosses are complex enemies with multiple phases and behaviors. + +### Boss Components + +- **BossPart**: Defines multiple hitboxes with different damage multipliers +- **BossPhase**: Manages phase transitions based on health thresholds +- **TailFollower**: Handles segmented boss tails that follow the main body + +### Boss Mechanics + +- **Multi-Part**: Bosses can have weak points and armored sections +- **Phase Transitions**: Behavior changes as health decreases +- **Complex Movement**: Advanced AI patterns and attack telegraphs +- **Tail Segments**: Connected body parts with following physics + +### Boss Phases + +Bosses transition between phases at health thresholds: + +```cpp +struct BossPhaseData { + float healthThreshold; // Health percentage to trigger phase + std::string behavior; // Phase-specific behavior + float speedMultiplier; // Movement speed change + // Additional phase properties... +}; +``` + +## Level Loading + +Levels are loaded at runtime using the `Level` class: + +1. **Parsing**: JSON files are parsed into `Level` structures +2. **Validation**: Enemy types and wave data are validated +3. **Difficulty Scaling**: Enemy properties are modified based on difficulty settings +4. **Runtime Spawning**: Waves spawn enemies at specified times during gameplay + +### Difficulty Modifiers + +```cpp +struct DifficultyModifiers { + float enemyHpMultiplier = 1.0f; + float enemyDamageMultiplier = 1.0f; + float enemySpawnRateMultiplier = 1.0f; + float projectileSpeedMultiplier = 1.0f; + float enemySpeedMultiplier = 1.0f; + float enemyScoreMultiplier = 1.0f; +}; +``` + +These modifiers scale enemy difficulty while maintaining balanced gameplay. \ No newline at end of file diff --git a/docs/sidebars.js b/docs/sidebars.js index 9209296d5..4915082f0 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -131,6 +131,7 @@ module.exports = { 'technical-docs/server/resources/overview', 'technical-docs/server/resources/config', 'technical-docs/server/resources/persistence', + 'technical-docs/server/resources/levels', ], }, { @@ -151,6 +152,8 @@ module.exports = { 'technical-docs/server/engine/world', 'technical-docs/server/engine/game-server', 'technical-docs/server/engine/runtime-integration', + 'technical-docs/server/engine/rendering', + 'technical-docs/server/engine/audio', ], }, ],