Spell Testing Guide
Comprehensive guide for testing spells in OpenRoads to ensure they work correctly and are properly balanced.
π― Testing Overview
Proper spell testing ensures:
Functionality - Spells work as intended
Balance - Spells are fair and fun
Stability - No crashes or errors
User Experience - Clear feedback and intuitive behavior
π Testing Checklist
β
Basic Functionality
β
Validation Testing
β
Edge Cases
β
Balance Testing
π οΈ Testing Environment Setup
Test Character Creation
Create characters with different configurations:
# Low-level character
test_char_low:
spell_level: 5
phys_level: 3
element: "fire"
sp: 50
# Mid-level character
test_char_mid:
spell_level: 15
phys_level: 10
element: "water"
sp: 150
# High-level character
test_char_high:
spell_level: 30
phys_level: 25
element: "air"
sp: 300Test Rooms
Use different room types:
Safe rooms - For non-combat testing
Combat rooms - With enemies for damage testing
Restricted rooms - For location restriction testing
Empty rooms - For summoning testing
Test Items
Prepare test items:
Required items - For spells with item requirements
Consumables - To test item consumption
Equipment - To test stat interactions
π§ͺ Testing Procedures
1. Syntax and Loading Tests
Check YAML Syntax:
# Validate YAML syntax online or with tools
yamllint spells/custom/your_spell.yamlTest Loading:
Start server
Check logs for loading errors
Verify spell appears in spell list
Use
spellscommand to see spell details
Common Loading Issues:
Invalid YAML syntax
Missing required properties
Invalid property values
Incorrect file location
2. Basic Casting Tests
Successful Cast Test:
Meet all requirements (level, element, SP, items)
Cast spell with valid target
Verify effects occur
Check SP deduction
Confirm cooldown starts
Requirement Failure Tests:
Test with wrong element
Test with insufficient level
Test with insufficient SP
Test without required items
Test with invalid target
3. Effect Testing
Damage Effects:
# Test spell
name: "Test Fireball"
effects:
- type: "damage"
damage_min: 20
damage_max: 30
damage_type: "fire"Test Procedure:
Cast on enemy with known HP
Verify damage is within range
Check enemy HP reduction
Test multiple casts for variance
Verify enemy death at 0 HP
Healing Effects:
# Test spell
name: "Test Heal"
effects:
- type: "heal"
heal_min: 15
heal_max: 25Test Procedure:
Reduce character HP
Cast healing spell
Verify HP increase within range
Test healing cap at max HP
Test multiple casts
Teleportation Effects:
# Test spell
name: "Test Teleport"
effects:
- type: "teleport"
teleport:
element_room: trueTest Procedure:
Note starting location
Cast teleport spell
Verify arrival at correct location
Test with different elements
Test invalid room handling
4. Timing Tests
Cast Time Testing:
name: "Test Slow Spell"
cast_time: 5Test Procedure:
Start casting
Verify "cast start" message
Wait for completion
Verify "cast complete" message
Test interruption (move/damage)
Cooldown Testing:
name: "Test Cooldown Spell"
cooldown: 10Test Procedure:
Cast spell successfully
Try to cast again immediately
Verify cooldown message
Wait for cooldown to expire
Verify spell can be cast again
5. Restriction Testing
Combat Restrictions:
restrictions:
combat_only: trueTest Procedure:
Try casting outside combat (should fail)
Enter combat
Cast spell (should succeed)
Test non_combat_only restriction
Location Restrictions:
restrictions:
required_rooms: ["1", "2"]
forbidden_rooms: ["10"]Test Procedure:
Test in required room (should work)
Test in forbidden room (should fail)
Test in neutral room (depends on required_rooms)
6. Message Testing
Test All Message Types:
messages:
success: "Test success: %s"
failure_level: "Need level %d (you're %d)"
cast_start: "Beginning test cast..."Test Procedure:
Trigger each message condition
Verify correct message displays
Check placeholder substitution
Test message formatting
π Balance Testing
Damage Balance Tests
Damage Per SP Analysis:
Test Results:
Spell: Fireball
- Damage Range: 20-35 (avg 27.5)
- SP Cost: 15
- Damage per SP: 1.83
- Comparison: Similar level spells should be 1.5-2.0DPS Testing:
Test Results:
Spell: Lightning Bolt
- Damage: 25-40 (avg 32.5)
- Cooldown: 4 seconds
- DPS: 8.125
- SP per second: 4.5 (18 SP / 4 sec)Healing Balance Tests
Healing Efficiency:
Test Results:
Spell: Greater Heal
- Healing: 40-60 (avg 50)
- SP Cost: 25
- Healing per SP: 2.0
- Cast Time: 3 seconds
- Healing per second: 16.67Utility Balance Tests
Teleportation Costs:
Short range (same area): 10-20 SP
Medium range (different area): 20-40 SP
Long range (anywhere): 40+ SP
Emergency escape: Higher cost justified
π Common Issues and Solutions
Loading Issues
Spell Not Loading:
Check file location (
spells/custom/)Verify YAML syntax
Check server logs for errors
Ensure file has
.yamlextension
Spell Not Appearing:
Check spell name conflicts
Verify required properties present
Check for validation errors
Restart server if needed
Casting Issues
Spell Won't Cast:
Verify all requirements met
Check target type and arguments
Ensure sufficient SP
Check for active cooldowns
Effects Not Working:
Verify effect syntax
Check effect type spelling
Ensure target is valid
Check for restriction conflicts
Balance Issues
Spell Too Powerful:
Increase SP cost
Add cooldown
Reduce damage/healing
Add restrictions
Spell Too Weak:
Reduce SP cost
Reduce cooldown
Increase effects
Remove unnecessary restrictions
π Performance Testing
Load Testing
Cast spell repeatedly
Monitor server performance
Check for memory leaks
Verify cleanup occurs
Concurrency Testing
Multiple players cast simultaneously
Test cooldown isolation
Verify effect independence
Check for race conditions
Stress Testing
Cast many spells quickly
Test with maximum effects
Monitor resource usage
Verify graceful degradation
π Documentation Testing
Message Clarity
Are success messages clear?
Do failure messages explain why?
Are placeholders working correctly?
Is the description accurate?
Help Integration
Does spell appear in
spellscommand?Are requirements clearly shown?
Is usage format correct?
Are examples helpful?
π― Automated Testing
Test Scripts
Create test scripts for common scenarios:
#!/bin/bash
# Basic spell test script
echo "Testing spell loading..."
# Add test commands here
echo "Testing spell casting..."
# Add casting tests here
echo "Testing spell effects..."
# Add effect verification hereRegression Testing
Test existing spells after changes
Verify backward compatibility
Check for unintended side effects
Maintain test spell library
π Test Results Documentation
Test Report Template
Spell: [Spell Name]
Date: [Test Date]
Tester: [Your Name]
Functionality Tests:
β
Loading: Pass
β
Casting: Pass
β
Effects: Pass
β οΈ Messages: Minor formatting issue
Balance Tests:
β
Damage/SP ratio: 1.8 (target: 1.5-2.0)
β
Cooldown: Appropriate
β Level requirement: Too low for power
Issues Found:
1. Success message missing target placeholder
2. Minimum level should be 12, not 8
Recommendations:
1. Fix message formatting
2. Increase min_spell_level to 12
3. Retest after changesπ Best Practices
Testing Workflow
Plan - Define what to test
Prepare - Set up test environment
Execute - Run systematic tests
Document - Record results and issues
Iterate - Fix issues and retest
Collaboration
Share test results with team
Use consistent testing procedures
Document known issues
Coordinate testing efforts
Continuous Testing
Test after every change
Maintain test spell collection
Regular balance reviews
Player feedback integration
π Conclusion
Thorough testing ensures spells are functional, balanced, and enjoyable. Take time to test systematically and document results for future reference.
Next Steps
Spell Design Guidelines - Design principles
Spell Balance Guide - Balance considerations
YAML Spell Tutorial - Implementation guide
Start Testing - Apply these procedures to your spells!
Remember: Good testing leads to great spells that players love to use! β¨
Last updated
Was this helpful?