Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Game Programming 05 - Development Tools

696 views

Published on

Chapter 5 of the lecture Game Programming taught at HAW Hamburg.

Introduction to continuous integration, API documentation generation, analytics, static code analysis and crash dump analysis.

Published in: Technology
  • Be the first to comment

Game Programming 05 - Development Tools

  1. 1. Game Programming Development Tools Nick Prühs
  2. 2. Objectives • To understand the importance of improved workflows • To get an idea of which kinds of useful tools are out there • To learn how to integrate tools into your daily workflow 2 / 43
  3. 3. Automated Builds • Allow you to create nightly releases of your current game version • Automate any pre- and post-build steps required for creating new builds • Track build successes and failures and their reasons • Provide access to previous builds (history) • Can parameterize build input and output 3 / 43
  4. 4. Automated Builds 4 / 43 Jenkins CI – Slash Games
  5. 5. Automated Builds 5 / 43 Jenkins CI – Project Page
  6. 6. Typical Build Steps • Accessing source control ▪ Syncing working copy ▪ Creating tags • Writing version numbers • Performing the actual build • Packaging the build result • Publishing the game on a build page • Running unit tests • Sending email notifications 6 / 43
  7. 7. Automated Builds 7 / 43 Jenkins CI – Project Configuration
  8. 8. Automated Builds 8 / 43 Jenkins CI – Build Result
  9. 9. API Documentation • Can be automatically generated from properly formatted source code comments • Output format may vary (usually HTML) • Tools are available for all major object-oriented languages (Javadoc, Sandcastle, Doxygen) 9 / 43
  10. 10. Javadoc 10 / 43 Javadoc Comments
  11. 11. Javadoc 11 / 43 Javadoc – Invoked From Command Line javadoc -d api -sourcepath src -subpackages com.example.project
  12. 12. Javadoc 12 / 43 Javadoc API Documentation
  13. 13. Sandcastle 13 / 43 XML Documentation Comments
  14. 14. Sandcastle 14 / 43 Sandcastle Help File Builder GUI
  15. 15. Sandcastle 15 / 43 MSDN-Style API Documentation
  16. 16. Doxygen 16 / 43 Doxygen Comment Blocks
  17. 17. Doxygen 17 / 43 Doxygen GUI Frontend
  18. 18. Doxygen 18 / 43 Doxygen API Documentation
  19. 19. Analytics in Games • Track the origin, device and operation system of your players • Track user engagement ▪ Retention ▪ A/B testing • Track monetization success • Track performance ▪ Framerate ▪ Crashes 19 / 43
  20. 20. Analytics in Games • Involve many key questions ▪ What to track ▪ How to track (who, what, where, when) ▪ How to analyze data • Enough material for a whole different course 20 / 43
  21. 21. Analytics in Games 21 / 43 Game Analytics Website
  22. 22. Analytics in Games 22 / 43 Game Analytics API Call private void OnVictory(Event e) { var victoryData = (VictoryEventData)e.EventData; var eventKey = string.Format ("Level:Victory:{0}:{1}", this.currentLevel, victoryData.Type); GA.API.Design.NewEvent(eventKey); }
  23. 23. Analytics in Games 23 / 43 Game Analytics Metrics
  24. 24. Analytics in Games 24 / 43 Game Analytics Funnel
  25. 25. Consistent Code Style • StyleCop analyzes C# source code to enforce a set of style and consistency rules • Helps developers avoid common pitfalls and mistakes • Settings file can be checked in to version control 25 / 43
  26. 26. Consistent Code Style StyleCop Settings Dialog in Visual Studio 2012 26 / 43
  27. 27. Consistent Code Style Part of a StyleCop Settings File <StyleCopSettings Version="105"> <GlobalSettings> <StringProperty Name="MergeSettingsFiles">NoMerge</StringProperty> <CollectionProperty Name="RecognizedWords"> <Value>Bresenham</Value> <Value>Dijkstra</Value> <Value>Endre</Value> <Value>Fredman</Value> <Value>multigraph</Value> <Value>Stee</Value> <Value>Tarjan</Value> <Value>Tarjan's</Value> <Value>unweighted</Value> </CollectionProperty> </GlobalSettings> <Analyzers> <Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules"> <Rules> <Rule Name="DocumentationTextMustContainWhitespace"> <RuleSettings> <BooleanProperty Name="Enabled">False</BooleanProperty> </RuleSettings> </Rule> <Rule Name="ConstructorSummaryDocumentationMustBeginWithStandardText"> <RuleSettings> <BooleanProperty Name="Enabled">False</BooleanProperty> </RuleSettings> </Rule> 27 / 43
  28. 28. Consistent Code Style StyleCop Warnings in Visual Studio 2012 28 / 43
  29. 29. Static Code Analysis • ReSharper provides static code analysis • Many, many shortcuts and quick fixes • Improved refactoring • Improved search features • Code templates 29 / 43
  30. 30. Static Code Analysis R# Static Code Analysis in Visual Studio 2012 30 / 43
  31. 31. Static Code Analysis R# Suggestions in Visual Studio 2012 31 / 43
  32. 32. Static Code Analysis R# Suggestions in Visual Studio 2012 32 / 43
  33. 33. Static Code Analysis R# Suggestions in Visual Studio 2012 33 / 43
  34. 34. Eclipse Eclipse Java Code Style Clean Up Settings 34 / 43
  35. 35. Eclipse Eclipse Java Code Style Clean Up Settings 35 / 43
  36. 36. Hint Setting up tools will always take the same time. Thus, the earlier you set up your tools, the greater your benefit! 36 / 43
  37. 37. Crash Dump Analaysis • Sadly, even released games and tools will sometimes crash • Windows can automatically generate a minidump whenever a program throws an unhandled exception ▪ Loaded modules ▪ Thread information ▪ Current call stack • These can be loaded and debugged in Visual Studio 37 / 43
  38. 38. Crash Dump Analaysis 38 / 43 C:Program FilesProcdump>procdump.exe -ma -i D:TempDumps ProcDump v7.0 - Writes process dump files Copyright (C) 2009-2014 Mark Russinovich Sysinternals - www.sysinternals.com With contributions from Andrew Richards Set to: HKLMSOFTWAREMicrosoftWindows NTCurrentVersionAeDebug (REG_SZ) Auto = 1 (REG_SZ) Debugger = "C:Program FilesProcdumpprocdump.exe" -accepteula -ma -j "D:TempDumps" %ld %ld %p Set to: HKLMSOFTWAREWow6432NodeMicrosoftWindows NTCurrentVersionAeDebug (REG_SZ) Auto = 1 (REG_SZ) Debugger = "C:Program FilesProcdumpprocdump.exe" -accepteula -ma -j "D:TempDumps" %ld %ld %p ProcDump is now set as the Just-in-time (AeDebug) debugger.
  39. 39. Crash Dump Analaysis 39 / 43 C:Program FilesProcdump>procdump.exe -u ProcDump v7.0 - Writes process dump files Copyright (C) 2009-2014 Mark Russinovich Sysinternals - www.sysinternals.com With contributions from Andrew Richards Reset to: HKLMSOFTWAREMicrosoftWindows NTCurrentVersionAeDebug (REG_SZ) Auto = <deleted> (REG_SZ) Debugger = "C:WINDOWSsystem32vsjitdebugger.exe" -p %ld -e %ld Reset to: HKLMSOFTWAREWow6432NodeMicrosoftWindows NTCurrentVersionAeDebug (REG_SZ) Auto = <deleted> (REG_SZ) Debugger = "C:WINDOWSsystem32vsjitdebugger.exe" -p %ld -e %ld ProcDump is no longer the Just-in-time (AeDebug) debugger.
  40. 40. Crash Dump Analaysis 40 / 43 Deferencing a nullptr that will cause a crash
  41. 41. Crash Dump Analaysis 41 / 43 Minidump File Summary in Visual Studio
  42. 42. Crash Dump Analaysis 42 / 43 Debugging a Minidump in Visual Studio
  43. 43. References • Croy, Bayer, Kawaguchi. Jenkins CI. http://www.Jenkins.io, May 2017. • Oracle. Javadoc. http://www.oracle.com/technetwork/java/javase/documentation/index-jsp- 135444.html., May 2017 6. • Woodruff. Sandcastle Help File Builder. https://github.com/EWSoftware/SHFB, May 2017. • Dimitri. Doxygen. http://www.stack.nl/~dimitri/doxygen/, May 2017. • GameAnalytics. GameAnalytics. http://www.gameanalytics.com/, May 2017. • Microsoft. StyleCop. https://github.com/StyleCop/StyleCop, May 2017. • JetBrains. Resharper. http://www.jetbrains.com/resharper/, May 2017. • The Eclipse Foundation. Eclipse. https://www.eclipse.org/, May 2017. • MSDN. Crash Dump Analysis. http://msdn.microsoft.com/en- us/library/windows/desktop/ee416349(v=vs.85).aspx, May 2017. • MSDN. Collecting User-Mode Dumps. http://msdn.microsoft.com/en- us/library/bb787181(VS.85).aspx, May 2017. • Russinovich. ProcDump. http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx, November 18, 2016. 43 / 43
  44. 44. Thank you! http://www.npruehs.de https://github.com/npruehs @npruehs nick.pruehs@daedalic.com
  45. 45. 5 Minute Review Session • Which steps can be automated using a build server? • How can API documentation be generated automatically? • Which data can be tracked by analytics? • How can you enforce a consistent code style within your team? • Which tools can help you to detect code quality issues? • How can you debug applications that crashed outside of Visual Studio?

×