Jump to content

  • Log In with Google      Sign In   
  • Create Account

Starting out - Game programming questions


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 RomTimon   Members   -  Reputation: 118

Like
1Likes
Like

Posted 20 May 2013 - 06:58 PM

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!



Sponsor:

#2 0r0d   Members   -  Reputation: 819

Like
1Likes
Like

Posted 20 May 2013 - 07:18 PM

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.



#3 RomTimon   Members   -  Reputation: 118

Like
0Likes
Like

Posted 20 May 2013 - 07:23 PM

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...



#4 RomTimon   Members   -  Reputation: 118

Like
1Likes
Like

Posted 20 May 2013 - 09:05 PM

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/



#5 David.M   Members   -  Reputation: 731

Like
1Likes
Like

Posted 20 May 2013 - 11:14 PM

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.



#6 SpagSauce   Members   -  Reputation: 92

Like
0Likes
Like

Posted 21 May 2013 - 01:00 AM

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, 21 May 2013 - 01:38 AM.


#7 RomTimon   Members   -  Reputation: 118

Like
0Likes
Like

Posted 21 May 2013 - 04:41 PM

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, 21 May 2013 - 04:44 PM.


#8 Aliii   Members   -  Reputation: 1446

Like
2Likes
Like

Posted 21 May 2013 - 05:40 PM

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.



#9 frob   Moderators   -  Reputation: 21331

Like
5Likes
Like

Posted 21 May 2013 - 06:16 PM

Throwing a little ice on SpagSauce's rant...

C# is a great language to learn how to program. So are Python and Java. Before either of those languages came around (mostly before online sites were around) the recommendation was for beginners to learn Basic or Pascal or Scheme first, not C or C++.

C++ is a powerful language, and it powers the engines of most AAA games. No disputing those facts. But for beginners trying to learn the basics of logic it is a bad choice. The language is filled with archaic constructs and often requires a solid understanding of certain programming concepts before you can accomplish anything useful. Can it be done? Certainly, just like you can teach someone to read by struggling with a centuries-old Bible full of "thee" and "thou" and ancient geography and ancient politics rather than books like "See Spot Run" that focus on the basic education. It will have a nasty learning curve, but it is certainly possible.

To make a simple graphical thing (which is what most people want these days) in c++ will require a few hundred lines of boilerplate. An experienced programmer can see those lines, copy them in, and run with it. A beginner should not be expected to know what is significant and what is boilerplate. Generally looking at all the effort required to create a window, create the various GDI handles, check their results, handle error conditions, and more, is not good for tutoring. Heaven help them if they want to jump into Direct3D, trying to learn how COM interfaces work right from the start.

If the goal is to learn how to program, pick a language with a shallow learning curve. C# has a moderately shallow curve and the knowledge is readily transferred to C++ when you are ready.

Edited by frob, 21 May 2013 - 07:54 PM.

Check out my personal indie blog at bryanwagstaff.com.

#10 SpagSauce   Members   -  Reputation: 92

Like
-4Likes
Like

Posted 22 May 2013 - 01:54 PM

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.



#11 SpagSauce   Members   -  Reputation: 92

Like
0Likes
Like

Posted 22 May 2013 - 02:04 PM

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!

I haven't read Accelerated C++, so I can't comment on it.  Game Coding Complete is a great book, but the "complete" title is misleading, as it does glaze over or leave out a few important aspects of game development (by the author's own admission).  Still a good book though.  If you want to actually get some practice, I'd say get some practice with just any regular old C++ exercises.  It doesn't have to be game-specific yet if you're just starting.  The best way to do that is to go to coding competition sites like TopCoder, Project Euler, or CodeEval and do their exercises.  They tend to be a little math-heavy.  For a beginner learning to debug, you could go to little Q&A sites like Yahoo Answers or something and attempt to fix the code other people post.  Beware of those sites though - I'd advise just fixing people's code on your own and not participating in the discussions.  Definitely don't pay any attention to the answers from other people because the people in those communities are straight up retarded, and incorrect answers are chosen as best on a regular basis.  If you have actual questions you want correct answers to, look them up on Stackoverflow.com, which is a much more professional community.  If you get to a point where you feel confident in your new skills and want guidance on making your first actual game, then Programming A Multiplayer FPS in DirectX is decent, and it uses DirectX9 which in my opinion is much easier for beginners to learn 3D graphics programming with than DX11 or OpenGL.  If you're not ready for 3D yet, then Programming 2D Games is also a decent guide and also uses DirectX9.


Edited by SpagSauce, 22 May 2013 - 02:08 PM.


#12 phil_t   Crossbones+   -  Reputation: 3926

Like
1Likes
Like

Posted 22 May 2013 - 03:11 PM

Learning C++ first and then learning any other language will be a piece of cake.  It does not work the other way around

 

Really? Learning C# first will make it harder to learn C++? That doesn't make any sense to me.

 

Playing devil's advocate, I could actually argue that learning C++ first will hurt you: you'll be overwhelmed by low-level stuff such as memory management, and won't be able to concentrate as much on getting good at problem solving and general programming logic.

 

For learning general programming logic and problem solving skills, C# is a fine choice to start with. Surely there are some "bad practices" one might inherit (poor clarity of object ownership; not thinking about memory layout, etc...), but I don't see why these skills can't just be learned when moving to C++.

 

fyi, a number of big games have been written in C# (including the engine): Fez, Skulls of the Shogun, Bastion, to name a few off the top of my head.



#13 RomTimon   Members   -  Reputation: 118

Like
0Likes
Like

Posted 22 May 2013 - 06:46 PM

Thank you guys, you've been of much help!

I've started with the 21 day C++ book. Then I will move on to game coding complete, and then do the exercises and help other people before moving on to dx9 3d fps book.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS