Tag Archives: Xbox360

The end of XNA?

If you are just starting with XNA game development, than you should probably read this post before you invest too much time in XNA.

Mind, this is no official statement from Microsoft, so there is still hope, but i agree with Promit. It is most likely, that we never see another big XNA update.

 

Read here: http://ventspace.wordpress.com/2011/11/28/directx-and-xna-status-report/

Advertisements

Implementing a level of Detail (LoD) system in XNA games

If you have big levels and/or a huge amount of 3d models you have to render you will find that the game gets slower and slower.

Before you try to  optimize the draw codes, please use a profiler to make sure, that the problem is not somewhere else. Maybe the update logic is the problem?

You have some ways to tackle the problem:

  1. optimize everything in your draw code and shaders
  2. tell the user to buy a better computer
  3. remove objects
  4. lower the quality of models

Or you could scale the quality with the power of the computer displaying them.

To do so in a quick (and a bit dirty) way go to your class that holds the model and decides which model is to render (might be only one there without a LoD system or damage system).

  • Add a second and third model.
  • Make low poly versions of your model. One really low and one somewhere around the quality you can life with.
  • Load these lower versions of the model in your class
  • Add some code to check the distance to the camera
  • Now simply make some if statements:
    • If(distance >500.0f) do nothing
    • If(distance > 300.0f) draw(lowest_quality_model)
    • If(distance > 100.0f) draw(average_quality_model)
    • else draw (high_quality_model)
  • Play around till the numbers make sense in your game.
  • You might also add a condition that a slow running game never renders the highest_quality_model
  • As my LoD system not only draws the model but the shadows too i could use the lowest quality model to draw the shadow.
  • I also added a condition that the game fist tries to stop drawing shadows and than lowers the quality of models even further till the point where only the lowest poly models really close to the camera a drawn and the rest is ignored.
  • Be carefull with drastic measures. It is not always good to lower the overall quality of models just because the game missed one or two frames somewhere. The problem might not be the draw code at all.

Hope this helps you.

The type ‘Microsoft.Xna.Framework.Matrix’ is defined in an assembly that is not referenced.

Possible reasons and fixes for the error message:

The type ‘Microsoft.Xna.Framework.Matrix’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral…

  1. You have references to different Versions of Microsoft.Xna.Framework in your projects. happens easily if you are like me and just import a library project and do not check the XNA version it was built against.
  2. Classic, you use some cool third party dll and they managed to build it against everything but your XNA version. … but tell you they did on the website. Thanks for that again.
  3. Content Pipeline Projects are alway, yes really, executed on the PC. Never set Visual Studio to build them for target platform Xbox360 or any CPU. You need x86. Sometimes this is changed automatically… aka you did something stupid and didn’t realise it.
  4. A C# class library doesn’t do so well as Xbox360 game library. Check your project types and settings.
  5. As a last resort. Throw all references out and set them new to one specific dll version and rebuild everything. Check where the error occurs and go from there on.

Hope this saves you some sleepless hours.

%d bloggers like this: