SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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!
 

Kürzlich hochgeladen

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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
 

Kürzlich hochgeladen (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
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...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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 - 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 ...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

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