BlockLeftTop, PRELOAD BlockLeftBottom, PRELOAD BlockLeftStretch, PRELOAD BlockTop, PRELOAD BlockBottom, PRELOAD BlockStretch, PRELOAD BlockRightTop, PRELOAD BlockRightBottom, PRELOAD BlockRightStretch, PRELOAD
DeltaEngine

Quick Tips for XNA Beta 1 (aka My Own XNA FAQ)

by Benjamin Nitschke 31. August 2006 06:07

  • Download XNA Beta1

  • XNA Framework Forum and XNA Game Studio Express Forum

  • Getting Started: Open C# Express (which is XNA Game Studio), Help->Content->Select XNA and navigate to Getting Started with XNA and read through Your First XNA Game

  • Next you could try out the Space War Starter Kit Game. If you can't control the game read this tutorial from xnaspot.com about changing it to support keyboard input.

  • x64 Bit platform support: Read this blog entry for an easy fix. Basically just add <PlatformTarget>x86</PlatformTarget> to your csproj file.
    Or download and extract this file (Xna64BitSupport.zip 14 KB) into:
    C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\VCSExpress\

  • Blogs:

  • Tutorials:

  • Interessting reads:


  • And now finally my own thoughts and tips:

    • How to render fonts like with Direct3D.Font?

      Well, thats not possible, there are not Font classes in XNA at all yet! You have to create your own font code by rendering bitmap fonts. If you want to see some code about that check out the SpaceWar Starter Kit and look inside the Font.cs class. The fonts in SpaceWar just contain numbers, but the game contains some text. How did they do that? Well, they just put most of the text in the game directly onto the textures, buttons, etc.
      Here is also a forum post about this issue and some source code, which might help.

    • How to play sounds?

      Thats quite easy, create sounds with XAct, load them in your game and then use the SoundBank class to play your sounds. Some tutorials can be found in the help and a simple example is in the Sound.cs file in SpaceWar Starter Kit.

    • Okay, where do I add my mp3 for some music playback?

      Could you stop asking this questions? Arg, I'm asking myself this, oh no. But I guess sooner or later this would come up anyway. Well the solution? There is none. No, I'm not kidding. There is no support for mp3, wma or CD playback of music in XNA. On the windows platform you could use some external stuff (DirectShow, MCI, external libraries, etc.), but on the XBox360 you are stuck with XAct, which does just support sound effect files.

      Ok, then just let add the .mp3 as a .wav file there. Yup, thats possible, but consider your game size. If your binaries are maybe 1MB, textures 5-10MB and sounds 2MB you don't want to add 3*50MB for 3 music files. I had quite a long discussion with some music artist about this issue and we agreed that it would be best to do try out some 22kHz mono sounds for the music for a smaller game size. Don't even try to think about any compression, the only format that XAct eats is PCM .Wav files. Sample them down or live with mega-files, your choice ...

    • How to add Controller (Mouse, Keyboard, XBox360 Controller) support?

      Again, this is not hard stuff. If you have worked with XInput before, this will be easy for you. Otherwise just read the XNA Programming Guide->Input pages, which all contain easy to work with code samples.

    • How to show a mouse cursor?

      You might notice that there is no mouse cursor in the samples, starter kit or any new project you create. The reason for this is that by default the Game.IsMouseVisible is set to false. If you set it to true (e.g. in your game constructor) you will see the mouse cursor again (write: this.IsMouseVisible = true;). Another way would be to display your own custom mouse cursor as a sprite at the current mouse position (see help to get mouse position, it is quit easy).

    • How to capture keyboard text?

      Well, thats not that easy. You can only check the state of each button (mouse, keyboard, whatever), but you can't get the text directly like with the OnKeyPress event in window forms. One way would be to write your own custom text handling, like this:

      string chatText = "";
      List
      keysLastFrame = new List();

      ...

      Keys[] keysNow = Keyboard.GetState().GetPressedKeys();
      foreach (Keys key in keysNow)
          if (keysLastFrame.Contains(key) == false)
              chatText += key.ToString();
      keysLastFrame = new List
      (keysNow);

      But this has the disadvantage if you run low on frames or the user types very fast you might miss some keys (test this by adding Thread.Sleep(50)), which really sucks. It is also a bit of work to get all the special keys, shift combinations, backspace, etc. working. For windows apps it might be wise to think about capuring the keyboard directly with some dummy form (very easy to get text then with OnKeyPress). Another approach would be to create an extra thread just for handling the keyboard at a high rate to make sure you catch all the keys. More about this solution can be found in this post.

    • What about drawing lines, boxes or other simple 2d stuff?

      Oh no, this is one of the parts that is really annoying and this does require some rethinking because all this kind of rendering was done with help of the fixed function pipeline (hello DirectX 7), which is no longer supported in XNA. It was never easy in DirectX to draw lines or filled boxes, you had to create your own vertex buffer or just draw some primitives and set all kinds of renderstages, but with XNA this gets even more complicated. Better not tell anyone how simple this is in OpenGL (glLine anyone ^^).

      So how can we draw some lines in 3d?

      Again: It is very important to know that you have to do EVERYTHING with shaders! The Sprite classes are just some helpers, but for 3d you need shaders, nothing else will work! I say this that often because many people in the XNA Forum already having problems rendering data and do not understand that if you don't have a shader around your rendering code, nothing will happen! Additionally you have to make sure you pass all the required data to your shader, there is a lot more work involved that just rendering some primitives in DirectX using the fixed function pipeline.

      I will try to keep this as short as possible, but you will see this is quite a lot of code for just rendering a single line. Here we go. We start with the variables we need (add to your Game class):

      Matrix Projection = Matrix.Identity,
      View = Matrix.Identity;
      Vector3 pos1 = new Vector3(0, 0, 0),
      pos2 = new Vector3(100, 100, 100);
      VertexPositionColor[] lineVertices =
      new VertexPositionColor[2];
      lineVertices[0] = new VertexPositionColor(pos1, Color.Red);
      lineVertices[1] = new VertexPositionColor(pos2, Color.Yellow);

      Effect effect = null;
      EffectParameter worldViewProj = null;

      We will use the Projection and View to calculate the worldViewProj matrix for our shader to convert the 3d coordinates to 2d (yep, I told you, we have to do everything ourself). If you want some camera control, always update the View matrix, which again you have to manage yourself (hello XNA team, some help with this basic stuff plz). Ok, lets continue before I explode, here is the initialization code (copy to your Game constructor):

      float aspectRatio = (float)TestGame.Width / (float)TestGame.Height;
      Projection = Matrix.CreatePerspectiveFieldOfView(
          (float)Math.PI / 2, aspectRatio, 0.1f, 1000.0f);
      View = Matrix.CreateLookAt(
          new Vector3(0, 0, -50), Vector3.Zero, Vector3.Up);

      CompiledEffect compiledEffect = Effect.CompileEffectFromFile(
          "Shaders\\LineRendering.fx", null, null, CompilerOptions.None,
          TargetPlatform.Windows);
      effect = new Effect(TestGame.Device,
          compiledEffect.GetShaderCode(), CompilerOptions.None, null);

      worldViewProj = effect.Parameters["worldViewProj"];

      Ok, what happens here? First of all we calculate our aspect ratio, nothing special. Then we have to calculate our projection and view matrices (please read the DirectX documentation if you have no idea what I'm talking about). Basically we have a field of view of 90 degrees (PI/2), we use our aspect ratio and we have a view range from 0.1 (near) to 1000.0 units (far). Then we create our camera at the position (0, 0, -50) looking at the center of our scene.

      Next we have to load our shader effect file. Yes, I told you about that earlier, we need a freaking shader to draw our simple line. We will get into that in a little bit, but ALWAYS make sure the .fx file is correct (test with FX Composer first). If the .fx file contains compiler errors you get unfunny NullReferenceExceptions, which won't help you (see below). Finally we are getting the worldViewProj parameter. This is the only line of this whole line code I really appreciate. Getting shader parameters is now a lot easier and cleaner, good work here! Also working with shaders is very easy now.

      Time to continue with our code, we need the rendering code (add to Draw()) now:

      // Start line shader
      effect.Begin(EffectStateOptions.Default);
      effect.Techniques[0].Passes[0].Begin();

      // Render line
      worldViewProj.SetValue(View * Projection);
      TestGame.device.VertexDeclaration = new VertexDeclaration(
      TestGame.device, VertexPositionColor.VertexElements);

      TestGame.device.DrawUserPrimitives
      (
      PrimitiveType.LineList, 1, lineVertices);

      // End shader
      effect.Techniques[0].Passes[0].End();
      effect.End();

      This code is pretty straight forward. We start our shader and select the first technique (the only one we got). Then we calculate our worldViewProj matrix from the View and Projection matrices we calculated in the constructor. After setting the VertexDeclaration we can draw our primitives, which are lines in our case. Just one to be more specific. Adding more lines is quite easy at this point. Finally we have to close the rendering pass (we just got 1 pass, else we would have to make a foreach loop around this code) and we also close the shader.

      So far so good, but how does the rendering now happen? 100% in the shader, the code we just wrote will do nothing more than calling the shader with the data we set, the line point positions and colors. So lets take a look at the shader, which does all the rendering. The shader itself is quite simple:

      // File: LineRendering.fx, Author: Abi
      // Code lines: 52, Size of file: 1,18 KB
      // Creation date: 31.08.2006 05:36
      // Last modified: 31.08.2006 06:44
      // Generated with Commenter by abi.exDream.com
      // Note: To test this use FX Composer from NVIDIA!


      string description = "Line rendering helper shader for XNA";

      // Default variables, supported by the engine
      float4x4 worldViewProj : WorldViewProjection;

      struct VertexInput
      {
          float3 pos : POSITION;
          float4 color : COLOR;
      };

      struct VertexOutput
      {
          float4 pos : POSITION;
          float4 color : COLOR;
      };

      VertexOutput LineRenderingVS(VertexInput In)
      {
          VertexOutput Out;

          // Transform position
          Out.pos = mul(float4(In.pos, 1), worldViewProj);
          Out.color = In.color;

          // And pass everything to the pixel shader
          return Out;
      } // LineRenderingVS(VertexInput In)

      float4 LineRenderingPS(VertexOutput In) : Color
      {
          return In.color;
      } // LineRenderingPS(VertexOutput In)

      // Techniques
      technique LineRendering
      {
          pass Pass0
          {
              VertexShader = compile vs_1_1 LineRenderingVS();
              PixelShader = compile ps_1_1 LineRenderingPS();
          } // Pass0
      } // LineRendering

      And thats it. As you can see we just take the input position, transform it and then output the color we interpolated through the vertex shader. The pixel shader has just to output the color. Working with other primitive types can be done in a similar way, so I hope this code helps.

      And what about 2d lines?

      2D lines can be done quite similary. In DirectX you would never think about rendering 2D lines with shaders, when it is so much easier with the fixed function pipeline. But this is not possible in XNA, so we have to use shaders again. Lets go quickly through the code that is required:

      Matrix Projection = Matrix.Identity,
      View = Matrix.Identity;
      Point pos1 = new Point(0, 0),
      pos2 = new Point(500, 250);
      VertexPositionColor[] lineVertices =
      new VertexPositionColor[2];
      Effect effect = null;
      EffectParameter worldViewProj = null;

      Very similar to what we had above, only our positions are now Points and not Vector3. Also note we don't calculate the lineVertices here because the data is resolution dependant and we have to grab the resolution from the graphics object first. Lets take a look at the initialization code:

      float aspectRatio = (float)TestGame.Width / (float)TestGame.Height;
      Projection = Matrix.CreatePerspectiveFieldOfView(
          (float)Math.PI / 2, aspectRatio, 0.1f, 1000.0f);
      View = Matrix.CreateLookAt(
          new Vector3(0, 0, -50), Vector3.Zero, Vector3.Up);

      lineVertices[0] = new VertexPositionColor(
          new Vector3(
          -1.0f + 2.0f * pos1.X / TestGame.Width,
          -(-1.0f + 2.0f * pos1.Y / TestGame.Height), 0), Color.Red);
      lineVertices[1] = new VertexPositionColor(
          new Vector3(
          -1.0f + 2.0f * pos2.X / TestGame.Width,
          -(-1.0f + 2.0f * pos2.Y / TestGame.Height), 0), Color.Green);

      CompiledEffect compiledEffect = Effect.CompileEffectFromFile(
          "Shaders\\LineRendering2D.fx", null, null, CompilerOptions.None,
          TargetPlatform.Windows);
      effect = new Effect(TestGame.Device,
          compiledEffect.GetShaderCode(), CompilerOptions.None, null);

      worldViewProj = effect.Parameters["worldViewProj"];

      This looks slightly more complex. The reason for that is the conversation from pixel coordinates to screen space, which goes from -1 to +1 and has y inverted. We could also do this calculation in the vertex shader, but I like C# more ^^ Please also note that we don't need the z coordinate, but it is way easier to just use the VertexPositionColor struct instead of creating our own struct. Lets continue with the rendering.

      // Start line shader
      effect.Begin(EffectStateOptions.Default);
      effect.Techniques[0].Passes[0].Begin();

      // Render line
      worldViewProj.SetValue(View * Projection);
      TestGame.device.VertexDeclaration = new VertexDeclaration(
      TestGame.device, VertexPositionColor.VertexElements);

      TestGame.device.DrawUserPrimitives
      (
      PrimitiveType.LineList, 1, lineVertices);

      // End shader
      effect.Techniques[0].Passes[0].End();
      effect.End();

      Nothing changed here, nothing we have to discuss. Everything works just the same. lets take a look at the shader!

      // File: LineRendering2D.fx, Author: Abi
      // Code lines: 52, Size of file: 1,18 KB
      // Creation date: 31.08.2006 05:36
      // Last modified: 31.08.2006 06:55
      // Generated with Commenter by abi.exDream.com
      // Note: To test this use FX Composer from NVIDIA!


      string description = "Line rendering in 2D space shader for XNA";

      // Default variables, supported by the engine

      float4x4 worldViewProj : WorldViewProjection;

      struct VertexInput
      {
          float3 pos : POSITION;
          float4 color : COLOR;
      };

      struct VertexOutput
      {
          float4 pos : POSITION;
          float4 color : COLOR;
      };

      VertexOutput LineRendering2DVS(VertexInput In)
      {
          VertexOutput Out;

          // Transform position
          Out.pos = float4(In.pos, 1);
          Out.color = In.color;

          // And pass everything to the pixel shader
          return Out;
      } // LineRendering2DVS(VertexInput In)

      float4 LineRendering2DPS(VertexOutput In) : Color
      {
          return In.color;
      } // LineRendering2DPS(VertexOutput In)

      // Techniques
      technique LineRendering2D
      {
          pass Pass0
          {
              VertexShader = compile vs_1_1 LineRendering2DVS();
              PixelShader = compile ps_1_1 LineRendering2DPS();
          } // Pass0
      } // LineRendering2D

      Not much changed here either. Only the vertex shader is changed, we don't have to use our worldViewProj matrix anymore. We are just copying the data over to the pixel shader for rendering the screen stuff directly.

      Thats it for rendering 2D data. I guess most 2D stuff will be covered by the Sprite class, but if you need some custom 2d stuff (lines, boxes, etc.) this code should help you out. Have fun writing more complex stuff.

    • Ok, if the line stuff is that hard, lets do some simple mesh rendering, right?

      Wrong again. While this was planed for the XNA Beta release, it didn't make it into the beta and you have to do your own mesh loading, handling and rendering. In the SpaceWar Starter Kit game you can find some code to load swm model files (wtf is this format?), but you can't render .x or .fbx files that easily yet. In the future no problem, but right know you are f .. erm, not able to ^^. When I got some code for mesh loading and rendering, I will show it :-)

    • Content Management, what about that?

      Well, its quite cool to just drop your content files into your project and then you can directly access them in your code. But since this feature is not supported yet, there is no point discussing it ... If you want to read stuff anyway, check this blog posts about the content pipeline out: http://blogs.msdn.com/xna/archive/2006/08/29/730168.aspx and http://blogs.msdn.com/shawnhar/archive/2006/08/26/725954.aspx.

    • Why are there so few help topics in the most important namespace Microsoft.XNA.Graphics, especially for 3d rendering?

      Well, since most of the line rendering, mesh or even the content pipeline is not supported, it is no wonder some important topics are missing. The help basically just tells you how to create a textured cube yet, nothing else. But this is also an early beta release, expect more help topics in the future. The many new XNA pages that are created these days (like 10 new ones each day ^^) will also provide a lot of resources. I bet XNA will have a really big community after a while. XNA has already interessted a lot of people about this new technology.

      Please also try to use the DirectX documentation as backup help in case you need more tutorials, samples and documentation.

    • Shaders?

      Yap, everything except Sprites has to be done with shaders. I guess this will be reason enough for most XNA games to never have any 3d content. Working with sprites is quite easy, but having to write custom shader code, declaring vertex types and having crazy random exceptions is nothing easy.

      For example if your shader fails to compile you get just a System.NullReferenceException: Object reference not set to an instance of an object. There is no explanation what did went wrong, which is pretty bad IMO. Shaders are really a pain in the ass because they are not managed in any way. Its just some script that gets compiled for the GPU and if anything went wrong you can hope your tools tell you exactly what to do. MDX did already suck in this regard, but from my quick early preview XNA is way worse. I really hope this part gets improved. What does nice and clean sprite, sound and controller programming help me if the 3d code is ugly as hell and as hard to write as c++ minus the debugging benefits from DirectX.

      Debugging DirectX? Yes, lets do that. First you need VS 2005 (see below how to get that to work with XNA). Now activate unmanaged Debugging and make sure DirectX is running in Debug mode (either go to your control panel and open up DirectX or use Start->Programs->DirectX->Utilities->Control Panel (which is the only available choice on x64 bit), now select debug mode and also set the Managed DirectX dlls to debug for better debugging support. Now when crazy NullReferenceExceptions happen and you are lucky you might see some helpful explanation.

      Scroll above to see some simple shaders for the line rendering stuff. There is also another shader example in the documentation, work with that code and change it with help of tools like FX Composer to find out about compiling errors beforehand.

    • Do I have to dispose textures, models, etc. like in MDX?

      Not really. I didn't notice any problems yet. I guess XNA has some mechanisms to collect all resources when disposing itself (game component and device). As you can see in the SpaceWar Starter Kit they didn't had to implement any disposing for their MeshCache or TextureCache lists in SpacewarGame.cs.

      This is quite cool IMO, it makes coding even easier than it was in MDX.

    • Why does my game crash with a NullReferenceException when I drag it over to another screen when using SpriteBatches?

      I guess this is some bug in the SpriteBatch class, which does not handle the device lost event correctly or something. It always crashes in the Begin() method when dragging the window out of my first screen. Since the SpriteBatch class does not have any events other than disposing, the best and simplest solution is just to add a event handler for the OnCreateDevice event and put your SpriteBatch creation code there too. This way it gets re-created when you need it. Would be nice if you didn't have to do this yourself ... XNA team reading this? Who knows ^^

    • Occlusion quering for example for lens flare effects?

      Not supported, check out this post.

    • What about Physics, AI, Collision, Particles, etc.?

      Not supported right now, check out this post. Since XNA is mainly a graphic engine with sound and controller support, it is not very likely you get advanced engine features soon.

    • How to get XNA working in VS 2005 (with all the plugins you might have, which do not work in Express)?

      Thats not supported or even possible out of the box! Read more about this here (Forum) and in the FAQ.

      But since I'm such a clever guy I modified the XNA templates quite a bit and added support opening the project in VS 2005. Read the full story here. Basically just download this: Xna64BitSupport.zip (14 KB) and extract it to:
      C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\VCSExpress\
      Now you can open your created XNA Game Studio Express projects in VS 2005 and continue working on them there.

    • Unit Testing in XNA?

      Quite simple, just add NUnit.Framework.dll, which is fully managed and should even work on the XBox360 (not that you need unit testing there). If you use VS Express, TestDriven.NET will not work (unless you have a version from last year, which still supported it). If you use VS 2005 use TestDriven.NET or TestRunner (tested it few weeks ago, very nice, but does not support static unit tests, big nono for me).

      I also suggest using a TestGame class and do many static unit tests to play around with XNA (I already wrote 5 static unit tests today). Thats much faster than to create a new project everytime. And each test looks much easier and shorter than a complete new project.

    • Performance of XNA compared to MDX or native DirectX.

      I couldn't detect any performance penalities yet, someone in the XNA forums had some problems archiving 800 fps when using bitmap fonts, dunno what that was about. But it is very hard to say how XNA performs in relation to MDX because there is not much code or games we can compare yet.

      But in my opinion it does not even matter, the XBox360 is fast enough even if you write really shitty code and the windows platform is also quite fast with all this dual core around. For most simpler or casual games this will never matter much. However I do strongly believe that XNA will perform on the same level as MDX and DirectX.

    • But I want to play my XNA game on my XBox 360?

      Me too, but we have to wait for the next drop of XNA ^^ Not supported yet.

    • What about Rocket Commander for the XBox 360?

      Well, I thought about that, but since many of the classes used in Rocket Commander are not supported yet in XNA and the actual XBox360 execution is not yet possible, why even bother? As soon as XBox360 XNA'ing is possible, I will consider a Rocket Commander port again.

    • Btw: Why is the SpaceWar Starter Kit so big (155 MB uncompressed)? There is not even music in it.

      Most textures are uncompressed as .tga files, not good ... Rocket Commander has more graphics, music and I guess more sound files too, but is less than 10 MB.

    • Need more help? Then ask in the XNA Forums and not here, I got stuff to do :D

Hope this helps. I will post more about XNA Trick & Tips soon ;-)

