Game languages

Started by
18 comments, last by mutex 15 years, 11 months ago
Quote:Original post by Arkanus
Hi, I've decided to start learning a language for 3D-type games and to start an engine (maybe). Which language should I use? XNA in C# or just C++?


First, I wouldn't start off doing games in 3D, you are biting off way more than you can swallow. Second, I would learn C++, as opposed to C#. At this point, it's just a flat out a more valuable language to know. I would try making some simple 2D games, using C++ and SDL, then moving on to bigger and better things.

Hope that helps.
Brian GilmanCredits as a Designer - Call of Duty 2, Call of Duty 4:Modern WarfareGame Design Blog
Advertisement
thanks, I have learnt abit of C++ before, but I failed to really use it in context. If someone could point me to a way to start my learning curve, that would be great.
In all seriousness, tetris. Then pong. Then breakout. Small steps, practice and the articles on this site are really all you need. And time, lots of time.
i definitely think that pong is easier than tetris.
maybe I should just stick with XNA, though it doesn't support 2008 OMG
Quote:Original post by Cromulent
Quote:Original post by ToohrVyk
and never ever try to write code which you do not already know for certain is correct.


Unless you mathematically prove the correctness of your code (I seem to remember it is a part of some maths centric computer science degrees / PhDs) you are never 100% sure your code is correct and even if your code is 100% correct then you are not sure that the code it relies on is 100% correct (i.e the operating system).


Being 100% correct is not the point: this would involve a complete program analysis that is generally not even computable (reduces to the halting problem or similar). What is important is that no undefined behavior appears: this is much easier to determine, simply by traversing the code in a linear fashion and determining if a given statement breaks any language rules.

C++ has a lot of pitfalls that may not seem immediately obvious to an average beginner, which mostly stem from odd features that are inconsistent. For instance, you can null a pointer by assigning a zero integer constant to it, but not by assigning it zero at compile time. And so, even extremely simple code bears the risk of being inconsistent:

int *ptr = 0; // correct!memset(ptr, 0, sizeof(ptr)); // incorrect!ptr = condition ? 0 : new int; // well?


When writing a line such as the third one, it's necessary to check whether the 'zero' in that expression will remain an integer (thus assigning ptr a runtime value of zero, which is not a null pointer) or if it's converted to a null pointer value beforehand (for those who care, 5.16 §5 says it works as expected).
looks like I'm sticking with C#
Quote:Original post by Arkanus
maybe I should just stick with XNA, though it doesn't support 2008 OMG


The next release will. Should be out sometime in June / July.

Quote:Original post by Cromulent
Quote:Original post by Arkanus
maybe I should just stick with XNA, though it doesn't support 2008 OMG


The next release will. Should be out sometime in June / July.


thanks, Cromulent
XNA Game Studio 3.0 CTP is available which supports VS 2008 as well as Zune development.

I recommend C# + XNA. I've been using XNA the last few days and it's surprisingly simple. I've been using C# for ~5 years now and it's so much simpler and more productive than C++.

This topic is closed to new replies.

Advertisement