builing brink’s smart systmtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/programming track... ·...

37
VAULT, SLIDE, MANTLE BUILDING BRINK’S SMART SYSTEM Arne Olav Hallingstad Lead Gameplay Programmer Splash Damage BRINK is a registered trademark of ZeniMax Media Inc. © 2011. ZeniMax Media Inc. All Rights Reserved.

Upload: others

Post on 17-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

VAULT, SLIDE, MANTLE BUILDING BRINK’S SMART SYSTEM

Arne Olav Hallingstad Lead Gameplay Programmer Splash Damage

BRINK is a registered trademark of ZeniMax Media Inc. © 2011. ZeniMax Media Inc. All Rights Reserved.

Page 2: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Splash Damage

Multiplayer team & objective based FPS games

Relatively small team

Evolve multiplayer shooters

Page 3: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Goals

Improve player movement

Be consistent

Be accessible

Support different body types

Shouldn’t require extra LD work

Must be usable by AI JACK MONAHAN

GAUSSWERKS.COM

Page 4: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

SMART moves

Page 5: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

What we’ll cover

Prototype

Precomputation

Runtime Detection

Runtime Execution

Lessons Learned

Page 6: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Prototype

Page 7: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Prototype

Prove viability of SMART movement

– Multiplayer game

– Impact on level design and gameplay

Prototyped using run-time collision traces

Refined over 6 months

Page 8: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Ledge Detection & Vaulting

Find ground

Find wall

Find low edge/high edge

Trace clip to ledge height

Trace clip over ledge

Trace clip down

Trace down on ledge

Page 9: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Successes

Easy to implement

No LD placed hint objects

Works on any map

Standardized map metrics

Page 10: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Issues

At least 1 trace every frame

Worst case 8 traces per player

Page 11: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Precomputation

Page 12: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Nav mesh system

Used for AI path-finding

Map-compile step

Areas connected by reachabilities

Potential use for SMART?

Page 13: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Reachabilities

Get all edges between two areas

Edges overlap vertically we may create a reachability

Stores edge segment

travel_flags

Page 14: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Reachability Types

barrier_vault barrier_mantle AI pathfinding Used by players & bots barrier_dynamic

– Used by players only – Vault/Mantle move decided at

runtime – Explosion in number of reachabilities

barrier_dynamic barrier_mantle barrier_vault

Page 15: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Slide

Areas marked low ceiling

Bots & players required to crouch

Players can auto slide into these areas

Page 16: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Runtime Detection

Page 17: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Player Physics Loop

Step 1: Is player on ground? Step 2: Query player body type for available movement

modes Step 3: Detect high moves (vault, mantle, wall hop) Step 4: Detect low moves (slides) Step 5: Choose active move Step 6: Update player state machine

Page 18: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Step 3: Detect High Move

3.1: Player checks

3.2: Nav mesh query

3.3: Evaluate high moves

Page 19: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Step 3.1: Player Checks

• Cannot be in active state

• Vaulting

• Mantling

• Sliding

• Iron-sighting

• Knocked down

Page 20: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Step 3.2: Nav Mesh Query

Search bounds 6x player b-box width & 2.5x player height

Areas = GetBoundsAreas( searchBounds )

– Areas in BSP-tree

For each Area

– For each Reachability

• barrier_vault, barrier_mantle or barrier_dynamic

• Append to list

Page 21: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Step 3.3: Evaluate High Moves

Iterate all reachabilities – Player must look at the ledge – Distance within 2.5x player b-box width

Vault: ledge height is 0.4x-0.8x player height

Mantle: ledge height is 0.8x-1.4x player height

Auto wall hop: Ledge height is mantle height + player’s jump height

Page 22: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Step 3.3: Evaluate High Moves

Reachability list

Exclude wall hop if vault/mantle in list

Mutual exclusion

– Allow mantle if within 1.5x player b-box width

– Otherwise: Allow vault

Sort potential moves by closest ledge

Page 23: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Player Physics Loop

Step 1: Is player on ground? Step 2: Query player body type for available movement

modes Step 3: Detect high moves (vault, mantle, wall hop) Step 4: Detect low moves (slide) Step 5: Choose active move Step 6: Update player for delta time

Page 24: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Step 4: Detect Slide

4.1: Player checks

4.2: Nav mesh query

4.3: Evaluate low moves

Page 25: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Step 4.3: Evaluate Low Moves

Iterate all areas Area within height of 0.4x player height Area marked as low ceiling Auto crouch: distance < small number Auto slide: distance within 1.5x player b-

box width Mutual exclusion

– Allow auto slide if sprint held – Otherwise: Allow auto crouch

Page 26: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Step 5: Choose Active Move

Page 27: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Runtime Execution

Page 28: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Vault Physics States

Intro and exit states Intro

– Duration: Distance and player velocity – Spline from player position to ledge

Exit – Calculates momentum – Calculates direction – Clear momentum if drop too high

(trace)

Intro Exit

Page 29: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Mantle Physics States

Intro, climb and exit states Spline calculation same as vault Intro

– Duration calculation same as vault – Push player to correct position

Climb – Duration scaled up during climb – Pulls the player on top of ledge

Exit - Clear momentum

Intro Climb Exit

Page 30: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Slide & Wall Hop Physics States

Sliding – Force crouch

– Constant velocity in direction of travel for a second

Wall Hop – Single frame state

– Only light body type may wall hop

Wall Hop Slide

Page 31: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Third Person Animations

Animations driven by physics state

Slide - Play slide animation

Vault - Intro plays vault animation

Mantle

– Intro plays grab animation

– Climb plays mantle animation as root motion

Page 32: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Third Person Animations

Animations driven by physics state

Slide - Play slide animation

Vault - Intro plays vault animation

Mantle

– Intro plays grab animation

– Climb plays mantle animation as root motion

Page 33: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player
Page 34: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Conclusions

More fluid movement

SMART Button

Generated during map-compile step

Free flow restricted by body types

Page 35: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Lessons Learned

Prototyping allows quick iterations

Systems can successfully be used beyond their original intention

Could give client authority over physics

Consolidating physics states saves network bandwidth

Page 36: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Arne Olav Hallingstad

[email protected]

@arneolavhal @splashdamage

www.splashdamage.com

Page 37: BUILING BRINK’S SMART SYSTMtwvideo01.ubm-us.net/o1/vault/gdc2012/slides/Programming Track... · Step 4.3: Evaluate Low Moves Iterate all areas Area within height of 0.4x player

Questions?