Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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 also aware Microsoft obviously has a conflict on interest in the matter: the more times we update the more copies of Visual Studio they sell (I know express is free but some will go pro). So one has to read between the lines of the "MASSIVE NEW FEATURES UPGRADE NOW" type blogs from MS employees.

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);
}
share|improve this question
    
There really isn't much of a problem if you're trying to develop for the PC or XBOX360, but why don't you just get VS2010 Express and use 4.0? –  TravisG Jun 12 '11 at 13:08
    
There is very little difference. –  The Communist Duck Jun 12 '11 at 14:46
    
Last time i checked, MS stopped accepting 3.1 apps. –  David Lively Jun 13 '11 at 0:56
    
@David can you clarify - what is to stop me distributing a 3.1 app? (there are benefits: my client base will much more likely have .Net 3.5 SP1 than 4.0). I am gussing you mean some XBox app market type thing - thats no worries to me i am just learning how to write games only on PC for now. –  markmnl Jun 13 '11 at 4:45
1  
@Feanor (sorry - I can't type umlauts) There's nothing to stop you from distributing a 3.1 app for Windows; but, if you want to submit an XBox or WP7 app to the App Hub (for XBox Live distribution), it has to be in 4.0+. BTW, VS2010 is IMHO an order of magnitude better than 2008; it's worth a look. Do you have access to an MSDN subscription? –  David Lively Jun 13 '11 at 15:09
show 1 more comment

2 Answers

up vote 8 down vote accepted

I recommend to use XNA 4.0.

Sure you can probably do everything with 3.1 what you can do with 4.0, but it has advanced quite a bit. Additionally to your references you might also want to take a look at Shawn Hargreaves' blog, for example at this post: Breaking Changes in XNA Game Studio 4.0. Or basically you can just check out the months March, April and May 2010 in his blog, they are full of XNA 4.0 changes.

Also keep in mind that with 3.1 you will be stuck with old technology. Eventually you will want to upgrade to XNA 5/6 for DX11 support or whatever. Depending on how large/complex your program is by then, it may take some time to upgrade it to 4.0 as you have to make several changes.

share|improve this answer
    
Im not convinced - EddieV223 it right - the language is just the same except for a few well documented api calls - so would not take a long time converting. For the sake of learning it is irrelevant whether anything under the hood has changed. (I am a seasoned programmer so maybe if I were learning to programme too the changes in the api would throw me - but that is not the case - I can usually guess the the different api calls before even looking it up). –  markmnl Jun 19 '11 at 3:52
2  
It seems odd to me that anyone would say to themselves "I'll learn an older version now, I can just upgrade my code later". Why would you waste time learning something that is old, when you will have to upgrade later on for WP7 or XBox360 useage? The fact that you are currently learning XNA should be incentive enough to not learn something now and have to re-learn later down the line. –  Jonathan Connell Jun 19 '11 at 17:27
    
Yes but since I am learning why bother on nuances of each version - learning 3D programming on XNA is the same version 3 or 4 jsut different api calls - no doubt in a couple years the same can be said for version 4 and 5 - you have to start somewhere and it is not wast of time it is exaclt the same except for few different api calls which so far from what I can see are sugar coatings to shortcut certain things already possible in 3. Anyway I will take the majority voted answer as the answer but will continue learning 3 - this discussion can help others with the same conundrium. –  markmnl Jun 21 '11 at 3:04
add comment

To the programmer 3.1 and 4 are nearly the same. The major changes are creating a device and spritebatch. And where the Content Manager is, its moved into its own project inside the solution. Everything else is pretty much the same. These changes are only a few lines of code different. Behind the scenes though its using different directx api calls.

So to answer you question you are not shooting yourself in the foot at all. Using XNA has not changed that much from the programmers point of view from even the 1.0 versions.

There are lots of cheat sheets on the net to look at for quick answers on converting 3.1 - 4.0 like this one http://www.nelxon.com/blog/xna-3-1-to-xna-4-0-cheatsheet/ .

share|improve this answer
1  
Saying that it is worth learning 3.1 and then relearn 4.0 is an outright falsehood; it will just serve to confuse, and cause programmers to spend more time to learn the same thing. –  AttackingHobo Jun 16 '11 at 22:00
    
@AttackingHobo im not convinced - EddieV223 it right - the language is just the same except for a few well documented api calls - so would not take a long time converting. For the sake of learning it is irrelevant whether anything under the hood has changed. (I am a seasoned programmer so maybe if I were learning to programme too the changes in the api would throw me - but that is not the case - I can usually guess the the different api calls before even looking it up). –  markmnl Jun 19 '11 at 3:50
    
The language is the same because its C#. But XNA 3 is different than XNA 4. Unless you need to use specific older libraries or engines, it is a waste of time learning the specifics of XNA 3 rather than directly learning XNA 4. –  AttackingHobo Jun 19 '11 at 4:00
    
"XNA 3 is different than XNA 4. Unless you need to use specific older libraries or engines" - but its not! the libraries are the same just, some of them, updated a little - they still have the same names and often the same methods - there just may be a slightly different way of calling/using them which is easy to figure out like in my example in the question! Admittably there may be some DirectX10 features I will be missing out on - but again for the sake of learning that can wait! –  markmnl Jun 19 '11 at 4:05
3  
@Fëanor "For the sake of learning that can wait!". You don't want to "waste time" downloading and installing VS2010 and XNA 4.0, but you don't mind wasting time learning something that is outdated? Strange... –  Jonathan Connell Jun 19 '11 at 17:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.