Starting to learn C++ and game programming, what should I learn?

Started by
15 comments, last by AverageJoeSSU 13 years, 2 months ago
Hi!

I have been planning to start learning C++ with a goal to make my own 2.5D platformer someday. However, I'm not quite sure what should I learn, and in which order.

First, I probably should learn basic C++ and make console applications. Im currently in this phase, and I know some basic things ( how to use classes, control structures etc. ).

After that, should I learn WinAPI? If yes, could someone give me link to good tutorial or to really comprehensive book?

Then I should probably choose between OpenGL and DirectX. Which one is better in terms of speed? Also I am planning to develop to consoles aswell, does that make any difference?
Advertisement
what you should do is learn both DirectX and OpenGl. If you are you are programming on windows then DirectX is Faster. As for console development PS3 only supports OpenGL and Xbox360 only supports DirectX, however the chances of you getting to program legitimately for consoles is very slim since in order to do so you must get a Dev kit (which are extremely expensive). The only way you could program for consoles is if they were modded or you used XNA and C# for Xbox360, however I don't suggest you learn C# since its the worst language I've ever tried. So my final advice is learn WinAPI then learn OpenGL and Directx so you can shift platforms if you need to.

what you should do is learn both DirectX and OpenGl. If you are you are programming on windows then DirectX is Faster. As for console development PS3 only supports OpenGL and Xbox360 only supports DirectX, however the chances of you getting to program legitimately for consoles is very slim since in order to do so you must get a Dev kit (which are extremely expensive). The only way you could program for consoles is if they were modded or you used XNA and C# for Xbox360, however I don't suggest you learn C# since its the worst language I've ever tried. So my final advice is learn WinAPI then learn OpenGL and Directx so you can shift platforms if you need to.


Yeah I tried C# aswell but it just didnt fit my needs. However, doesn't MS accept really good and polished games to XBLA without paying anything ( except that 30% sales royalty ). Because I understood that for example Braid was released in XBLA and Jonathan Blow didn't buy an kit etc.
IME there's not much difference between OpenGL and D3D in terms of performance. It really depends on how your prgram uses the API. Your decision should be more influenced by which coding style you're most comfortable with right now (procedural vs OO), and what platforms you intend running on. The coding style is actually very important. If one style looks completely alien to you you'll effectively be struggling with two new things (and two lots of new concepts) at the same time, and that can hurt.

Be aware that many Windows OpenGL drivers are of rather poor quality, and you might end up spending more time fighting the driver than you spend doing anything productive. Finally, OpenGL can be much easier to get started with (especially if you use the old immediate mode) but difficulties come in later, whereas D3D is almost the exact opposite (you need to start planning your vertex buffer strategy pretty much from the outset, for example).

I second the recommendation that ultimately you should learn both. Each has a different perspective on things (OpenGL tends to abstract the details of the hardware a lot, D3D shoves them in your face) and knowing both can enrich your own body of knowledge.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

IMHO you should probably go with OpenGL.
well im not really that much into directX but...
- you can port to almost every platform except the xbox360
- window setup code is MUCH easier (just use SDL/GLUT whatever)
- if you are going to do a 2.5D (??) platformer than you probably dont need to worry that much about the driver

anyway i think the choice between OGL and DX is not that important as i found like only 5% of my code actually using the API

i dont know wether its a good idea to think about consoles already if youve just started to learn C++...
by the way you may want to have a look at smartphone developement too ;)
------------------------------
Join the revolution and get a free donut!
Writing games takes practise. You practise by writing small games. I would recommend that once you are comfortable with C++, you use a library such as SDL to write some 2D games. You will learn a lot about how to design systems by doing so, and besides you'll have a couple of games you can show off. The mistakes you make writing your first few games will serve you well later on.


[size=2] I don&#39;t suggest you learn C# since its the worst language I&#39;ve ever tried.<br /> [size=2]There is a subjective opinion if ever I saw one. Many, many developers disagree with you. C# is an excellent language by most common criteria. Have you any <span style="font-weight:bold;">objective </span>criticisms to make? If not, I suggest you do not dissuade people from using it, particularly impressionable beginners.
Thanks for answers everyone!

Still I'd like to know answers for these questions;

XBLA doesn't require Dev Kit if the game is good enough and you can convince MS that the game will be profitable ( how else indie developers would get their game to XBLA?), am I correct?

How well do I have to learn WinAPI before I continue to graphical programming? Or should I learn WinAPI and DX/OpenGL at the same time?

Is there any kind of free/ really cheap for personal use game engine, that I would be able to make 2D/2.5D games which are a bit more complex ( I was thinking about similiar features as Braids time-manipulation ) or should I learn to program game engine myself? Of course I wont be starting my game anytime soon since I have to learn first, and after that it will take a long time before it will be even playable.

Should I learn to use UML or pseudocode? They just seem so boring and useless, but I have no idea yet how hard game developing can be, so please could someone give me any opinions on this?

As for C#, I just didn't personally like it, and my future dream-job is in game business so C++ would probably be better choice considering that as well.
Ok first step is as you are, learn to code, C++ is a good language for it, but as jump starting for beginners oriented to game development it wouldn't be my first choice.

I would advice you to begin with a more game oriented framework such as Flash ActionScript, Unity or XNA, once you have the basics of object oriented game programming you can migrate to other languages with more ease.

C++ can be extremely overwhelming for a beginner, and it tends to force you into more low level concepts that step more into the field of Engine or Framework development than Game development itself, if you are however bent on learning C++ and want to develop for consoles as well as windows you really shouldn't "decide" between OpenGL and DirectX, rather you should aim to understand that while they do have a few differences, some of them quite radical, a game or engine should be able to run with either of them.

This last objective I've mentioned is called API Agnostic Engine, in these types of engine, you create something called a Bridge between your application and the APIs. A bridge basically translate the specifics of an API such as DirectX or OpenGL into a common interface so the rest of your application does not need to know the specifics of either of them.


Once again, these issues usually presented by C++ may go too deep for a beginner, I would insist on a more abstracted framework like the ones I've mentioned above.

Game making is godlike

LinkedIn profile: http://ar.linkedin.com/pub/andres-ricardo-chamarra/2a/28a/272


How well do I have to learn WinAPI before I continue to graphical programming? Or should I learn WinAPI and DX/OpenGL at the same time?


You really don't need to know much of the Windows API to get started. Just enough to create and show a window and handle a basic message loop; chapter 1 of any Windows programming book in other words.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


Ok first step is as you are, learn to code, C++ is a good language for it, but as jump starting for beginners oriented to game development it wouldn't be my first choice.

I would advice you to begin with a more game oriented framework such as Flash ActionScript, Unity or XNA, once you have the basics of object oriented game programming you can migrate to other languages with more ease.



I agree, and I cannot stress enough how important it is to do this. These environments are controlled environments, ie. it is more difficult to cause a problem.

Unity, XNA, all provide you with a foundation for making games, a community to ask questions, and tutorials galore at your disposal. This may not be the exact technology you want to use with your game (i actually think they could be very easily you just dont know that yet, especially unity), but it is a great foundation to help you learn the basics of coding in games.

Couple this with learning C++ on the side, and you would be very surprised how fast the 2 will meet together. You will learn what classes make up a framework, what parts of a framework you REALLY like, (ie automatic asset loading from a folder on your computer) and see how you would use them in making a game. I cannot say how important this kind of knowledge is when coding a game engine of any kind.

------------------------------

redwoodpixel.com

This topic is closed to new replies.

Advertisement