Yes, I'm writing a XNA game too. It will even be a Starter Kit for the next XNA Game Studio Release, more about that next week, I will post weekly screenshots like in the Rocket Commander Development time.

XNA Game Studio Express Beta1 Released

by Benjamin Nitschke 30. August 2006 18:18


Microsoft has released their XNA Framework and the XNA Game Studio Express (which is based on Visual Studio C# Express). You can now start developing your own games using the XNA Framework.

The download includes some documentation (not much on 3d graphics I have to say) and a pretty cool and interessting Starter Kit "SpaceWar", which is an Asteroids clone with both retro and modern graphics. More content, more help and more starter kits will come in the future.

Sadly there is no direct XBox360 support yet, so you cannot plugin your XBox360 and play your XNA games right now. As stated in the XNA FAQ this will be possible in the near future (next drop in a few months maybe).

Anyways, download the XNA Game Studio out and check it out:
http://msdn.microsoft.com/directx/xna/gse/

There are many questions in the XNA Boards, a lot of stuff to read ^^ If you are searching for some early XNA Tutorials, Samples and Blog, check out the links in this thread:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=682393&SiteID=1

Great stuff ahead, but be aware, this is still beta and might not be complete enough for every need. I guess some of the helper classes and 3d graphic classes will be extended and there will be much more help available in the future :-)

