4 ms·
I've recently started learning C++ again to get into game programming. Initially I was learning Flash/AS3 based engines, as I used to be quite a great AS2 progr
by girvo 14y ago
I've recently started learning C++ again to get into game programming. Initially I was learning Flash/AS3 based engines, as I used to be quite a great AS2 programmer back in the day.
I want to learn to create cross-platform games, but want to get in the guts a bit more than, say, Unity lets you. So, C++ is what I decided on.
It's a beast of a language, I'll tell you that much, but it's actually really quite enjoyable to program in! It was the first real language I tried to learn when I was 12 years old. I got as far as making a text game with `switch' statements ;)
Definitely going to order this one I think. Coming from an ALGOL-derived language background for the most part, having something like this as a reference will be brilliant, and a good addition to go with my `Pro C++' book (handles architecture and idioms more than the language itself per se, but does cover some advanced features).
The only thing I wish I could find was a reference on how games are actually _built_: what development patterns, what tools I'll need to write, etc. All I can find are low-level OpenGL based things for writing engines, or fluffy "Design a Game!" crap. *sigh
- adamnemecek 14y agohttps://github.com/id-Software/Quake-III-Arena https://github.com/id-Software/Quake-III-Arena
- glurgh 14y agoThat's C, not C++
- adamnemecek 14y agoIf he's interested in overall architectural structure, there isn't all that much difference.
- glurgh 14y agoHe seems to be specifically interested in that, done in C++, while learning C++. The code of the various id games is definitely worth looking at - starting with Fabien Sanglard's code reviews is probably more informative than the raw github dump http://fabiensanglard.net/quake3/index.php http://fabiensanglard.net/quake3/index.php Still, it's not C++. If the goal is C++ sending someone there is akin to suggesting someone interested in studying classic English novels ought to read Les Misérables in French instead of David Copperfield.
- adamnemecek 14y agoIt's more akin to suggesting someone interested in play writing to read the modern English version of Shakespeare instead of the original.
- glurgh 14y agoHeh, I will, with some effort, resist the urge to debate analogies - my point was: I don't think that, interesting as it is (especially with Sanglard's excellent reviews) is what the threadparent was asking for.
- epsylon 14y agohttps://github.com/id-Software/DOOM-3-BFG https://github.com/id-Software/DOOM-3-BFG :)
- glurgh 14y agoHah, you are right. I thought the switch to C++ was in tech5 but nooo. Although there is still a fair bit of straight C in there. Again, link to the relevant Fabien Sanglard architecture review: http://fabiensanglard.net/doom3/index.php http://fabiensanglard.net/doom3/index.php
- vishvananda 14y agoThis is kind of dated now, but I found the old "Code on the Cob" series of articles very enlightening: http://archive.gamedev.net/archive/reference/list981c.html?categoryid=215 http://archive.gamedev.net/archive/reference/list981c.html?c...
- abhijat 14y ago> The only thing I wish I could find was a reference on how games are actually _built_: what development patterns, what tools I'll need to write, etc. All I can find are low-level OpenGL based things for writing engines, or fluffy "Design a Game!" crap. *sigh I am trying to do the same thing you are doing, to scratch an old itch and get into the guts of programming a game. The following resources proved useful : http://gameprogrammingpatterns.com/ http://gameprogrammingpatterns.com/ Developing Games in Java by David Brackeen : it is in Java but goes into some useful detail on how games are built. Also which book are you referring to when you say Pro C++ ? I am using Nicolai Josuttis' book but I am always on the lookout for good books.
- girvo 14y agoCheers for the link! It's `Professional C++ (2nd Ed.)' by Marc Gregoire, et al. It covers C++11 :) I'm only a little way through it (it's quite a tome!), but it's written well, and covers a lot of questions that I had/have. Well worth checking out IMO.
- mkilling 14y agoGame Coding Complete: http://www.amazon.com/Game-Coding-Complete-Fourth-ebook/dp/B00B7RE4GQ/ http://www.amazon.com/Game-Coding-Complete-Fourth-ebook/dp/B...
- girvo 14y agoHoly crap, that's perfect. Thanks so much! You don't have a refferal link by any chance, I'd love to make sure you get something for a rec like that: i've been looking for something like this for weeks now!
- mkilling 14y agoNo referral link - just glad I could help ;-)
- nonsequitur 14y agoI was dissappointed with the quality of the code and the final demo game. Also, it uses DirectX. Here's an alternative: Dive into the GamePlay engine (https://github.com/blackberry/GamePlay/ https://github.com/blackberry/GamePlay/) and go through all the samples (https://github.com/blackberry/GamePlay/tree/master/samples https://github.com/blackberry/GamePlay/tree/master/samples), especially this collection of small feature demos (https://github.com/blackberry/GamePlay/tree/master/samples/browser https://github.com/blackberry/GamePlay/tree/master/samples/b...). You'll get exposed to core concepts like Lighting, Terrain, Particles, 2D GUIs and Lua Scripting, all implemented from the ground up in C++ and OpenGL.
- abraininavat 14y agoProbably the most common development pattern is the "update loop" or "game loop". Typically game objects are represented by C++ objects. Aside from that, virtually every design pattern in existence is used in the context of games. What tools you'll need to write all depends on what tools you'll want to write. Many develop games with no tools at all. Many have a full tool suite that lets them create any kind of content imaginable, whether it's levels, characters, behaviors, scripted events, etc.
- hdivider 14y agoI'm a short while away from releasing a game made in C++/DirectX for Windows 8 (using the DirectXTK helpers and obvious APIs like XAudio2) - i.e. mostly 'from scratch,' more or less. And I have to say - yeah, you definitely learn a lot from that kind of project, not least because you have to constantly bear the rather large technical overhead. And that learning certainly feels great. =) However, I also have to say this: while the sheer power of the 'raw' C++/DirectX combo is enormous in terms of what games you could potentially make, the fact that even basic ideas take a comparatively long time to prototype is something that I think acts as a substantial disadvantage when it comes to the actual business side of things. I think a lot of really interesting, innovative ideas for game mechanics (or game atmosphere or feedback or other critical and somewhat subjective aspects of game development) don't require the full horsepower (performance or flexibility-wise) of the raw C++/(DirectX || whatever) approach. A few basic ideas (which you don't have to realise from scratch) can combine to give unexpected results, some of which could be really interesting. Maybe it's like spanning a 2D vector space with a linear combination of just two different vectors. (This might link in nicely with what Daniel Cook means by 'finite infinity' in his talk on game design [1].) Just something to think about. =) [1]: http://www.youtube.com/watch?v=f7DFuXDN29M&list=PL1A42B4BE1438E290 http://www.youtube.com/watch?v=f7DFuXDN29M&list=PL1A42B4...