Jump to content
  • Advertisement
Sign in to follow this  
Arkanus

Game languages

This topic is 3713 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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++?

Share this post


Link to post
Share on other sites
Advertisement
Hi,

First of all: write a game, not an engine. Somewhere here on gamedev.net there's a nice article on that topic. [edit: wasn't here, but here] You'll never know what problems an engine has to solve if you've never written a game.

Now to your question. Both languages have their pros and cons. You will most likely find a lot of discussions on C# vs C++ vs [insert language here], so I will not give a detailed list on pros and cons here. My personal opinion is that C# is generally easier to pick up for beginners as there are less frustrating obstacles during development.

Regards,
Andre

Share this post


Link to post
Share on other sites
Here are a few answer elements:

  1. Are you most familiar with one of the languages? If you are, then use that language. Using a language you know is almost always be easier than learning a new language for the same task (especially when choosing between C# and C++).

  2. Learning C++ from scratch is difficult, due to the nature of the language: unlike C#, most errors in C++ are ignored by the compiler, so you cannot try to learn the language by "trial and error" since the error part will happen days or weeks after the actual trial. If you choose to go with C++, be prepared to spend more time reading books and references than you will spend writing code, and never ever try to write code which you do not already know for certain is correct.

  3. XNA is a superior solution in terms of ease of use, when compared to plain old DirectX (or, worse, OpenGL + sound and input libraries). Of course, it's also less powerful in terms of expressiveness, but this should not bother you for at least the first six months you spend writing 3D code.

  4. As a general rule of thumb, you will need serious grounding in your language of choice before being able to take on 3D development. If you know no language, be prepared to spend between three months (C#) and one year (C++) before you reach a point where you can actually make responsible decisions about using 3D in your code.

  5. Writing an engine is the most frequent application of the EYODF (Eat Your Own Dog Food) principle: whenever a programmer writes code to be used by another programmer without first trying to use that code himself, the resulting code is unusable. Without exception, an engine designed by a programmer who has never written a game will both provide useless functionality that will never be used in a game, fail to provide functionality which is omnipresent in games, and provide whatever is useful in a manner which is overly complicated and obscure. In general, the only way which works is to design an engine by refactoring a game.

Share this post


Link to post
Share on other sites
Quote:
Original post by VizOne
First of all: write a game, not an engine. Somewhere here on gamedev.net there's a nice article on that topic. [edit: wasn't here, but here] You'll never know what problems an engine has to solve if you've never written a game.
I want to quote this as that's absolutely true. Engines are difficult and will never pay for themselves in the first place if you don't design them correctly since the beginning.
Quote:
Original post by VizOne
XNA is a superior solution in terms of ease of use, when compared to plain old DirectX (or, worse, OpenGL + sound and input libraries). Of course, it's also less powerful in terms of expressiveness, but this should not bother you for at least the first six months you spend writing 3D code.
As a long-standing GL user I have to admit I do not recommend GL. It's a shame to say but corrent GL is just dead - I can grasp it because I've been there since GL1.1 but starting today the amount of extensions is terrible.
Sure, you get the possibility to port to MacOS, so what? If you want to learn it you're better focus on a single os - I bet that's win.

Share this post


Link to post
Share on other sites
looks like I'll start with C# then, I just got a book on using XNA to make an engine.
I have used a couple of engines before, namely torque (only a little bit) and Genesis3D, so I do know how to use an engine (duh)
Anyone got a good starting tutorial?

Share this post


Link to post
Share on other sites
The XNA Creators site has a number of starter kits with source codes to complete games. Maybe it's a good starting point to tinker with those and get familiar with some game architecture first. Then, as many folks have lamented, I'd still start trying to make my own game instead of an engine. Trust me, using one is a lot easier than designing and implementing one [smile]

Share this post


Link to post
Share on other sites
yeah but I can't sign up because Microsoft is being stingy by only letting Xbox360 owners sign up

PS Is there a way to get the Vicious Engine? Can't find any links..

Share this post


Link to post
Share on other sites
Quote:
Original post by Arkanus
yeah but I can't sign up because Microsoft is being stingy by only letting Xbox360 owners sign up


You can download most samples and starter kits without even signing in. The XBox Creators club membership is only required for premium content afaik, like the Ship game.

Quote:
PS Is there a way to get the Vicious Engine? Can't find any links..


With clients like Warner Bothers and Sega, plus the ability to run on just about all contemporary platforms, I doubt you're gonna find a free legal download link, if at all... You have your language suggestions, you know how to use (and presumably get) various engines, so I'm a bit puzzled what you're looking for now.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!