I will also blog alot about XNA in the near future, but first of all I need to do more XNA coding and find stuff out.

More pics from the GC 2006

by Benjamin Nitschke 28. August 2006 15:00
As always we (exDream) put some cool pics of the Games Convention up on our website www.exdream.com, check them out here: gallery gc 2006


Getting XNA to work in Windows XP x64

by Benjamin Nitschke 27. August 2006 19:19
As some of you might know I am a Windows XP x64 User for a while now. x64 Bit works great and most issues could be resolved one way or another. As I wrote in my Windows x64 post a few weeks back it is very important to make sure Managed DirectX uses always x86 (32 bit) as the target platform. x64 is NOT supported and "Any CPU" will work on 32 bit because it will use x86 automatically, but on x64 bit platforms, x64 will be choosed. Since calling 32 bit dlls (which all Managed DirectX dlls are) is not possible from x64, you have to have your whole app in 32 bit mode!

Same thing for XNA, which uses 32 bit and the release coming out in a few days will also support only x86 (32 bit). Since XNA Game Studio Express is based on Visual C# Express, which does not support switching from Any CPU to x86, it is NOT possible to run any XNA game or XNA code out of the box. While Visual Studio 2005 allows us to switch from Any CPU to x86, we cannot use the templates or even open the XNA projects (you get a error message like "this project type is not supported").

