TEAM_MARKER_CAMERA_GUIDE.md 4.4 KB

Team Marker Camera Control System

This system provides enhanced camera controls for centering on the team marker and managing map overview in your RPG game.

Features

🎯 Team Marker Centering

  • Hotkey: Press C to center the camera on the team marker
  • Auto-Focus: Automatically zooms to a comfortable level when centering
  • Auto-Center: Optionally auto-centers when the team marker is first placed

🗺️ Full Map Overview

  • Hotkey: Press F to zoom out and show the entire map
  • Smart Sizing: Automatically calculates the best zoom level to fit the whole map
  • Increased Zoom Range: Enhanced zoom-out capability for large maps

🎮 Enhanced Controls

  • Smooth Movement: All camera movements are smoothly animated
  • Manual Override: User can take manual control during automatic movements
  • Help System: Press H to see available controls

Implementation

Method 1: Enhanced Existing Controllers

The following camera controllers have been enhanced with team marker functionality:

MapCameraController (BattleFieldMaker)

  • Enhanced for battlefield/map scenes
  • Respects UI boundaries (doesn't interfere with side panels)
  • Default hotkeys: C (center), F (full map), H (help)

MMCameraController (MapMaker2)

  • Enhanced for MapMaker2 scenes
  • Full camera control with mouse drag support
  • Default hotkeys: C (center), F (full map), H (help)

Method 2: Universal Component (Recommended)

TeamMarkerCameraController

A universal component that can be attached to any camera to provide team marker functionality.

Usage:

  1. Add the TeamMarkerCameraController script to your main camera
  2. Configure the settings in the inspector
  3. The component will automatically find the team marker and provide controls

Key Settings:

  • centerOnTeamKey: Key to center on team marker (default: C)
  • zoomToFullMapKey: Key to zoom to full map (default: F)
  • centeringSpeed: Speed of camera animations (default: 2)
  • focusZoomLevel: Zoom level when focusing on team (default: 15)
  • maxZoomOut: Maximum zoom out for full map (default: 200)
  • autoCenterOnTeamPlacement: Auto-center when team is placed (default: true)

Hotkeys Summary

Key Action Description
C Center on Team Centers camera on team marker with comfortable zoom
F Full Map View Zooms out to show entire map
H Show Help Displays available controls in console
Mouse Wheel Zoom Standard zoom in/out
WASD/Arrows Move Manual camera movement (where supported)
Middle Mouse Drag Drag camera around (where supported)

Integration with Existing Systems

Team Placement Integration

  • Automatically detects SimpleTeamPlacement component
  • Works with both exploration and non-exploration modes
  • Handles coordinate system conversions automatically

Map System Integration

  • Compatible with MapMaker2
  • Automatically detects map dimensions for full map view
  • Works with both static and dynamically generated maps

UI Integration

  • Respects UI panel boundaries in MapCameraController
  • Doesn't interfere with existing UI systems
  • Can be easily enabled/disabled as needed

Troubleshooting

"Team marker not found" Warning

  • Ensure SimpleTeamPlacement component exists in the scene
  • Check that the team has been placed (call RandomlyPlaceTeam() if needed)
  • Verify the team marker GameObject exists and is active

Camera Not Moving

  • Check that the camera has the enhanced controller script attached
  • Ensure the script is enabled and not conflicting with other camera scripts
  • Verify hotkeys are not being captured by other systems

Zoom Levels

  • Adjust maxZoom in camera controllers for larger zoom range
  • Modify focusZoomLevel for preferred team marker focus distance
  • Use maxZoomOut in TeamMarkerCameraController to limit maximum zoom

Performance Notes

  • All camera movements use smooth interpolation for better UX
  • Automatic movement stops when target is reached to save performance
  • Manual controls override automatic movement to prevent conflicts
  • Component automatically finds required references at startup

Future Enhancements

Possible future improvements:

  • Save/restore camera positions
  • Multiple preset camera positions
  • Follow mode for team marker during movement
  • Minimap integration
  • Custom zoom curves for different map sizes