BATTLECAM™: A Dynamic Camera System for Real-Time Strategy Games Yangli Hector Yee Graphics Programmer, Petroglyph hector@petroglyphgames.com Elie Arabian Lead Artist, Petroglyph elie@petroglyphgames.com
Overview Background Theory Implementation Hacks Cinematic Shots Question & Answers
Background – History RTS Bird’s Eye (Dune 2) First Person (Dungeon Keeper) Scripted Actor & Camera (Warcraft 3) Unscripted Actor, Unscripted Camera (Star Wars – Empire at War)
Background - Problem Make a ‘movie’ from an RTS battle Actors can move during shot Actors can die during shot Players can move actors Objects can move into camera
Background - Solution Pick most interesting object Construct shot Play shot Fallback on death Pick next object Hijack existing camera scripting
Theory – Visual Attention How to pick ‘interesting object’ Bottom Up: Stimulus Intensity (black on white) Motion (moving stuff) Color (red on green) Orientation (circle in stripes) Top Down: Goals Game Objectives Current User Selection
Theory – Bottom Up Attn. Image Orientation Color Spatial Frequency Intensity Motion Feature Maps Conspicuity Maps Saliency Map Reference : Itti L, Koch C. “A Saliency-Based Search Mechanism for Overt and Covert Shifts of Visual Attention.” Vision Research, pp. 263, Vol 40(10 - 12), 2000
Center Surround Mechanism Intensity Feature Maps Lateral Inhibition Intensity Conspicuity Maps
Lateral Inhibition One signal vs similar signals
Lateral Inhibition Purpose : Promote areas with significantly conspicuous features while suppressing those that are non-conspicuous. (Before Inhibition) (After Inhibition)
Implementation Game Logic Driven Images too expensive No screen space stuff Access to game logic info
Implementation – Data Game logic data (stimulus) Size Attack power Location Health Game logic data (goal driven) Current selection Visibility
Computing Saliency E.g. Saliency_Speed for object(i) Saliency_speed(i) = (speed(i) – min_speed)/ (max_speed – min_speed) Normalized 0 to 1 Three Normalization modes Large is important Small is imporant Closeness to mean is important
Normalization Modes Large is important Small is important Saliency_val(i) = (val(i) – min_val) / (max_val – min_val) Small is important Saliency_val(i) = 1 – (val(i) – min_val) / (max_val – min_val) Close to mean is important Saliency_val(i) = 1 – (val(i) – avg_val) / (max_val – min_val)
Normalization settings Large is important Size Attack power Targets Speed Small is important Health Close to mean is important X, Y coordinate
Lateral Inhibition Conspicuity value = saliency_val * (max_saliency_val – min_saliency_val) Signals with great difference between max and min get boosted
Importance Importance (i) = Sum of conspicuity_vals * weights Weight values Size 1.0 Power 1.0 X 0.5 Y 0.5 Health 1.0 Targets 1.5 Speed 1.0 Sort list by importance
Summary Compute normalized saliency Perform lateral inhibition Weighted sum Sort by importance
Picking interesting object Pick current selected Pick current object’s target 50% of the time Make interesting object list From list pick top 5 randomly. Reject if it was same type as the previous object looked at.
Constructing Cinematics Local Space Transform object space cinematic into world Local Space without rotation frame Use translation only World space using reference objects For artist driven cinematic constructed in world space Transform to local space
Local Space Cameras
Flyby camera shot
Circle camera shot
Chase camera shot
Hardpoint camera shot
Frigate/Target camera shot
Demo & Q&A Thanks to Jim Richmond for camera system Kevin Prangley for illustrations Petroglyph staff for support Contact Info Hector at petroglyphgames dot com