There is a simple trick, which also works for Visual C# Express, if you want to support x64 platforms too (no matter which platform you use yourself):

Add the following line into each PropertyGroup item of your csproj file in a text editor:

  <PlatformTarget>x86</PlatformTarget>

Or if you just want to copy the full PropertyGroups for the default Debug and Release configurations, copy this into your csproj file and overwrite the old Debug and Release PropertyGroups items.

 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoStdLib>true</NoStdLib>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoStdLib>true</NoStdLib>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>

Now XNA runs fine on x64 bit. Happy developing (ok, you have to wait till the 30. august, haha).

Update: An even better solution might be to directly change the template files located at
C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\VCSExpress\ProjectTemplates\1033\
There you can find the Xna templates as zip files. Just extract them, edit the .csproj files and save it as a .zip file again. I can provide you with the updated .zip files as soon as XNA is released (in case this doesn't get implemented anyways).
Also make sure to update the cache for these files at (just extract the .zip files there):
C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\VCSExpress\ProjectTemplatesCache\1033\

Update 2006-08-30: Download this file (Xna64BitSupport.zip 14 KB)
and extract it to:
C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\VCSExpress\
Thats all. This will replace your XNA Game and XNA Library template .zip and cache files.

Games Convention 2006 in Leipzig Germany - Day 4

by Benjamin Nitschke 26. August 2006 22:25
Today was the day with the most GC vistors ever I think. After almost 2 hours waiting in the traffic jam generated by the fair, we finally made it onto the GC (good thing our first appointment was not before 12pm).

And this is the look inside this day. Could be 1 or 2 more vistitors than yesterday.

Even between the halls people were sitting, blocking us important developers from reaching our important destinations, etc. yes, we developers are big cry babies.

Nice ATI babes throwing bags into the air. Btw: Shouldn't they be renamed to the AMD babes till next year?

Some more babes preparing something .. or maybe this are just normal woman, but we gamers have no idea what the difference is anymore.

Ahhhhh, a dinosaur .. yesterday Evil Sonic kicked me in the head and now a big dinosaur from ParaWorld wants to eat me. Dangerous worlds.

Looks like Blizzard is now doing colorful jump and runs. Looks at least like it from this distance. This is still WoW, how can Blizzard ever make anything else after canceling StarCraft Ghost?
On the left side you can also see the booth of Autodesk showing 3DS Max 9, which now supports x64 and allows users to create scenes with over 10 mio polygons, which was impossible in 32 bits (it always crashed). This is especially useful for game developers and when importing objects from ZBrush.

And finally some lens flare effects around that Unreal 3 Guy thing (6 meters high or something).

Thats it for the Games Convention this year. This evening we already drove back home because tomorrow the Business Center is closed and we already saw all of the consumer areas.

All in all this was a good fair, some nice discussions and new contacts were made and the consumers had a great time seeing all the great games, erm, Videos of the new games and technologies. Like not seeing the PS3 in action or not seeing Gears of War because it didn't get a USK parental control logo in time ...

Back to work now, have to do some cool XNA stuff now :-)

