SlideShare una empresa de Scribd logo
1 de 16
Descargar para leer sin conexión
AAA game in XNA?

From the authors of Miner Wars 2081
Version: 27th March 2012



                           Marek Rosa, Keen Software House

                                      www.minerwars.com
                                       www.keenswh.com
Why XNA?
•   XNA simplifies access to DirectX 9
•   XNA is more intuitive than DirectX = less development time
•   C# / .NET vs. C++
    o   Faster compilation (seconds vs.
        minutes)
    o   Code readability
    o   Existing .NET classes and libraries
    o   Unicode strings
    o   Garbage collector
•   95% of game time is spent in GPU,
    since Miner Wars is heavily GPU
    bound, therefore it’s usually irrelevant
    that C# code is slower than C++
•   Probably easier porting and debugging
    to XBOX – but we haven’t tested it yet

                                                                 www.minerwars.com
Disadvantages of XNA
• We are bound to DX 9, e.g.
  can’t use texture atlas,
  tessellation, multi-thread
  rendering, etc. Not a problem
  right now since we have other
  priorities.
• Occasional bugs in XNA, e.g.
  device lost
• Can’t port to other platforms
  than Windows and XBOX


                                  www.minerwars.com
Scene statistics
• Voxel asteroid: 2-10 mil triangles
• Space station: 5-10 mil triangles
• Sector/scene = 50x50x50 kilometers
  o Tens of voxel asteroids
  o Tens of space stations and space ships
  o Thousands of prefab modules
• We are aiming for:
  o 60 FPS, one frame has 16.6 milliseconds
  o About 500,000 triangles in frustum
  o About 1,000 objects in frustum

                                             www.minerwars.com
Voxels
• Voxels are converted to
  triangles prior to rendering /
  collision-detection
• Cached in CPU (data cell,
  render cell)
• Cached in GPU vertex and
  index buffers (larger render
  cells with tens of thousands of
  triangles)
• Recalculated after a change
  (data/render cell invalidated
  after explosion or editor
  operation)


                                     www.minerwars.com
Deferred Renderer
•   Renders into 3 render targets (diffuse + specI, normal + specP, linear depth +
    emissivity)
•   LOD0 & LOD1 – smooth LOD transition in image space (no popping or hard
    switching)
     o LOD0 = high-poly near objects, less than 2,000 meters distance
     o LOD1 = low-poly distant objects, more than 2,000 meters distance
          o LOD1 scene has usually 100-500x less triangles than LOD0
          o Some models don’t have LOD1 (e.g. doors, small tunnels) – they fade-out to background
          o LOD1 for voxels is calculated by averaging voxel data cells
•   Dynamic environment cube-map - re-rendered as you move, ambient map and
    reflection map represent the actual surrounding
•   Sun light and shadows, point hemisphere pot lights
•   SSAO
•   FXAA
•   HDR
•   Transparent geometry (billboards, particle system – emitters, 2D animated
    parameters, generations)


                                                                                  www.minerwars.com
Smooth LOD transition in image space




                           www.minerwars.com
Smooth LOD transition in image space




                           www.minerwars.com
Screen Space Ambient Occlusion -
             SSAO




                         www.minerwars.com
Physics & Simulation
• Own in-house physics engine
• Player and AI ships are represented as boxes (spheres
  work well too)
• Voxels can be represented as voxels or triangle meshes
• Spatial hierarchies
• Tunneling avoidance for high velocity objects by
  interpolating the position between steps (e.g. missiles
  or high speed ships)
• Integration step is 60x per second
• Area sensors
                                           www.minerwars.com
Optimizations
•   We use our own in-game profiler, for performance & memory profiling
•   Focus on “algorithm and idea” optimizations
•   Hard-core low-level optimizations only in methods that are used frequently, e.g.
    collision detection calculations, pixel shaders, etc.
•   Use pruning structures, AABB, octrees, multi-dimensional queues…
•   Multi-threading for voxels and physics
     – We use Parallel Tasks
     – Consider task granularity, e.g. throwing a loop with 1000 simple iterations into parallel tasks
       won’t help. The task handling overhead is too big. Test it.
•   Vector and matrix operations – use ref/out or write it yourself, it’s faster
     – E.g. [a.x = b.x * c.x; a.y = b.y * c.y; a.z = b.z * c.z;] is way more faster than [a = b * c]
•   GPU instancing – use it for deferred lights and model rendering, about 5-10%
    speed improvement
