SlideShare a Scribd company logo
1 of 12
Chapter 3.6
Debugging Games
2
The Five Step
Debugging Process
1. Reproduce the problem consistently
2. Collect clues
3. Pinpoint the error
4. Repair the problem
5. Test the solution
3
Step 1: Reproduce the
Problem Consistently
Sample repro steps:
1. Start a single player game
2. Choose Skirmish on map 44
3. Find the enemy camp
4. From a distance, use projectile weapons
to attack the enemies at the camp
5. Result: 90 percent of the time the game
crashes
4
Step 2:
Collect Clues
 Each clue a chance to rule out a cause
 Each clue a chance to narrow down the
list of suspects
 Realize that some clues can be
misleading and should be ignored
5
Step 3:
Pinpoint the Error
Two main methods:
1. Propose a Hypothesis

You have an idea what is causing the bug

Design tests to prove or disprove your
hypothesis
2. Divide and Conquer

Narrow down what could be causing the bug
 Eliminate possibilities from the top down or
 Backtrack from the point of failure upward
6
Step 4:
Repair the Problem
 Propose solution
 Consider implications at point in project
 Programmer who wrote the code should
ideally fix the problem (or at least be
consulted)
 Explore other ways the bug could occur
 Ensure underlying problem fixed and not
just a symptom of the problem
7
Step 5:
Test the Solution
 Verify the bug was fixed
 Check original repro steps
 Ideally have someone else
independently verify the fix
 Make sure no new bugs were
introduced
 At the very end of the project, have
other programmers review the fix
8
Expert Debugging Tips
 Question assumptions
 Minimize interactions and interference
 Minimize randomness
 Break complex calculations into steps
 Check boundary conditions
 Disrupt parallel computations
 Exploit tools in the debugger
 Check code that has recently changed
 Explain the bug to someone else
 Debug with a partner
 Take a break from the problem
 Get outside help
9
Tough Debugging Scenarios
 Bug exists in Release but not Debug
 Uninitialized data or optimization issue
 Bug exists on final hardware, not dev-kit
 Find out how they differ – usually memory size or disc emulation
 Bug disappears when changing something innocuous
 Timing or memory overwrite problem
 Intermittent problems
 Record as much info when it does happen
 Unexplainable behavior
 Retry, Rebuild, Reboot, Reinstall
 Internal compiler errors
 Full rebuild, divide and conquer, try other machines
 Suspect it’s not your code
 Check for patches, updates, or reported bugs
 Contact console maker, library maker, or compiler maker
10
Understanding the
Underlying System
 Knowing C or C++ not enough
 Know how the compiler implements code
 Know the details of your hardware

Especially important for console development
 Know how assembly works and be able to
read it

Helps with optimization bugs or compiler issues
11
Adding Infrastructure
to Assist in Debugging
 Alter game variables during gameplay
 Visual AI diagnostics
 Logging capability
 Recording and playback capability
 Track memory allocation
 Print as much information as possible on a
crash
 Educate your entire team
 testers, artists, designers, producers
12
Prevention of Bugs
 Set compiler to highest warning level
 Set compiler warnings to be errors
 Compiler on multiple compilers
 Write your own memory manager
 Use asserts to verify assumptions
 Initialize variables when they are declared
 Bracket loops and if statements
 Use cognitively different variable names
 Avoid identical code in multiple places
 Avoid magic (hardcoded) numbers
 Verify code coverage when testing

More Related Content

Viewers also liked (20)

Comenzar
ComenzarComenzar
Comenzar
 
Introduccion
IntroduccionIntroduccion
Introduccion
 
Informe de lectura2
Informe de lectura2Informe de lectura2
Informe de lectura2
 
Confirmation letter CAMBRIC
Confirmation letter CAMBRICConfirmation letter CAMBRIC
Confirmation letter CAMBRIC
 
Blalalalalalalalalalalalalalala
BlalalalalalalalalalalalalalalaBlalalalalalalalalalalalalalala
Blalalalalalalalalalalalalalala
 
Ple
Ple Ple
Ple
 
SITUACIÓN ACTUAL DEL MERCADO LABORAL
SITUACIÓN ACTUAL DEL MERCADO LABORAL SITUACIÓN ACTUAL DEL MERCADO LABORAL
SITUACIÓN ACTUAL DEL MERCADO LABORAL
 
MIS AVANCES EN EMPOWER NETWORK
MIS AVANCES EN EMPOWER NETWORKMIS AVANCES EN EMPOWER NETWORK
MIS AVANCES EN EMPOWER NETWORK
 
UNAPEC
UNAPECUNAPEC
UNAPEC
 
Luz tema3
Luz tema3Luz tema3
Luz tema3
 
Presentación1
Presentación1Presentación1
Presentación1
 
Blogger
BloggerBlogger
Blogger
 
Auto Cad Cert.
Auto Cad Cert.Auto Cad Cert.
Auto Cad Cert.
 
Comenzar
ComenzarComenzar
Comenzar
 
SEGURIDAD INFORMÁTICA
SEGURIDAD INFORMÁTICASEGURIDAD INFORMÁTICA
SEGURIDAD INFORMÁTICA
 
Que fofo vanessa cardozo]
Que fofo vanessa cardozo]Que fofo vanessa cardozo]
Que fofo vanessa cardozo]
 
MIS NEGOCIOS
MIS NEGOCIOSMIS NEGOCIOS
MIS NEGOCIOS
 
Muñoz vanegas red lan
Muñoz  vanegas red lanMuñoz  vanegas red lan
Muñoz vanegas red lan
 
Tic2 PRIMERA ACTIVIDAD,
Tic2 PRIMERA ACTIVIDAD,Tic2 PRIMERA ACTIVIDAD,
Tic2 PRIMERA ACTIVIDAD,
 
2013 Volume Top Team
2013 Volume Top Team2013 Volume Top Team
2013 Volume Top Team
 

Similar to 3.6 debugging games (20)

Debugging
DebuggingDebugging
Debugging
 
debugging.ppt
debugging.pptdebugging.ppt
debugging.ppt
 
Quality Assurance 1: Why Quality Matters
Quality Assurance 1: Why Quality MattersQuality Assurance 1: Why Quality Matters
Quality Assurance 1: Why Quality Matters
 
Lakeview Squares
Lakeview SquaresLakeview Squares
Lakeview Squares
 
Lakeview Squares
Lakeview SquaresLakeview Squares
Lakeview Squares
 
Debugging
DebuggingDebugging
Debugging
 
Making a game "Just Right" through testing and play balancing
Making a game "Just Right" through testing and play balancingMaking a game "Just Right" through testing and play balancing
Making a game "Just Right" through testing and play balancing
 
Big Java Chapter 1
Big Java Chapter 1Big Java Chapter 1
Big Java Chapter 1
 
The Art Of Debugging
The Art Of DebuggingThe Art Of Debugging
The Art Of Debugging
 
Windows Crash Dump Analysis
Windows Crash Dump AnalysisWindows Crash Dump Analysis
Windows Crash Dump Analysis
 
Bad ram or ddr
Bad ram or ddrBad ram or ddr
Bad ram or ddr
 
Build your own pc & trubleshooting by Sayyed Misbah
Build your own pc & trubleshooting by Sayyed MisbahBuild your own pc & trubleshooting by Sayyed Misbah
Build your own pc & trubleshooting by Sayyed Misbah
 
Practices of agile developers
Practices of agile developersPractices of agile developers
Practices of agile developers
 
PHP games
PHP gamesPHP games
PHP games
 
Exploratory testing workshop
Exploratory testing workshopExploratory testing workshop
Exploratory testing workshop
 
Bsod presentation
Bsod presentationBsod presentation
Bsod presentation
 
Introduction to Basic IT Knowledge.pptx
Introduction to Basic IT  Knowledge.pptxIntroduction to Basic IT  Knowledge.pptx
Introduction to Basic IT Knowledge.pptx
 
Common asp.net production issues rev
Common asp.net production issues revCommon asp.net production issues rev
Common asp.net production issues rev
 
Computer basics worksheet
Computer basics worksheetComputer basics worksheet
Computer basics worksheet
 
Preocupações Desenvolvedor Ágil
Preocupações Desenvolvedor ÁgilPreocupações Desenvolvedor Ágil
Preocupações Desenvolvedor Ágil
 

More from Sayed Ahmed

Workplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsWorkplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsSayed Ahmed
 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commandsSayed Ahmed
 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic frameworkSayed Ahmed
 
Sap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSayed Ahmed
 
Will be an introduction to
Will be an introduction toWill be an introduction to
Will be an introduction toSayed Ahmed
 
Whm and cpanel overview hosting control panel overview
Whm and cpanel overview   hosting control panel overviewWhm and cpanel overview   hosting control panel overview
Whm and cpanel overview hosting control panel overviewSayed Ahmed
 
Web application development using zend framework
Web application development using zend frameworkWeb application development using zend framework
Web application development using zend frameworkSayed Ahmed
 
Web design and_html_part_3
Web design and_html_part_3Web design and_html_part_3
Web design and_html_part_3Sayed Ahmed
 
Web design and_html_part_2
Web design and_html_part_2Web design and_html_part_2
Web design and_html_part_2Sayed Ahmed
 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_htmlSayed Ahmed
 
Visual studio ide shortcuts
Visual studio ide shortcutsVisual studio ide shortcuts
Visual studio ide shortcutsSayed Ahmed
 
Unit tests in_symfony
Unit tests in_symfonyUnit tests in_symfony
Unit tests in_symfonySayed Ahmed
 
Telerik this is sayed
Telerik this is sayedTelerik this is sayed
Telerik this is sayedSayed Ahmed
 
System analysis and_design
System analysis and_designSystem analysis and_design
System analysis and_designSayed Ahmed
 
Story telling and_narrative
Story telling and_narrativeStory telling and_narrative
Story telling and_narrativeSayed Ahmed
 

