-
Notifications
You must be signed in to change notification settings - Fork 1
Combat Logic User Tests
Our combat system is built on a few key pieces that work together. At its heart is the CombatManager, the puppeteer pulling all the strings during battle. It leans on CombatMove as a blueprint for all actions, making sure everything is functional. CombatStatsComponent is like a character's vital signs monitor, keeping tabs on health, hunger, and other stats as they fluctuate in the heat of battle. CombatActions is our event handler, making sure everything flows smoothly from one state to the next.
We've implemented a diverse set of move types to encourage strategic gameplay. AttackMove forms the offensive core, with damage calculations considering various factors like strength, defense, and status effects. GuardMove provides defensive options, reducing incoming damage and potentially blocking status effects. SleepMove offers a risk-reward recovery mechanism, restoring health and hunger but leaving the user vulnerable. SpecialMove allows for unique, powerful actions, typically reserved for bosses or special encounters, adding depth to combat scenarios.
- Initialization: Set up combat state, load player and enemy stats
-
Turn Sequence:
- Player selects action
- Enemy AI determines action
- Actions are executed based on speed stats
-
Action Resolution:
- Calculate and apply damage/effects
- Update health, hunger, and status effects
-
State Check:
- Check for victory/defeat conditions
- Apply end-of-turn effects (e.g., bleeding damage)
- Repeat steps 2-4 until combat ends
- Combat Resolution: Handle rewards, experience, and state transitions
- Test all combinations of player and enemy actions (Attack, Guard, Sleep)
- Verify correct damage calculations and stat updates
- Check hunger costs and recovery for each action
- Test application, duration, and removal of all status effects
- Verify status effect interactions with combat actions
- Check stacking and overwriting of multiple status effects
- Test triggering conditions for boss special moves
- Verify correct application of buffs/debuffs
- Check interaction between special moves and regular combat actions
- Test various victory and defeat scenarios
- Verify correct experience and reward calculations
- Check proper state transitions post-combat
- Test combat with extreme stat values (0, max values)
- Verify graceful handling of missing components or null actions
- Check recovery from unexpected states or inputs
- Combat round resolution: < 100ms
- Status effect calculation: < 50ms
- Move combination execution: < 150ms
- Combat end check: < 50ms
- Combat system uptime: 99.9%
- Error recovery rate: 95%
- Invalid state handling success: 98%
- Calculation accuracy: 100% for damage, status effects, and move execution order
- DialogueBoxService interaction during combat
- GameState updates pre and post-combat
- SaveHandler integration for combat progress
- AnimationDisplay synchronization with combat actions
- ItemUsageContext handling during combat
- StatusEffect system integration with other game systems
Test Category | Test Case | Input | Expected Outcome | Validation Method |
---|---|---|---|---|
Basic Combat Actions | Player Attack vs Enemy Attack | Player selects ATTACK, Enemy selects ATTACK | Both entities take damage based on strength/defense stats | Health values decrease appropriately |
Player Guard vs Enemy Attack | Player selects GUARD, Enemy selects ATTACK | Player takes reduced damage | Player's health decreases by less than a normal attack | |
Player Sleep vs Enemy Guard | Player selects SLEEP, Enemy selects GUARD | Player recovers stamina, no damage dealt | Player's stamina increases, health unchanged | |
Status Effects | Confusion Effect | Player is confused and selects an action | Action may be randomly changed | Check if action executed matches selected action |
Bleeding Effect | Player has bleeding status | Player takes damage over time | Health decreases each turn by correct percentage | |
Special Moves | Enemy Special Move Combination | Enemy performs specific move sequence | Special move triggers | Special effects are applied correctly |
Invalid States | Null Action Selection | Either player or enemy action is null | Error logged, turn skipped | No crash, appropriate error message |
Missing Components | Entity missing CombatMoveComponent | Error logged, graceful handling | No crash, appropriate error message | |
Edge Cases | Zero Health Combat | Entity starts with 0 health | Combat ends immediately | Appropriate end combat event triggered |
Maximum Stat Values | Stats at maximum possible values | Calculations handle large numbers | No overflow, correct results | |
Resource Depletion | Zero Stamina Actions | Entity attempts action with 0 stamina | Appropriate handling/fallback | No crash, logical outcome |
The combat system is a critical component of our game, integrating complex mechanics, stat management, and player strategy. Effective user testing of this system is crucial to ensure a balanced, engaging, and bug-free player experience. Key points to remember:
-
Comprehensive User Testing: Due to the cyclic nature of dependencies and complex constructor arguments in our combat system, traditional unit testing is not feasible. Instead, we rely heavily on thorough and systematic user testing. This approach covers all aspects of combat, from basic actions to complex special moves and status effects. Through meticulous manual testing and user scenarios, we ensure that all game mechanics work as intended and interact correctly.
-
Performance Focus: Maintain a strong emphasis on performance metrics. Smooth, responsive combat is essential for player enjoyment and immersion.
-
AI Behavior and Edge Cases: Our combat AI employs a sophisticated system of weighted probabilities to select moves, introducing an element of controlled randomness. This AI considers factors such as current health, hunger levels, and the opponent's state when making decisions. While this creates more engaging and unpredictable combat, it also introduces a wide range of potential scenarios. Pay special attention to these varying combat flows, particularly focusing on edge cases where the AI's decision-making might lead to unusual game states. Thorough testing of these scenarios is crucial for ensuring the overall stability and polish of the game, as well as maintaining balanced and fair combat across different encounters.
-
User Experience: While technical correctness is crucial, equally important is how the combat system feels to the player. User acceptance criteria should guide testing to ensure the system is not just functional, but also intuitive and enjoyable.
-
Integration: Testing its integration with other game systems (dialogue, save/load, animations) is taken into consideration to ensure cohesive player experience and made functional sacrifices accordingly.
-
Iterative Improvement: Use the insights gained from user testing to refine and balance the combat system. Be prepared to make adjustments based on player feedback and test results.
By thoroughly testing the combat system with this framework in mind, we can deliver a polished, engaging, and technically sound combat experience that will be a cornerstone of our game's appeal. Regular revisiting of these test criteria throughout development will help maintain the quality and balance of the combat system as the game evolves.