Implementing a Rewindable Instant Replay System for Temporal Debugging Mark Wesley Lead Gameplay Programmer – 2K Marin.

Slides:



Advertisements
Similar presentations
Välkommen till Sommarkollo Introduce XNA Game Studio Express Make A Game!
Advertisements

Navigating detailed worlds with a complex, physically driven locomotion: NPC Skateboarder AI in EA’s: Mark Wesley Senior Software Engineer EA Black Box.
Macromedia Director 8 Intermediate Level Course. Ink Masks Using the Ink Mask feature will allow you to create parts of a bitmap cast member to become.
Programming Types of Testing.
Creating World Class Graphics on the PSP. Shipped Titles PSP Art Topics Asset breakdowns Open Q & A.
CS 4730 Game Design Patterns CS 4730 – Computer Game Design Credit: Some slide material courtesy Walker White (Cornell)
An Efficient Implementation of Interactive Video-on-Demand Steven Carter and Darrell Long University of California, Santa Cruz Jehan-François Pâris University.
W4118 Operating Systems OS Overview Junfeng Yang.
Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization I’m Curtis.
SCA Introduction to Multimedia
Chapter 3.7 Memory and I/O Systems. 2 Memory Management Only applies to languages with explicit memory management (C or C++) Memory problems are one of.
Chapter 3.1 Teams and Processes. 2 Programming Teams In the 1980s programmers developed the whole game (and did the art and sounds too!) Now programmers.
How to make a SIGGRAPH paper while having all the fun 
Chapter 3.6 Game Architecture. 2 Overall Architecture The code for modern games is highly complex With code bases exceeding a million lines of code, a.
SM3121 Software Technology Mark Green School of Creative Media.
Video for Mobile Device Mark Green School of Creative Media.
Computers They're Not Magic! (for the most part)‏ Adapted from Ryan Moore.
Chapter Objectives Explain Web page multimedia issues
Chapter 5.2 Character Animation. CS Overview Fundamental Concepts Animation Storage Playing Animations Blending Animations Motion Extraction Mesh.
Chapter Languages, Programming and Architecture.
Games Development 2 Entity / Architecture Review CO3301 Week
11 Games and Content Session 4.1. Session Overview  Show how games are made up of program code and content  Find out about the content management system.
CSE 381 – Advanced Game Programming 3D Game Architecture.
NV V5.7 Product Presentation. Brand New Professional GUI  Multiple User Interface for different look and feel  Audio indicator on camera (play audio.
Collision and Animation Systems in Games Jani Kajala Lead Programmer / Chief Technology Officer, Pixelgene Ltd (0)
CS333 Intro to Operating Systems Jonathan Walpole.
MOMA Display Screens K u r t R a l s k e.
Chapter 7 Structuring System Process Requirements
Games Development 2 Resource Management CO3301 Week 3.
1 Chapter 2 & Chapter 4 §Browsers. 2 Terms §Software §Program §Application.
Developing Tools for Indie Games Marc Flury Co-Founder.
Unit 1 – Improving Productivity Josh Sherriff Instructions ~ 100 words per box.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
Games Development 2 Text-based Game Data CO3301 Week 4.
2.02G Publishing Animated Videos 2.02 Develop Computer Animations.
Macromedia Flash CS4. What is Flash CS4? –Animation and interactive authoring program –Tools for complex animation, as well as excellent drawing tools.
11 A First Game Program Session Session Overview  Begin the creation of an arcade game  Learn software design techniques that apply to any form.
CHAPTER FOUR COMPUTER SOFTWARE.
Next-Gen Asset Streaming Using Runtime Statistics David Thall Insomniac Games.
SE 320 – Introduction to Game Development Lecture 8: Animations, GUIs, Debugging and IDEs Lecturer: Gazihan Alankuş Please look at the last two slides.
CSE 381 – Advanced Game Programming Loading & Caching Data.
Multimedia Web Design Professor Frank. Multimedia Combine text, graphics, sounds, and moving images in meaningful ways Use stable technology.
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
Burnout 3: Case Study (Outline) What is Burnout 3? What is Burnout 3? What does this mean? What does this mean? How did we satisfy these constraints? How.
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - VIDEO. In this chapter How digital video differs from conventional analog video How digital video differs from.
Maths & Technologies for Games Animation: Practicalities CO3303 Week 3.
Agilent Technologies Copyright 1999 H7211A+221 v Capture Filters, Logging, and Subnets: Module Objectives Create capture filters that control whether.
Nova Media Center Anthony Romano Christopher Nolan Mr. Edward Char Anthony Romano Christopher Nolan Mr. Edward Char.
Unit 1 – Improving Productivity Instructions ~ 100 words per box.
Games Development Game Architecture: Entities CO2301 Games Development 1 Week 22.
Chapter 3.6 Game Architecture. 2 Overall Architecture The code for modern games is highly complex (can easily exceed 1M LOC) The larger your program,
APB: Creating a Powerful Customisation System for a Persistent Online Action Game Maurizio Sciglio Simon Taylor.
SE 350 – Programming Games Lecture 5: Programming with Unity Lecturer: Gazihan Alankuş Please look at the last slide for assignments (marked with TODO)
Introduction Who are we? Paul Martin – Started out in the industry 1996 as PlayStation programmer – Currently a technical director and one of the principals.
2014 Animation Programming for Music Video Games Jessica Scott Harmonix Music Systems, Inc. October 10, 2014 #GHC
CGDD 4003 Character Animation. The Skeletal Hierarchy (aka the “rig”) Based on the concept of bones Each bone has exactly one parent Each bone has a transform.
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
Efficient Interactive Text Playback for Code Sharing and Tutorials
Game Architecture Rabin is a good overview of everything to do with Games A lot of these slides come from the 1st edition CS 4455.
Programs – Dynamic Linking and Loading
Pathfinding Over Streaming Terrain
Optimizing Malloc and Free
Unreal Engine and C++ We’re finally at a point where we can start working in C++ with Unreal Engine To get everything set up for this properly, we’re going.
A Look at PowerPoint 2000 The , the , and the.
Games Development Game Architecture: Entities
Games Development 2 Tools Programming
Unity Game Development
Games Development 2 Entity / Architecture Review
Presentation transcript:

Implementing a Rewindable Instant Replay System for Temporal Debugging Mark Wesley Lead Gameplay Programmer – 2K Marin

Talk contents: ● What is a “Rewindable Replay” system? ● How to implement one for debugging ● How to use it ● How to make it shippable ● Questions

But first, a quick intro to me I’ve worked on a bunch of games

Several of those included Replay of some form Mysterious Current Project

Some as a feature in the final game. ● Burnout : ● Rewindable Crash Replays ● Deterministic Race Replays ● Skate Trilogy: ● Rewindable Video Replays

Some as a non-shipping feature added purely to aid development. Mysterious Current Project

What is Rewindable Replay ● It’s Rewindable… ● It is NOT determinstic Replay ● Requires no determinism, therefore: ● It is extremely robust ● It is far more useful

What is Rewindable Replay ● Video-style replay ● As seen in many sports games ● Like a VCR/PVR attached to your game. ● BUT you can: ● Move the camera around ● Enable debug info

If a picture paints a 1000 words… ● Then how about a video? ● Note: ● I cannot show our game at this time ● Ported code back to Unreal 3 in 1 hour ●

Sounds expensive to make? ● To make it shippable, yes ● But for a dev only version, no ● For internal use only ● Doesn’t have to be pretty ● Easier to find some spare memory

Development time ● Basics can be done in 2 days ● Debug Draw and Persistent Entities ● A complete version in just 1-2 weeks ● Skeletal meshes, Temporary Entities ● Will pay for itself very quickly

Implementation (Recording) ● Circular Buffer of frames ● (e.g. last 900 frames 30fps) ● Store all debug draw ● In minimal form ● E.g. As a Sphere or AABB not as lots of lines ● Store data on relevant game entities

Minimize Memory Usage ● Use compressed / compacted structures: ● Store 3D vectors as 3 floats (not SIMD Vec4s) ● Store orientations as compressed quaternions ● Store debug text in 8 bit (not wide) chars ● Store bools as bitfields / bitmasks ● Pack everything together ● A “Bit Stream” read/writer can be handy

Storing Debug Draw ● Merge nearby 3D text into “paragraphs” ● Clamp max debug draw per frame ● But flag the frame as being overbudget ● Keep large static stuff out of replay ● E.g. Navmesh, Collision meshes, etc. ● Just draw them live

Storing Entities ● For relevant entities: ● Need a fast way of iterating over these ● Store: ● A unique ID (e.g. { Ptr, SpawnTime }) ● 3D Transform ● Bones for skeletal meshes (optional) ● Any other important display info (e.g “Damage”)

Store Game Camera ● In-game camera transform ● Useful for debugging camera ● Shows game from user’s perspective ● Allow use of manual cam too

Implementation (Playback) ● Pause the game simulation ● For the current frame: ● Render that frame’s debug draw ● Use the stored transforms for each entity ● Allow scrubbing / rewind / fast forward

Implementation (Playback) ● Entities (re-use those in paused sim): ● Render using data from the replay ● For sub-frame blending: ● Find matching entity in neighboring replay frame ● Interpolate data as appropriate ● Slerp quaternions ● Lerp vectors

Short Entity Lifetimes (1) ● Entity didn’t exist at 1 st frame of replay? ● Was spawned during replay ● Exists at end (so in current simulation) ● If not stored in current frame - don’t draw it

Short Entity Lifetimes (2) ● Entity unspawned before end of replay: ● There’s no entity to reuse… ● Show a debug draw representation ● Re-create entity (using the same mesh) ● Harder if you already unloaded the assets… ● Re-use a similar asset?

Replay – what is it good for? ● Combine with good in-game diagnostics ● E.g. Lots of Debug Draw ● Temporal Debugging ● Anything that occurred in the past ● Understanding how things change over time

Replay – what is it good for? ● Temporal Debugging examples: ● AI decision making, pathfinding, etc. ● Physics collisions / reactions ● Gameplay actions ● Animation ● Multiplayer replication

Vs. Traditional debugging tools ● Visual Studio etc. ● Good for low-level debugging… ● Terrible for higher-level debugging ● Slow to get a bigger picture view ● Only show the “now” ● Very unfriendly for non-programmers ● Particularly poor with optimized code

Vs. Traditional debugging tools ● Log Files / TTY ● Provide a partial history of what happened ● Hard to: ● Parse hundreds of pages of these ● Visualize game state in 3D ● Associate with in-game

Gameplay debugging advice ● Use higher level tools / viewers! ● E.g. a Video Replay System.

Debugging Example ●

Memory usage ● Anything > 1MB can give a “useful” replay ● To find more memory: ● On PC you probably have plenty. ● On Consoles ● Use the extra devkit memory… ● Only store a small buffer, stream the rest to disk or over the network to your PC.

If you’re still short of memory… ● Store less stuff… ● Compress / Quantize data ● Store only every N frames ● Can be variable, and on a per entity basis ● Does add a lot of complexity…

Useful Extensions ● Debug draw “channels” ● E.g. AI, Physics, Animation ● Always stored, but only displayed as required ● Serialize entire entity ● Less reliant on debug draw ● Can allow for lower-level debugging too

Useful Extensions Continued… ● Save / Load replays ● Attach to bug reports etc. ● Great for hard/slow to repro issues ● Export replays live to an external viewer ● Provide a better GUI outside of game

If you wanted to ship it… ● Someone will always request this… ● It is quite a lot more work ● Replaying everything (particles + audio) ● Fitting in retail memory ● Robust manual camera (with collision) ● Nice GUI

If you still wanted to ship it… ● Design it in from the start ● Use stateless parametric particle effects ● Plan for the memory overhead ● Plan for how you spawn / unspawn entities ● Plan for how you stream assets ● Plan for how you submit your render data

Replaying Particles ● If you don’t have a parametric system… ● Fake it by: ● Storing start and end markers ● Playing effect forwards by abs(deltaTime) ●

Any Questions? Slides and contact information available at: