Skip to main content

Example Map

Explore the included example map to understand how the AI Turret plugin works and see various configurations in action.

Accessing the Example Map

  1. Make sure Show Plugin Content is enabled in the Content Browser
  2. Navigate to PluginsAITurret ContentExamplesMaps
  3. Open ExampleTurretMap
  4. Press Play to test the turrets in action

Example Map Overview

Map Features

Turret Configurations

The example map showcases different turret setups:

Standard Turrets

  • Default Configuration: Basic turrets with standard detection range and firing rate
  • Dual Barrel Turrets: Turrets that fire from two barrels with staggered timing
  • Single Barrel Turrets: Simplified turrets with single projectile firing

Specialized Turrets

  • Short Range Turrets: Close-range defense with wide field of view
  • Long Range Turrets: Sniper-style turrets with extended detection range
  • Always Friendly Turrets: Non-hostile turrets for testing (using B_TurretAIController_AlwaysFriendly)

Interactive Elements

B_SpeedChangePad

  • Location: Various positions around the map
  • Function: Changes the projectile speed of all turrets when stepped on
  • Purpose: Demonstrates dynamic gameplay mechanics and speed testing
  • Visual: Colored pad that glows when activated

B_TeamPad

  • Location: Strategic positions throughout the map
  • Function: Changes the player's team ID when stepped on
  • Purpose: Test friend/foe detection system
  • Visual: Team-colored pads (different colors for different teams)
  • Usage: Step on different pads to see how turrets react to team changes

Map Layout

Central Arena

  • Open area for testing turret tracking and projectile physics
  • Multiple turrets with overlapping fields of fire
  • Good for testing team-based scenarios

Obstacle Course

  • Cover objects and barriers
  • Tests turret behavior with line-of-sight blocking
  • Demonstrates tracking loss and reacquisition

Range Testing Area

  • Long corridors for testing maximum detection ranges
  • Different turret configurations at various distances
  • Ideal for projectile speed and accuracy testing

Testing Scenarios

Basic Functionality Test

  1. Start the map and spawn as the default character
  2. Walk around to trigger turret detection
  3. Observe how turrets track and fire at you
  4. Use cover to break line of sight and see turrets return to base position

Team System Testing

  1. Step on different Team Pads to change your team ID
  2. Approach turrets with different team settings
  3. Observe how turrets react differently based on team relationships:
    • Same team: Turrets ignore you
    • Different team: Turrets attack
    • Neutral team: Behavior depends on turret configuration

Speed and Accuracy Testing

  1. Use Speed Change Pads to modify projectile velocity
  2. Move at different speeds (walking, running, jumping)
  3. Test evasion - see how well you can dodge projectiles at different speeds
  4. Observe lead calculation - notice how turrets predict your movement

Range and Detection Testing

  1. Approach turrets from different angles to test field of view
  2. Test maximum detection range by slowly approaching from far away
  3. Use obstacles to test line-of-sight requirements
  4. Compare different turret types and their detection capabilities

Understanding the Blueprints

Game Mode Setup

The example map uses BP_ThirdPersonGameMode which includes:

  • Player Controller: B_TeamPlayerController for team system support
  • Default Pawn: Standard third-person character
  • Proper team interface implementation

Turret Variants in the Map

B_TurretAIController Variants

  • B_TurretAIController_Short: 1000 unit sight radius
  • B_TurretAIController_Medium: 2500 unit sight radius
  • B_TurretAIController_Long: 5000 unit sight radius
  • B_TurretAIController_AlwaysFriendly: Never attacks

Projectile Configurations

Different turrets may use different projectile settings:

  • Standard Speed: Velocity Scale 2000.0
  • High Speed: Velocity Scale 4000.0
  • Low Speed: Velocity Scale 1000.0

Learning Opportunities

AI Perception System

  • Sight Cones: Visualize detection ranges and angles
  • Target Acquisition: See how turrets lock onto targets
  • Target Loss: Observe timeout behavior when losing sight

Physics and Ballistics

  • Lead Calculation: Watch how turrets predict player movement
  • Projectile Physics: Understand trajectory and speed relationships
  • Collision Detection: See projectile impact behavior

Team-Based Gameplay

  • Friend/Foe Recognition: Learn how team systems work
  • Dynamic Team Changes: Test real-time team switching
  • Multi-Team Scenarios: Understand complex team relationships

Customization Ideas

Modify the Example Map

  1. Add your own turrets with custom configurations
  2. Create new interactive elements similar to the speed/team pads
  3. Design obstacle courses to test specific scenarios
  4. Add environmental hazards that interact with turrets

Create Training Scenarios

  1. Accuracy Challenges: Set up targets and scoring systems
  2. Survival Modes: Waves of increasingly difficult turret configurations
  3. Stealth Challenges: Navigate without being detected
  4. Team Coordination: Multi-player scenarios with different teams

Performance Analysis

Optimization Insights

The example map demonstrates:

  • Efficient turret placement to avoid overlapping AI perception
  • LOD usage for distant turrets
  • Performance-friendly VFX that don't impact framerate
  • Smart AI update rates based on distance and importance

Profiling the Map

Use these console commands while playing:

  • stat ai - AI performance statistics
  • stat game - Overall game performance
  • stat niagara - VFX performance
  • showdebug ai - Visual AI debugging information

Troubleshooting

Common Issues

Turrets Not Firing

  • Check team IDs - turrets won't fire at friendly targets
  • Verify AI Perception component is properly configured
  • Ensure projectile class is set in turret properties

Performance Issues

  • Too many turrets with high update rates
  • Complex Niagara effects on slower hardware
  • AI perception overlapping too much

Visual Issues

  • Niagara plugin not enabled
  • Missing textures or materials
  • Incorrect socket configurations on custom models

Use the example map as a foundation for your own turret implementations. Experiment with different configurations to find what works best for your game!