•   If possible, pass objects by reference, avoid structs (copying on stack is expensive)
•   Don’t do object allocations during gameplay (calling “new” on a class). Use pre-
    allocated objects pools (particles, billboards, projectiles, debris objects, etc.)
     – Although, object allocations are OK during the game loading phase


                                                                                   www.minerwars.com
In-game profiler




                   www.minerwars.com
Visualizing deferred lights




                      www.minerwars.com
Render octrees




                 www.minerwars.com
Visualizing particle overdraw




                       www.minerwars.com
Thank you
• We are still looking for programmers in Prague.
• Talented students too!

                 Marek Rosa, Keen Software House

                              www.minerwars.com
                               www.keenswh.com

Más contenido relacionado

La actualidad más candente

CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingCEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingElectronic Arts / DICE
 
Khronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and VulkanKhronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and VulkanElectronic Arts / DICE
 
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14AMD Developer Central
 
Minko stage3d workshop_20130525
Minko stage3d workshop_20130525Minko stage3d workshop_20130525
Minko stage3d workshop_20130525Minko3D
 
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...Electronic Arts / DICE
 
Modern Graphics Pipeline Overview
Modern Graphics Pipeline OverviewModern Graphics Pipeline Overview
Modern Graphics Pipeline Overviewslantsixgames
 
Dx11 performancereloaded
Dx11 performancereloadedDx11 performancereloaded
Dx11 performancereloadedmistercteam
 
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas TrudelGDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas TrudelUmbra Software
 

La actualidad más candente (9)

CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time RaytracingCEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
CEDEC 2018 - Towards Effortless Photorealism Through Real-Time Raytracing
 
Khronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and VulkanKhronos Munich 2018 - Halcyon and Vulkan
Khronos Munich 2018 - Halcyon and Vulkan
 
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
 
Minko stage3d workshop_20130525
Minko stage3d workshop_20130525Minko stage3d workshop_20130525
Minko stage3d workshop_20130525
 
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
A Certain Slant of Light - Past, Present and Future Challenges of Global Illu...
 
Modern Graphics Pipeline Overview
Modern Graphics Pipeline OverviewModern Graphics Pipeline Overview
Modern Graphics Pipeline Overview
 
SEED - Halcyon Architecture
SEED - Halcyon ArchitectureSEED - Halcyon Architecture
SEED - Halcyon Architecture
 
Dx11 performancereloaded
Dx11 performancereloadedDx11 performancereloaded
Dx11 performancereloaded
 
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas TrudelGDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
GDC16: Improving geometry culling for Deus Ex: Mankind Divided by Nicolas Trudel
 

Similar a AAA game in XNA ? Miner wars 2081

Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011Andy Parsons
 
Shadow Warrior 2 and the evolution of the Roadhog Engine, GIC15
Shadow Warrior 2 and the evolution of the Roadhog Engine, GIC15Shadow Warrior 2 and the evolution of the Roadhog Engine, GIC15
Shadow Warrior 2 and the evolution of the Roadhog Engine, GIC15Jarosław Pleskot
 
Making a game with Molehill: Zombie Tycoon
Making a game with Molehill: Zombie TycoonMaking a game with Molehill: Zombie Tycoon
Making a game with Molehill: Zombie TycoonJean-Philippe Doiron
 
Cassandra Performance and Scalability on AWS
Cassandra Performance and Scalability on AWSCassandra Performance and Scalability on AWS
Cassandra Performance and Scalability on AWSAdrian Cockcroft
 
Terrain in Battlefield 3: A Modern, Complete and Scalable System
Terrain in Battlefield 3: A Modern, Complete and Scalable SystemTerrain in Battlefield 3: A Modern, Complete and Scalable System
Terrain in Battlefield 3: A Modern, Complete and Scalable SystemElectronic Arts / DICE
 
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3jasinb
 
BGF 2012 (Browsergames Forum)
BGF 2012 (Browsergames Forum)BGF 2012 (Browsergames Forum)
BGF 2012 (Browsergames Forum)Christof Wegmann
 
Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Raymond Roestenburg
 
Sem 2 Presentation
Sem 2 PresentationSem 2 Presentation
Sem 2 PresentationShalom Cohen
 
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC ClustersSR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC ClustersGlenn K. Lockwood
 
Gpu with cuda architecture
Gpu with cuda architectureGpu with cuda architecture
Gpu with cuda architectureDhaval Kaneria
 
An Introduction to Basics of Search and Relevancy with Apache Solr
An Introduction to Basics of Search and Relevancy with Apache SolrAn Introduction to Basics of Search and Relevancy with Apache Solr
An Introduction to Basics of Search and Relevancy with Apache SolrLucidworks (Archived)
 
