Jump to content
  • Advertisement
Sign in to follow this  
RomTimon

Starting out - Game programming questions

This topic is 1951 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

Hello.

Currently, I am a full-time web designer (or webmaster, whatever), but I want to go in to game development in the future. Right now, I am willing to learn all I can in the free time from my job. So atm, all i know is some PHP/CSS/HTML. Obviously, that has nothing to do with game development. Which is why I am here. From what I understood, C++ is a pretty good solid language for programming anything, but I think I will go with C# to start out, and if necessary, learn the C++ later on (Unless you will explain me a reason why I should not start with C#).

 

I do not want to just know how to program games, but that is my primary objective. So, if there is some kind of a book or course I can take that introduces the reader step by step to programming games with C# (or w/e other language you suggest me), but does not forget to explain the language itself, please give me a link to download/buy. Basically, a C# (or..) tutorial book, which covers the language and teaches how to apply that knowledge to game programming. I am a beginner in such programming, so I need to know the basics too. But I do want to apply that knowledge to game development ASAP.

 

My longterm goal is to participate in creating a great MMORPG. I am completely aware of the fact that I can not make an MMO just from the start. I intend to participate in creating one, but not now. That is my GOAL, not what I am trying to do right now. Right now, I am willing to learn everything necessary for that. I want to build several small games, perhaps a small 3d rpg too, before moving on.

 

I have tried HeroEngine for several weeks about a year ago, to get the idea of what the game consists of. That made me understand the huge amount of work that is necessary to create a good game (and epic amounts of work for an MMORPG). Its for sure not for a beginner, and not for one person. A week ago, I downloaded Unity and learnt the basics of using this game engine, but I quickly understood that I will need to learn to program, before even considering to do something good. So, here I am.

 

So, am I right that I need to spend some time reading C# books and tutorials before going back to the unity3d engine? Or should I just jump in?

 

At this moment, I have the "The C# Programming Language, 4th edition - 2010" Book by Anders Hejlsberg. I think it is one of the best for learning C#, but it has  nothing to do with game development.

 

So, what will you suggest?

 

Thanks!

Share this post


Link to post
Share on other sites
Advertisement

I would only say that if your ultimate goal is to become a professional developer, you will need to learn C++.  If that's the case, then rather than starting with C# and then learning C++, I'd recommend starting with C++ and later move to C# if you want.

 

The reason here is that C++ will teach you the low(er) level stuff that will give you a better understanding of what the computer is actually doing, which is important for things like games where performance if often an issue.  Learning C++ and then C# is like building a solid foundation and then your house on top of that.  Going right to C# is like building the house on the ground w/o a foundation.  Sure it might be just fine, until a storm shows up and your house gets washed away.  I have also heard stories of people who learn C# first and then have trouble getting their heads around C++.  Not just that, but learning C++ first means you'll accumulate a longer amount of time on that language, which is important if at some point you need to use it professionally.  There is definitely a lot to master in C++, and stuff like that only becomes second nature if you use it for many years.

 

If, however, you dont really think that you'll use C++ professionally at some point, then C# might be the way to go.  I'd consider what platforms you want to develop for and what tools you'll be using.  C++ has the advantage here that it will allow you to put your game almost everywhere without relying on third-party platforms or toolchains.

Share this post


Link to post
Share on other sites

Thanks for your opinion, I will start considering C++ then. Any good books fitting under

"I do not want to just know how to program games, but that is my primary objective. So, if there is some kind of a book or course I can take that introduces the reader step by step to programming games with C# (or w/e other language you suggest me), but does not forget to explain the language itself, please give me a link to download/buy. Basically, a C# (or..) tutorial book, which covers the language and teaches how to apply that knowledge to game programming. I am a beginner in such programming, so I need to know the basics too. But I do want to apply that knowledge to game development ASAP."

for C++?

 

I am going to develop for Windows. Perhaps a few small projects for Windows Phone 8, but nothing serious.

 

I prefer to get a good solid foundation, so C++ seems the way to go, but I would be very frustrated by the lack of achievement, if there is nothing I can apply my knowledge to...

Share this post


Link to post
Share on other sites

why does everyone suggest C# btw.

for example here: http://www.gamedev.net/topic/642527-what-programming-language-should-i-go-with-cc-or-java/

 

I haven't had any experience with C# but from what I've heard, it's fairly easy to get started with. You can pick it up pretty quickly and there are some, from what I've heard, fairly good frameworks available for game programming in C# as well.

Share this post


Link to post
Share on other sites

Bad idea.  C++ is for game programming.  C# is for pansies who wish they could program.  Seriously, C# programmers never have an easy transition into C++, but C++ programmers can easily pick up C#.  Start with C++ and leave C# for the cute little GUI apps.  Unless you just plan on making tiny little single-player 2D sprite-based games, in which case go ahead and use C#.  If you plan on making real games, use C++.

 

