-
Notifications
You must be signed in to change notification settings - Fork 0
Step 9: Weapon System Guide
Vampire Survivors-style multi-weapon system with 7 weapon types, automatic targeting, and auto-fire support.
Key Features:
- 6-slot weapon inventory
- 7 weapon types: Projectile, Melee, Area, Orbit, Beam, Summon, Passive
- Automatic targeting and firing
- Projectile system (pierce, bounce, homing)
- XP and level system integration
- URFTestPlayer - Player (includes WeaponComponent, Magic Wand auto-loaded)
- URFTestEnemy (several) - Target enemies
- URFGameDirector - Enemy management
Note: URFTestPlayer already has WeaponComponent and automatically loads Magic Wand on spawn.
- World Settings → Game Mode → Player Controller Class → Select URFTestPlayer
- Or use PlayerStart to spawn URFTestPlayer
When you start the game:
- Player equipped with weapons from Starting Weapons array
- Projectile weapons (Magic Wand) auto-fire at nearest enemies
- Melee weapons (Garlic) create continuous damage area around player
- Enemies give XP when killed
- Debug info displayed on screen
- WASD or Arrow Keys - Player movement
Available test functions in URFTestPlayer:
-
AddTestWeapon(WeaponData, Level)- Add new weapon -
LevelUpWeapon(SlotIndex)- Level up weapon -
ToggleAutoFire()- Toggle auto-fire -
AddTestXP(Amount)- Add XP manually
- Magic Wand: Auto-fires at nearest enemy
- Knife: Fires in facing direction
- Axe: High damage, wide area
- Garlic: Continuous damage area around player
- Whip: Horizontal swing attack
- Santa Water: Temporary damage area at enemy location
- Lightning Ring: Lightning at random locations
- King Bible: Books rotating around player
- Song of Mana: Multiple rotating objects
- Death Spiral: Rotating continuous beam
- Hellfire: Fixed direction beam
- Bone: Independent moving bone minions
- La Borra: AI-controlled helpers
- Laurel: Damage shield and protection
- Clock Lancet: Time slowdown
- Regen Ring: Continuous health regeneration
- Auto-Fire: Player auto-fires at enemies
- Targeting: Projectiles go to nearest enemy
- Damage: All weapon types damage enemies
- Death: Enemies disappear when killed
- XP: Player gains XP on enemy death
- Debug: System info displayed on screen
- Multi-Weapon: Different weapon types work simultaneously
- Weapon Behaviors: Each weapon type has unique behavior
On-screen information:
- Player health status
- Weapon status and cooldowns
- XP and level info
- Enemy count and status
Solution:
- URFTestPlayer already has WeaponComponent (auto-added)
- Auto-fire already enabled (default setting)
- Check if enemies exist in scene
- Magic Wand auto-loads, no manual addition needed
Solution:
- Check URFTestEnemy collision settings
- Check projectile collision channel
- Verify URFHealthComponent is working
Solution:
- Check if URFGameDirector exists in scene
- Verify Game Director settings
// In Blueprint or C++
Player->AddTestWeapon(MagicWandAsset, 1); // Projectile
Player->AddTestWeapon(GarlicAsset, 1); // Melee
Player->AddTestWeapon(SantaWaterAsset, 1); // Area
Player->AddTestWeapon(KingBibleAsset, 1); // Orbit
Player->AddTestWeapon(DeathSpiralAsset, 1); // Beam
Player->AddTestWeapon(BoneAsset, 1); // Summon
Player->AddTestWeapon(LaurelAsset, 1); // PassiveEach weapon type has different behavior:
- Projectile: Fires projectiles at enemies
- Melee: Continuous damage area around player
- Area: Temporary damage areas at target locations
- Orbit: Objects rotating around player
- Beam: Rotating or fixed beam attacks
- Summon: Independent moving minions
- Passive: Shields, stat bonuses, special effects
// Level up weapon
Player->LevelUpWeapon(0); // First slot// Add XP manually
Player->AddTestXP(100);Performance indicators to monitor during testing:
- FPS: Target 60+ FPS
- Memory: No memory leaks
- Projectile Count: No excessive projectile accumulation
- Enemy Count: Enemy count under control
- Start: Player spawns, equipped with weapons
- Movement: Player approaches enemies
- Fire: Auto-fire begins
- Damage: Projectiles damage enemies
- Death: Enemies die, give XP
- Repeat: New enemies spawn
After successful testing:
- New Weapons: Create custom weapons for each type
- Weapon Evolution: Test evolution system
- Stat Modifiers: Test global stat bonuses
- Blueprint Integration: Create custom weapons in Blueprint
- Performance Optimization: Optimize multi-weapon performance
- Visual Effects: Add custom effects for each weapon type
✅ 7 Weapon Types: Projectile, Melee, Area, Orbit, Beam, Summon, Passive
✅ WeaponComponent Integration: All weapon types supported
✅ Auto-Fire System: Optimized for each weapon type
✅ Targeting System: Different targeting per weapon type
✅ Stat System: All weapon types use stat system
✅ Blueprint Friendly: Entire system accessible from Blueprint
✅ Performance Optimized: Efficient collision and update systems
Note: This system is developed with a Foundation-First approach. New features can be added after core functionality is solid.