Photon Session / Unite12 Conference
Photon Session / Unite12 ConferencePhoton Session / Unite12 Conference
Photon Session / Unite12 ConferenceChristof Wegmann
 
H 264 in cuda presentation
H 264 in cuda presentationH 264 in cuda presentation
H 264 in cuda presentationashoknaik120
 
Elevation mapping using stereo vision enabled heterogeneous multi-agent robot...
Elevation mapping using stereo vision enabled heterogeneous multi-agent robot...Elevation mapping using stereo vision enabled heterogeneous multi-agent robot...
Elevation mapping using stereo vision enabled heterogeneous multi-agent robot...Aritra Sarkar
 
The von Neumann Memory Barrier and Computer Architectures for the 21st Century
The von Neumann Memory Barrier and Computer Architectures for the 21st CenturyThe von Neumann Memory Barrier and Computer Architectures for the 21st Century
The von Neumann Memory Barrier and Computer Architectures for the 21st CenturyPerry Lea
 
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...Chester Chen
 
Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Fabio Tiriticco
 

Similar a AAA game in XNA ? Miner wars 2081 (20)

Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011Andy Parsons Pivotal June 2011
Andy Parsons Pivotal June 2011
 
Shadow Warrior 2 and the evolution of the Roadhog Engine, GIC15
Shadow Warrior 2 and the evolution of the Roadhog Engine, GIC15Shadow Warrior 2 and the evolution of the Roadhog Engine, GIC15
Shadow Warrior 2 and the evolution of the Roadhog Engine, GIC15
 
Making a game with Molehill: Zombie Tycoon
Making a game with Molehill: Zombie TycoonMaking a game with Molehill: Zombie Tycoon
Making a game with Molehill: Zombie Tycoon
 
Cassandra Performance and Scalability on AWS
Cassandra Performance and Scalability on AWSCassandra Performance and Scalability on AWS
Cassandra Performance and Scalability on AWS
 
Terrain in Battlefield 3: A Modern, Complete and Scalable System
Terrain in Battlefield 3: A Modern, Complete and Scalable SystemTerrain in Battlefield 3: A Modern, Complete and Scalable System
Terrain in Battlefield 3: A Modern, Complete and Scalable System
 
Far cry 3
Far cry 3Far cry 3
Far cry 3
 
Masked Occlusion Culling
Masked Occlusion CullingMasked Occlusion Culling
Masked Occlusion Culling
 
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in The Witcher 3: Wild Hunt with Umbra 3
 
BGF 2012 (Browsergames Forum)
BGF 2012 (Browsergames Forum)BGF 2012 (Browsergames Forum)
BGF 2012 (Browsergames Forum)
 
Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011Real world Scala hAkking NLJUG JFall 2011
Real world Scala hAkking NLJUG JFall 2011
 
Sem 2 Presentation
Sem 2 PresentationSem 2 Presentation
Sem 2 Presentation
 
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC ClustersSR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
 
Gpu with cuda architecture
Gpu with cuda architectureGpu with cuda architecture
Gpu with cuda architecture
 
An Introduction to Basics of Search and Relevancy with Apache Solr
An Introduction to Basics of Search and Relevancy with Apache SolrAn Introduction to Basics of Search and Relevancy with Apache Solr
An Introduction to Basics of Search and Relevancy with Apache Solr
 
Photon Session / Unite12 Conference
Photon Session / Unite12 ConferencePhoton Session / Unite12 Conference
Photon Session / Unite12 Conference
 
H 264 in cuda presentation
H 264 in cuda presentationH 264 in cuda presentation
H 264 in cuda presentation
 
Elevation mapping using stereo vision enabled heterogeneous multi-agent robot...
Elevation mapping using stereo vision enabled heterogeneous multi-agent robot...Elevation mapping using stereo vision enabled heterogeneous multi-agent robot...
Elevation mapping using stereo vision enabled heterogeneous multi-agent robot...
 
The von Neumann Memory Barrier and Computer Architectures for the 21st Century
The von Neumann Memory Barrier and Computer Architectures for the 21st CenturyThe von Neumann Memory Barrier and Computer Architectures for the 21st Century
The von Neumann Memory Barrier and Computer Architectures for the 21st Century
 
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
SF Big Analytics & SF Machine Learning Meetup: Machine Learning at the Limit ...
 
Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!
 

Último

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

