Skip to content

Step 9: Weapon System Guide

Can TATAR edited this page Feb 23, 2026 · 2 revisions

Weapon System - Quickstart Guide

🎯 Overview

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

🚀 Quick Start

Step 1: Place Actors in Scene

  1. URFTestPlayer - Player (includes WeaponComponent, Magic Wand auto-loaded)
  2. URFTestEnemy (several) - Target enemies
  3. URFGameDirector - Enemy management

Note: URFTestPlayer already has WeaponComponent and automatically loads Magic Wand on spawn.

Step 2: Player Controller Setup

  • World Settings → Game Mode → Player Controller Class → Select URFTestPlayer
  • Or use PlayerStart to spawn URFTestPlayer

Step 3: Test

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

🎮 Controls

Movement

  • WASD or Arrow Keys - Player movement

Blueprint Functions

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

🔫 Weapon Types

Projectile Weapons

  • Magic Wand: Auto-fires at nearest enemy
  • Knife: Fires in facing direction
  • Axe: High damage, wide area

Melee Weapons

  • Garlic: Continuous damage area around player
  • Whip: Horizontal swing attack

Area Weapons

  • Santa Water: Temporary damage area at enemy location
  • Lightning Ring: Lightning at random locations

Orbit Weapons

  • King Bible: Books rotating around player
  • Song of Mana: Multiple rotating objects

Beam Weapons

  • Death Spiral: Rotating continuous beam
  • Hellfire: Fixed direction beam

Summon Weapons

  • Bone: Independent moving bone minions
  • La Borra: AI-controlled helpers

Passive Weapons

  • Laurel: Damage shield and protection
  • Clock Lancet: Time slowdown
  • Regen Ring: Continuous health regeneration

✅ Expected Behaviors

Success Criteria

  1. Auto-Fire: Player auto-fires at enemies
  2. Targeting: Projectiles go to nearest enemy
  3. Damage: All weapon types damage enemies
  4. Death: Enemies disappear when killed
  5. XP: Player gains XP on enemy death
  6. Debug: System info displayed on screen
  7. Multi-Weapon: Different weapon types work simultaneously
  8. Weapon Behaviors: Each weapon type has unique behavior

Debug Information

On-screen information:

  • Player health status
  • Weapon status and cooldowns
  • XP and level info
  • Enemy count and status

🛠️ Troubleshooting

Weapon Not Firing

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

Projectiles Not Damaging Enemies

Solution:

  • Check URFTestEnemy collision settings
  • Check projectile collision channel
  • Verify URFHealthComponent is working

Enemies Not Spawning

Solution:

  • Check if URFGameDirector exists in scene
  • Verify Game Director settings

🧪 Advanced Test Scenarios

Multi-Weapon Test

// 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);         // Passive

Weapon Type Behaviors

Each 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

Weapon Level Test

// Level up weapon
Player->LevelUpWeapon(0); // First slot

XP System Test

// Add XP manually
Player->AddTestXP(100);

📊 Performance Metrics

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

🔄 Test Cycle

  1. Start: Player spawns, equipped with weapons
  2. Movement: Player approaches enemies
  3. Fire: Auto-fire begins
  4. Damage: Projectiles damage enemies
  5. Death: Enemies die, give XP
  6. Repeat: New enemies spawn

🎯 Next Steps

After successful testing:

  1. New Weapons: Create custom weapons for each type
  2. Weapon Evolution: Test evolution system
  3. Stat Modifiers: Test global stat bonuses
  4. Blueprint Integration: Create custom weapons in Blueprint
  5. Performance Optimization: Optimize multi-weapon performance
  6. Visual Effects: Add custom effects for each weapon type

🏆 Completed Features

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.

Clone this wiki locally