2

I am starting out learning XNA and its going smoothly. However I wonder if I am shooting myself in the foot by learning 3.1 not 4.0?

I am aware of whats new: http://msdn.microsoft.com/en-us/library/bb417503.aspx, and that mostly seems to be phone, interfaces and video features - which I am not so interested in - I am more doing the core 3D stuff.

The sticking point is: I have Visual Studio 2008 professional already and do not want to get VS 2010 if there is little difference in the game programming in 4.0.

Has the world moved on? Is what I am learning in 3.1 going to be come redundant?

There are also code differences in libraries, but they are not major, many of them can be seen here: http://www.nelxon.com/blog/xna-3-1-to-xna-4-0-cheatsheet/, for instance this one which I had to figure out compared to Riemers Tut:

XNA 4.0

     protected override void Draw(GameTime gameTime)
     {
         device.Clear(Color.DarkSlateBlue);

         RasterizerState rs = new RasterizerState();
         rs.CullMode = CullMode.None;
         device.RasterizerState = rs;

         effect.CurrentTechnique = effect.Techniques["ColoredNoShading"];
         effect.Parameters["xView"].SetValue(viewMatrix);
         effect.Parameters["xProjection"].SetValue(projectionMatrix);
         effect.Parameters["xWorld"].SetValue(Matrix.Identity);
         foreach (EffectPass pass in effect.CurrentTechnique.Passes)
         {
             pass.Apply();

             device.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 1, VertexPositionColor.VertexDeclaration);
         }

         base.Draw(gameTime);
     }

XNA 3.1

    protected override void Draw(GameTime gameTime)
    {
        device.Clear(Color.DarkSlateBlue);

        device.VertexDeclaration = new VertexDeclaration(device, VertexPositionColor.VertexElements);
        device.RenderState.CullMode = CullMode.None; // TODO only for testing!
        device.RenderState.FillMode = FillMode.Solid;

        effect.CurrentTechnique = effect.Techniques["ColoredNoShading"];
        effect.Parameters["xView"].SetValue(viewMatrix);
        effect.Parameters["xProjection"].SetValue(projectionMatrix);
        effect.Parameters["xWorld"].SetValue(Matrix.Identity);

        effect.Begin();
        foreach (EffectPass pass in effect.CurrentTechnique.Passes)
        {
            pass.Begin();
            device.DrawUserIndexedPrimitives<VertexPositionColor>(PrimitiveType.TriangleList, vertices, 0, 5, indices, 0, indices.Length / 3);
            pass.End();
        }
        effect.End();

        base.Draw(gameTime);
    }
pinckerman
  • 4,115
  • 6
  • 33
  • 42
markmnl
  • 11,116
  • 8
  • 73
  • 109
  • For those voting to close - where else can I ask this programming question? – markmnl Jun 12 '11 at 02:09
  • Try asking your question at GameDev Stack Exchange (http://gamedev.stackexchange.com/) if it gets closed here. – Empyrean Jun 12 '11 at 06:37
  • XNA with Visual Studio are software tools commonly used by programmers. According to the faq this relates it to software development, not sure that it should have been closed. – Empyrean Jun 12 '11 at 13:52
  • I flagged it myself after re-posting it on gamedev: http://gamedev.stackexchange.com/questions/13518/learning-xna-3-1-vs-xna-4-0 – markmnl Jun 14 '11 at 03:39

2 Answers2

3

Yes. The world has moved on. XNA 3.1 is already redundant.

There are Major Architectural, API and under the hood changes for 4.0. The changes are significant, especially with regard to rendering. You are better off using VS2010 Express and XNA 4.0 than VS2008 Professional and XNA 3.1.

Empyrean
  • 1,823
  • 12
  • 10
  • This is the correct answer, XNA3.1 has been replaced for over a year now, you can't use it (anymore) for the Xbox, WP7, and any of the contests. The rendering API got a lot simpler, a lot of bugs with importers where squashed. I've used XNA 4 under VS Express and later VS Pro, and there are only little things (like the profiler) that would cause me to stay using VS Pro if I had to choose. I would always choose XNA4 + VS Express over XNA3.1 + VS Pro. – Roy T. Jun 12 '11 at 12:33
0

first time posting. There was a similar question posted in the game development stackexchange which can be found here (and reiterates what you said for the most part) https://gamedev.stackexchange.com/questions/7553/difference-between-xna-3-1-and-4-0 As for my experience our team started developing in 3.1 and ended up porting to 4.0 about halfway through our project. 4.0 seems to force you into one of two specifications "Reach" which is the low end and has a lot of restrictions based on the mobile GPU for winPhone7 and "Hidef" which basically means Xbox and wouldn't start on any of our computers that did not have at least a DirectX 10+ card. I like the organization of 4.0 better than 3.1 however it is geared much more in tune with the winPhone7 and Xbox where as 3.1 has some features that are PC only. Since you're learning XNA the option is still open to use either, however if you feel the need to port from 3.1 to 4.0 in the future it may be somewhat difficult. I was developing the audio for our game and found a lot of the changes in 4.0 very useful however our team did have some hiccups converting a lot of the graphics. Hope this helped! cheers!

Community
  • 1
  • 1
cp.
  • 16
  • 2