AAA game in XNA ? Miner wars 2081

  • 1. AAA game in XNA? From the authors of Miner Wars 2081 Version: 27th March 2012 Marek Rosa, Keen Software House www.minerwars.com www.keenswh.com
  • 2. Why XNA? • XNA simplifies access to DirectX 9 • XNA is more intuitive than DirectX = less development time • C# / .NET vs. C++ o Faster compilation (seconds vs. minutes) o Code readability o Existing .NET classes and libraries o Unicode strings o Garbage collector • 95% of game time is spent in GPU, since Miner Wars is heavily GPU bound, therefore it’s usually irrelevant that C# code is slower than C++ • Probably easier porting and debugging to XBOX – but we haven’t tested it yet www.minerwars.com
  • 3. Disadvantages of XNA • We are bound to DX 9, e.g. can’t use texture atlas, tessellation, multi-thread rendering, etc. Not a problem right now since we have other priorities. • Occasional bugs in XNA, e.g. device lost • Can’t port to other platforms than Windows and XBOX www.minerwars.com
  • 4. Scene statistics • Voxel asteroid: 2-10 mil triangles • Space station: 5-10 mil triangles • Sector/scene = 50x50x50 kilometers o Tens of voxel asteroids o Tens of space stations and space ships o Thousands of prefab modules • We are aiming for: o 60 FPS, one frame has 16.6 milliseconds o About 500,000 triangles in frustum o About 1,000 objects in frustum www.minerwars.com
  • 5. Voxels • Voxels are converted to triangles prior to rendering / collision-detection • Cached in CPU (data cell, render cell) • Cached in GPU vertex and index buffers (larger render cells with tens of thousands of triangles) • Recalculated after a change (data/render cell invalidated after explosion or editor operation) www.minerwars.com
  • 6. Deferred Renderer • Renders into 3 render targets (diffuse + specI, normal + specP, linear depth + emissivity) • LOD0 & LOD1 – smooth LOD transition in image space (no popping or hard switching) o LOD0 = high-poly near objects, less than 2,000 meters distance o LOD1 = low-poly distant objects, more than 2,000 meters distance o LOD1 scene has usually 100-500x less triangles than LOD0 o Some models don’t have LOD1 (e.g. doors, small tunnels) – they fade-out to background o LOD1 for voxels is calculated by averaging voxel data cells • Dynamic environment cube-map - re-rendered as you move, ambient map and reflection map represent the actual surrounding • Sun light and shadows, point hemisphere pot lights • SSAO • FXAA • HDR • Transparent geometry (billboards, particle system – emitters, 2D animated parameters, generations) www.minerwars.com
  • 7. Smooth LOD transition in image space www.minerwars.com
  • 8. Smooth LOD transition in image space www.minerwars.com
  • 9. Screen Space Ambient Occlusion - SSAO www.minerwars.com
  • 10. Physics & Simulation • Own in-house physics engine • Player and AI ships are represented as boxes (spheres work well too) • Voxels can be represented as voxels or triangle meshes • Spatial hierarchies • Tunneling avoidance for high velocity objects by interpolating the position between steps (e.g. missiles or high speed ships) • Integration step is 60x per second • Area sensors www.minerwars.com
  • 11. Optimizations • We use our own in-game profiler, for performance & memory profiling • Focus on “algorithm and idea” optimizations • Hard-core low-level optimizations only in methods that are used frequently, e.g. collision detection calculations, pixel shaders, etc. • Use pruning structures, AABB, octrees, multi-dimensional queues… • Multi-threading for voxels and physics – We use Parallel Tasks – Consider task granularity, e.g. throwing a loop with 1000 simple iterations into parallel tasks won’t help. The task handling overhead is too big. Test it. • Vector and matrix operations – use ref/out or write it yourself, it’s faster – E.g. [a.x = b.x * c.x; a.y = b.y * c.y; a.z = b.z * c.z;] is way more faster than [a = b * c] • GPU instancing – use it for deferred lights and model rendering, about 5-10% speed improvement • If possible, pass objects by reference, avoid structs (copying on stack is expensive) • Don’t do object allocations during gameplay (calling “new” on a class). Use pre- allocated objects pools (particles, billboards, projectiles, debris objects, etc.) – Although, object allocations are OK during the game loading phase www.minerwars.com
  • 12. In-game profiler www.minerwars.com
  • 13. Visualizing deferred lights www.minerwars.com
  • 14. Render octrees www.minerwars.com
  • 15. Visualizing particle overdraw www.minerwars.com
  • 16. Thank you • We are still looking for programmers in Prague. • Talented students too! Marek Rosa, Keen Software House www.minerwars.com www.keenswh.com