Games Convention 2006 in Leipzig Germany - Day 3

by Benjamin Nitschke 26. August 2006 12:11
It was a lot fuller today at the GC here. But tomorrow (saturday) it will get really crazy.

This is the new big bad boss for World of Warcraft, you need at least 50 players to kill this beast. Okay, maybe this is the wrong game.

More folks than yesterday.

The big EA booth, Command&Conquer 3 and Crysis were the biggest attraction. In the center there was the big circular cinema as always.

And this is Crysis, really! Look closer and you see the screenshots and keyboard help for Crysis. The game itself looks good (improved FarCry engine), but the game play is pretty much the same. And if it crashes on developer machines, you have some command line shit going on (wtf? in which year do these developers live in?)

Some Pro-Gamers at one of the many esports booths. Counterstrike, WarCraft3, StarCraft, Battlefield were still the most played games.

Overclocking the new Intel Core2 Duo with cascadading cooling or whatever, -80 degrees celsius and over 3.7 Ghz .. something like that, they reached 12000 points in 3D Mark 06, that is sick.

Ahh some babes. But what are these guys selling? BitDefender? Okay, time to look at the babes again ...

Driving in one of these things with a wheel, 3 monitors and a mechanical chair that moves in every direction might be cool, but buying a real car is way cheaper, isn't it?

