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
- Make sure Show Plugin Content is enabled in the Content Browser
- Navigate to Plugins → AITurret Content → Examples → Maps
- Open ExampleTurretMap
- Press Play to test the turrets in action
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
- Start the map and spawn as the default character
- Walk around to trigger turret detection
- Observe how turrets track and fire at you
- Use cover to break line of sight and see turrets return to base position
Team System Testing
- Step on different Team Pads to change your team ID
- Approach turrets with different team settings
- 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
- Use Speed Change Pads to modify projectile velocity
- Move at different speeds (walking, running, jumping)
- Test evasion - see how well you can dodge projectiles at different speeds
- Observe lead calculation - notice how turrets predict your movement
Range and Detection Testing
- Approach turrets from different angles to test field of view
- Test maximum detection range by slowly approaching from far away
- Use obstacles to test line-of-sight requirements
- 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
- Add your own turrets with custom configurations
- Create new interactive elements similar to the speed/team pads
- Design obstacle courses to test specific scenarios
- Add environmental hazards that interact with turrets
Create Training Scenarios
- Accuracy Challenges: Set up targets and scoring systems
- Survival Modes: Waves of increasingly difficult turret configurations
- Stealth Challenges: Navigate without being detected
- 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 statisticsstat game
- Overall game performancestat niagara
- VFX performanceshowdebug 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!