Why?  C++ facilitates both procedural and object-oriented paradigms.  It facilitates both high and low level programming.  It gives you complete control over your resources with less overhead than C# or Java.  You can write your own assembly code if you so desire, or you can write several layers of API's to abstract everything away.  Also, the vast majority of game programming books have code samples written in C++.  A handful of them use pseudocode and even fewer might have some Java, but I haven't come across any that use C#, and my office walls are lined with shelves of game programming books.

 

 

why does everyone suggest C# btw.

for example here: http://www.gamedev.net/topic/642527-what-programming-language-should-i-go-with-cc-or-java/

That has an easy answer:  They don't know what they're talking about.  For example, this answer:

 

Most of game code should be writen with script language, like java, lua, python, c# for unity3d. It's no need to work with native code if you are using a good engine, like unity3d.

was clearly written by someone who has never programmed a game in their life.  "Most of game code" is definitely not in a scripting language.  Most of the game logic should be.  That is but a tiny piece of the puzzle.  The engine itself will be written with C++.  The guy further down who suggested C# and went on to claim that he was a paid "C++ 3D coder" is a liar, at least based on his posts in other forums in which he claims to be an indie developer and prefers C# because he's slow at figuring out how to use C++.  The only other suggestions to use C# were suggestions either for non-game related development or for beginning programming because C++ is "too hard."  Most, like me, suggest C++ for game development.

 

When I tutored C++, I always recommended this book:

SAMS Teach Yourself C++ In 21 Days (5th edition)

Don't let the title mislead you.  You can't master C++ in 21 days, but it's the best beginner book nevertheless.  Also, don't get the 6th or 7th editions.  The 7th edition claims to include C++11 but it doesn't, and both are written by a horrible author.  Buy the 5th edition (or view the similar 2nd edition for free here), and then buy The C++ Standard Library (2nd edition) to fill in the gaps.

 

As far as Unity, that's a good tool for quickly prototyping an idea, but it's not something you'd use for your own game engine.  Yes, it uses C# for scripts, but if you know C++, you know 90% of C# and the other 10% is stuff that takes a 12-second Google search to figure out, like namespaces being scoped in with . instead of :: and little things like that.  On the flip side, if you know C#, you won't figure out the quirks of C++ without investing significantly more time into it than the other way around.  You can think of C# as the slower and dumbed down version of C++.  Learning C# to prepare for C++ is like learning to ride a tricycle to prepare for a motorcycle.

 

If you want to develop for Android, go with Java.  If you want to develop for iOS, go with Objective C.  If you want to develop for PC or console or any other machine that can support an MMORPG, go with C++.  If you want to make a D&D Character Generator or something, then use C#.

Edited by SpagSauce

Share this post


Link to post
Share on other sites

Thank you very much for your time. I'm going to hop on to that book ASAP and follow your advice.

However, what do you think about this book?

Accelerated C++: Practical Programming by Example 

Heard its pretty good too

 

Also, after I finish reading the books you linked, should I move to reading

Game Coding Complete

 

I've also heard its great.

 

What can I read or do to actually apply the knowledge from the books read to game development?

Thank you!

Edited by RomTimon

Share this post


Link to post
Share on other sites

If you want to develop for Android, go with Java.  If you want to develop for iOS, go with Objective C.  If you want to develop for PC or console or any other machine that can support an MMORPG, go with C++.  If you want to make a D&D Character Generator or something, then use C#.

 

You can write most of your code in C/C++ for droid and IOS games now.

 

"C# is for pansies who wish they could program."

...apply some self-moderation to your posts.

Share this post


Link to post
Share on other sites

Choosing a "beginner language" is bad advice.  C++ is not too hard as a first language.  If it is, then you don't have what it takes to ever be a good programmer regardless.  Have you ever heard that some people are just naturally better at specific things than others?  Programming is the same.  It's all about logic.  Some people are good problem-solvers, some are not.  The type of person who can't learn C++ as a first language is the type who is not, and all they will do is become a lousy C++ programmer later and be hated by their team.  They should be exploring other career fields.  C++ is simply a language.  All a language is is a collection of syntax rules.  You use it to solve problems.  It really is that simple.  C# is like a flat-tip screwdriver.  C++ is like a swiss army knife.  It's still just a simple tool you use to solve problems, but it has greater flexibility and thus potential for greater efficiency.  If you have strong logic skills, learning C++ isn't hard.  If you have poor logic skills, you might feel more productive with "easier" languages, but you'll still forever be a bad programmer.  Learning C++ first and then learning any other language will be a piece of cake.  It does not work the other way around.  Disregard anyone telling you to learn something else first just because it's an easier beginner language.  They don't know what they're talking about.  I do.

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!