Sonic is pointing at something. Whats going on here?

Ohh no, the evil sonic is hitting me. That doesn't look good for me. He is much bigger than me and I don't have any coins left .. Arg - game over ..

More pics about saturday will come tomorrow.

Games Convention 2006 in Leipzig Germany - Day 2

by Benjamin Nitschke 24. August 2006 17:27
Okay, here we go, this is day 2 (thats now really the pics from today).

As you can see there are a lot more people around today.

Alrighty. There are the babes. Nice chicks from 10tacle. Finally ^^

After watching that I might have to relax for a while.

Thats a cool elk.

Wanna test drive? This is what attracted most of the gamers, lets just sit down and play.

Omg, autograms from Will Wright? Okay dokay ... n/c

And finally some sport activities. Yeah, looks always cool.

Thats it for today, see ya tomorrow.

Games Convention 2006 in Leipzig Germany - Day 1

by Benjamin Nitschke 24. August 2006 13:51
I will post a couple of screenshots from the GC 2006 here in Germany Leipzig each day. We are here since yesterday, but internet wasn't working yesterday. This post is about yesterday. I will post new screenshots about today later. As you will see the first day only press, developers and publishers guys are running around, but at the second day a lot of games, young people will up the halls and in the next days this will get a lot crazier.


Ok, this is the buisness area of the Games Convention, we are at the booth F60.

On our way to the Games Convention. Can you detect the hidden exDream logo in this picture?

This is our booth in Hall 2, F 60. We got a booth together with some other developers, but this year we don't have a Northstar developer booth.

This is the new porsche car everyone wants to have. Or was this some car from Need for Speed? Maybe not ...

My 2 colleages Leif and Boje inside our booth. You can see our new exDream banner in the background.

You can also play our newest game Pizza Commander directly in Hall 2 at the Novitas booth. Boje shows us how to master the first mission ^^
The Microsoft Student Booth (also in Hall 2) does also present Rocket Commander and there are a couple of guys playing around with the source code. Check it out if you are in Hall 2.

For girls there are pony games, but similar to this booth at most smaller booths there was not a lot going on this day. Today a lot more people will populate this fair. No way getting fast from point a to b.

Ok, that are the pics from yesterday. More pics about today will come soon. And as always much better pics (not taken with my crappy cell phone camera) will be released next week on www.exDream.com.

In case you want to watch some funny littel videos, check out these Drink Milk videos:
http://www.metacafe.com/tags/milk_commercial/

AbiTrafficMonitor v1.4 Update

by Benjamin Nitschke 19. August 2006 02:31
Just a small update on my AbiTrafficMonitor tool, read the original post here.

New features:
  • Total traffic ever collected with this tool. Remembers all you traffic you make. I like this feature :)
  • Added daily traffic, will be counted for the whole day. You can start the tool multiple times.
  • Support for Windows XP x64 by forcing 32 bit mode, check out my last post.
  • Improved initial windows hiding and the update timer performance.

Download link:

AbiTrafficMonitor.exe v1.4 (192 KB)

Windows XP x64 Experiences

by Benjamin Nitschke 18. August 2006 06:32
I installed Windows XP Professional x64 Bit today and this post is about my experiences with it. I tried it a year ago, but most drivers were not available for 64 bit back then. Now most drivers are supported and most programs will work without a problem. However some drivers and programs will still make trouble. Most of the issues could be resolved one way or another.

Generally I would say Windows XP x64 works great and is even a little bit faster than 32 bit Windows.


No problems

Had to change my mainboard because my current one went dead yesterday, I could use the same Windows x64 version without reinstalling, thats nice. Windows 32 bit does not work anymore (some driver troubles I guess). I also noticed that about Vista, no more reinstalls required if you change your board and cpu.

Games worked great, no problems here. I guess Microsoft plays a lot of games and wants to make sure all of them work, hehe. Even 15 year old games like Raptor (my all time shoot'n'up favorite) or Wolfenstein 3D worked without problems. Starcraft, Quake3 and current games worked nice too. Daemon Tools also provides a x64 bit version for Windows XP x86 for emulating CDs or DVDs.

Visual Studio 2005, DirectX SDK and all other development tools like VS Express, SharpDevelop, CodeRush, Perforce, UltraEdit, PCalc, NSIS, etc. work great too. For running 32 bit IIS apps you might have to follow these instructions.

Virtual Server 2005 works nicely and you can run virtual x64 and x86 computers, I guess the performance is also good or even better than before, but maybe my system is just faster.

Most normal programs did work too, but since nearly 99% of all programs are still 32 bit, it does not really make sense to have a 64bit platform yet. For browsing IE 64 bit is available and for Firefox (which is 32bit again) there is a 64 bit port called Deer Park, which works nicely. Both of these browsers are useful if you need more than 2 GB memory for your crazy browsing. Some programs do provide a x64 bit version, which works just the same way as the 32 bit version (I guess they did just a recompile with different compiler settings). I would say more programs and tools will be tested for x64 in the future, especially for Vista, when more users might choose x64 for their operating system.


Programs with problems

Most .NET 2.0 tools I tested did not work, but all of them could be fixed by changing the build setting from Any CPU to x86 Platform. While .NET 2.0 has NO problem running in 32 or 64 bit, it is not that easy in the case you call any external code (and almost all my tools do that). For example my AbiTrafficMonitor tool uses SharpPcap, which again uses wpcap.dll, which is only available as a 32bit dll. By forcing 32 bit to the application everything works great, in 64 bit the dll is not found and can't be forced. It is not possible to load 32 bit dlls in 64 bit mode, you will get the following error message when attempting to do that. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

So you have to make sure a 64 bit version of all used dlls exists, else DO NOT use the Any CPU or x64 Platform settings. so this has to do something with .NET 2.0 (just some stupid compiler setting, recompile works, but a smarter version would be cool).

Here is the new installer for AbiTrafficMonitor, which works on Windows XP x64 too (by forcing the x86 mode). It does obviously still work on a normal 32 bit (x86) windows platform.

.NET 1.1 games like my Arena Wars game worked too, also .NET 1.1 tools worked fine. All .NET 1.1 assemblies run automatically as 32bit applications by design. .NET 2.0 runs automatically in 64bit mode on x64 platforms if All CPU is selected.

However my .NET 2.0 game Rocket Commander could not be started. Actually this is the same problem as above (not allowed to call 32 bit dlls from 64 bit code). .NET 2.0 runs fine in 64 bit mode and DirectX provides also 64 bit dlls, BUT Managed DirectX does NOT support using 64 bit. There is no version available to do that right now, neither MDX 1.1 nor MDX 2.0 support x64. So again, force the platform to be x86 and everything works again.

I recompiled Rocket Commander and it is available at the default download location: www.RocketCommander.com download page
There were also a couple of discussions about this issue in the Rocket Commander boards.

Another issue are external tools or helper tools like TestDriven.NET, which support x64, but it seems the underlaying NUnit Framework does work only in 32 bit. Not funny at all if you have a x64 bit app or just run All CPU on a x64 platform and want to test your code. This issue can be resolved by testing in 32 bit mode and then later switch to 64 bit if you want a 64 bit version of your app.