More from Sayed Ahmed (20)

Workplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsWorkplace, Data Analytics, and Ethics
Workplace, Data Analytics, and Ethics
 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commands
 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework
 
Sap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSap hana-ide-overview-nodev
Sap hana-ide-overview-nodev
 
Invest wisely
Invest wiselyInvest wisely
Invest wisely
 
Will be an introduction to
Will be an introduction toWill be an introduction to
Will be an introduction to
 
Whm and cpanel overview hosting control panel overview
Whm and cpanel overview   hosting control panel overviewWhm and cpanel overview   hosting control panel overview
Whm and cpanel overview hosting control panel overview
 
Web application development using zend framework
Web application development using zend frameworkWeb application development using zend framework
Web application development using zend framework
 
Web design and_html_part_3
Web design and_html_part_3Web design and_html_part_3
Web design and_html_part_3
 
Web design and_html_part_2
Web design and_html_part_2Web design and_html_part_2
Web design and_html_part_2
 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_html
 
Visual studio ide shortcuts
Visual studio ide shortcutsVisual studio ide shortcuts
Visual studio ide shortcuts
 
Virtualization
VirtualizationVirtualization
Virtualization
 
User interfaces
User interfacesUser interfaces
User interfaces
 
Unreal
UnrealUnreal
Unreal
 
Unit tests in_symfony
Unit tests in_symfonyUnit tests in_symfony
Unit tests in_symfony
 
Telerik this is sayed
Telerik this is sayedTelerik this is sayed
Telerik this is sayed
 
System analysis and_design
System analysis and_designSystem analysis and_design
System analysis and_design
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
 
Story telling and_narrative
Story telling and_narrativeStory telling and_narrative
Story telling and_narrative
 

Recently uploaded

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

3.6 debugging games

  • 2. 2 The Five Step Debugging Process 1. Reproduce the problem consistently 2. Collect clues 3. Pinpoint the error 4. Repair the problem 5. Test the solution
  • 3. 3 Step 1: Reproduce the Problem Consistently Sample repro steps: 1. Start a single player game 2. Choose Skirmish on map 44 3. Find the enemy camp 4. From a distance, use projectile weapons to attack the enemies at the camp 5. Result: 90 percent of the time the game crashes
  • 4. 4 Step 2: Collect Clues  Each clue a chance to rule out a cause  Each clue a chance to narrow down the list of suspects  Realize that some clues can be misleading and should be ignored
  • 5. 5 Step 3: Pinpoint the Error Two main methods: 1. Propose a Hypothesis  You have an idea what is causing the bug  Design tests to prove or disprove your hypothesis 2. Divide and Conquer  Narrow down what could be causing the bug  Eliminate possibilities from the top down or  Backtrack from the point of failure upward
  • 6. 6 Step 4: Repair the Problem  Propose solution  Consider implications at point in project  Programmer who wrote the code should ideally fix the problem (or at least be consulted)  Explore other ways the bug could occur  Ensure underlying problem fixed and not just a symptom of the problem
  • 7. 7 Step 5: Test the Solution  Verify the bug was fixed  Check original repro steps  Ideally have someone else independently verify the fix  Make sure no new bugs were introduced  At the very end of the project, have other programmers review the fix
  • 8. 8 Expert Debugging Tips  Question assumptions  Minimize interactions and interference  Minimize randomness  Break complex calculations into steps  Check boundary conditions  Disrupt parallel computations  Exploit tools in the debugger  Check code that has recently changed  Explain the bug to someone else  Debug with a partner  Take a break from the problem  Get outside help
  • 9. 9 Tough Debugging Scenarios  Bug exists in Release but not Debug  Uninitialized data or optimization issue  Bug exists on final hardware, not dev-kit  Find out how they differ – usually memory size or disc emulation  Bug disappears when changing something innocuous  Timing or memory overwrite problem  Intermittent problems  Record as much info when it does happen  Unexplainable behavior  Retry, Rebuild, Reboot, Reinstall  Internal compiler errors  Full rebuild, divide and conquer, try other machines  Suspect it’s not your code  Check for patches, updates, or reported bugs  Contact console maker, library maker, or compiler maker
  • 10. 10 Understanding the Underlying System  Knowing C or C++ not enough  Know how the compiler implements code  Know the details of your hardware  Especially important for console development  Know how assembly works and be able to read it  Helps with optimization bugs or compiler issues
  • 11. 11 Adding Infrastructure to Assist in Debugging  Alter game variables during gameplay  Visual AI diagnostics  Logging capability  Recording and playback capability  Track memory allocation  Print as much information as possible on a crash  Educate your entire team  testers, artists, designers, producers
  • 12. 12 Prevention of Bugs  Set compiler to highest warning level  Set compiler warnings to be errors  Compiler on multiple compilers  Write your own memory manager  Use asserts to verify assumptions  Initialize variables when they are declared  Bracket loops and if statements  Use cognitively different variable names  Avoid identical code in multiple places  Avoid magic (hardcoded) numbers  Verify code coverage when testing