UltraEdit, WinZip and WinRar work fine, but all of them are 32 bit. So whats the problem? They all provide shell extensions for the Windows Explorer, which do not work in the 64bit version of the Explorer. There are 2 solutions for this.

  • Start the Windows Explorer 32 bit with the command line. Command:
    c:\windows\syswow64\explorer.exe /separate
    This didn't work very well for me, some of the shell commands did not work properly and it is really annoying to start the windows explorer this way. Often you might open a folder or jump to a containing folder, then of course the default 64 bit Windows Explorer is used.

  • Add your own shell commands in the registry. This works great for Open with UltraEdit or Extract files here, but if you need smarter commands like Extract to subfolder this doesn't help. Anyways, here is the solution. Add this file to your registry to add the following lines (change them to whatever you need):

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell]

    [HKEY_CLASSES_ROOT\*\shell\Extract here]
    @="Extract here"
    [HKEY_CLASSES_ROOT\*\shell\Extract here\command]
    @="C:\\Program Files (x86)\\WinRAR\\winrar x \"%1\""

    [HKEY_CLASSES_ROOT\*\shell\Ultra Edit]
    @="Open with UltraEdit"
    [HKEY_CLASSES_ROOT\*\shell\Ultra Edit\command]
    @="c:\\Program Files (x86)\\ULTRAEDIT-32\\uedit32.exe \"%1\""


Programs and drivers that do not work

Some old setups like for the Panorama Wallpaper changer do not at all (wrong windows version error message), but I managed to install some of the manually (copying files and setting registry settings).

My on board network drivers do not work at all, neither does my old TV card, but I had many driver problems in Vista Beta 2 x64 too. I found a old 1Gbit network card that works and I never watch TV anyways. All other drivers (board, gfx, sound, mouse, keyboard) work just fine.

Update 2008-08-19: My onboard sound really sucks and I tried to install my old PCI Soundcard (XFire 1024), but since the vendor does not provide 64 bit drivers, there is no way I can use that card. The onboard network adapter (Marvell 88E1111) also stopped working and does not even show up. Another old VIA VT6120 1gbit card could be installed, but didn't work either. Maybe I have to try out deactivating the other cards and then it should work, a 64 bit driver is installed.

Now to my main issue: You cannot use ANY new keyboard layouts at all! I really need my own AbiKeyboardV9 layout to type efficiently. I tried like 10 different other keyboard layouts too, all of them can be installed, but as soon as you try to use a new layout you always get a error message like "Windows could not load the x keyboard layout.". Not funny at all and I found absolutely NOTHING for either vista or x64 Windows to fix this problem on the internet. I used the Microsoft Keyboard Layout Creator, which works great on Windows XP 32 bit and lower. But this tool was last updated 2003 and the support for future windows version or x64 is just not-existant. Other tools I tried (keytrans, klm, etc.) suck even more and usually cost a lot of money, none of them worked on 64 bit or provide any useful features for me. All of them work only in 32bit.

More links on that topic (all of them have x64 bit problems and are unresolved)
http://www.planetamd64.com/lofiversion/index.php/t15929.html
http://blogs.msdn.com/michkap/archive/2006/01/26/517728.aspx
http://blogs.msdn.com/michkap/archive/2005/10/06/477930.aspx

I found some information on Marks Blog from Sysinternals in which he provides a solution to his Cap2Ctrl tool (which just maps the Caps Lock key to Ctrl). Similar to that I found out which keys have which codes with help of the scancode.doc doc from Microsoft for keyboard developers and wrote my own keyboard remapping code.

While the normal keys worked great and were changed in a couple of minutes all the special keys are messed up because I had different meanings for pressing shift with special keys. I found no solution to that so I updated my keyboard layout, there were some minor changes I wanted to do anyways. This is my new keyboard layout, which now works on all windows versions (finally I can use Vista too ^^). Some keys are not optimal, but to support both the german and US keyboards some '/" have to be used twice (scan code 2B) and some keys like -/_ had to be moved to worse positions (relative to my old layout, not much of a difference compared on the US layout). This can't be fixed with scancode remapping. I've used my new layout for a couple of hours now and it seems fine. The most annoying changes are <>, (), \|- and -_, everything else stays, but I guess I will manage.

This is my new Keyboard Layout:

  • AbiKeyboardLayout v10
  • To install you can use the following file: abi keyboard installer.reg
  • And uninstall it again with this file: abi keyboard uninstall.reg
  • This is the content of abi keyboard installer.reg:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
    "Scancode Map"=hex:00,00,00,00, 00,00,00,00, 19,00,00,00, 2A,00,3A,00, 2B,00,0C,00, 0C,00,0D,00, 0D,00,10,00, 19,00,12,00, 15,00,14,00, 10,00,15,00, 22,00,16,00, 20,00,17,00, 21,00,18,00, 25,00,19,00, 28,00,2B,00, 18,00,1F,00, 12,00,20,00, 16,00,21,00, 17,00,22,00, 1F,00,24,00, 14,00,25,00, 31,00,26,00, 26,00,27,00, 27,00,28,00, 0C,00,56,00, 24,00,30,00, 30,00,31,00, 00,00,00,00

    To understand the scan codes and how this binary code is formated please read this document: scancode.doc.

So far so good, I will stick with x64 and you guys know now how complicated my computer is ^^

Disclaimer: The opinions expressed in this blog are own personal opinions and do not represent the companies view.
© 2000-2011 exDream GmbH & MobileBits GmbH. All rights reserved. Legal/Impressum

Poll

Which platform should Soulcraft be released on next?











Show Results Poll Archive

Recent Games

Soulcraft

Fireburst

Jobs @ exDream

Calendar

<<  August 2014  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567