|
many things in C and C++ are hidden away from the developer and in turn makes them slower. Having slow code isn’t acceptable for high performance real-time applications such as games. Hey Cecil, is this a typo also? the sentence seems contradictory in relation to the rest of the paragraph. This sentence comes from the "goals of the article" section at the top.
once again, this guide is truly incredible, thanks for taking the time to writing it : )))
|
United States2829 Posts
On November 18 2012 02:35 PassiveAce wrote:Show nested quote +many things in C and C++ are hidden away from the developer and in turn makes them slower. Having slow code isn’t acceptable for high performance real-time applications such as games. Hey Cecil, is this a typo also? the sentence seems contradictory in relation to the rest of the paragraph. This sentence comes from the "goals of the article" section at the top. once again, this guide is truly incredible, thanks for taking the time to writing it : ))) Haha yes definitely a typo, thanks for pointing it out. Should say something like "many things in interpreted and other high level languages", not C and C++.
|
Sweet, thanks a ton for this!
|
This looks so sweet! I'm really looking forward to reading this later, I have just scanned through it. As a nooby CS student (we covered arrays last week ^^) I am wondering is java used (much) in programming games?
Thanks for writing this Cecil!
|
jca2
France52 Posts
Very good article. I dont know if i missed it but I didnt see anything about "interfaces" which in C++ are based on abstract classes. It's a very powerfull mechanism that allows a binary to interact with another binary without any implementation knowledge, just a few abstract classes defined in .h files. Which in turn allows for real Component oriented design (infrastructures like COM, CORBA, ActiveX, etc).
|
As an aspiring Developer I really appreaciate the effort you've done into this post. When I get time to study it I surely will! Thx Cecil!
|
I'll bookmark this and use it along side other references to try to get a "fresh" perspective when I have a problem.
Pretty awesome amount of content in this, given that it's relatively short and covers so many topics.
edit: I guess I'd also like to ask what are everyone's thoughts on java? I've seen some examples of how inefficient java can be in comparison to some c code, and it is true that you are denied quite a lot of low level access (pointers anyone? )
I feel like it's a decent medium for a hobbyist, like myself, but I really don't have any argument for why I enjoy coding in Java over c++.
|
I like this article. It is well written and even if I'm not that interested in writing a game I found it a useful refresh on many of the concepts I studied at uni but haven't really been exposed to since.
Thanks for writing it! I enjoyed reading it.
|
As someone else who's in a software engineering program hoping to go into game programming, this is really awesome! A lot of the stuff I work in on my second-year courses is exactly the kind of stuff you're talking about which is really helpful.
One thing though - in your section about game engine architecture you use the Source engine as an example of an engine specific to first-person shooters, when in reality Dota 2 (and every other Valve game since HL2 I think) is built on the Source engine. I'm a bit of a Valve fanboy =P
|
Nice article. Also worth mentioning Panda3D and Torque3D as other options for prebuilt game engines. Especially now that T3D is MIT licensed and on Github.
|
United States2829 Posts
On November 18 2012 04:43 akarin wrote: This looks so sweet! I'm really looking forward to reading this later, I have just scanned through it. As a nooby CS student (we covered arrays last week ^^) I am wondering is java used (much) in programming games?
Thanks for writing this Cecil! Sorry, Java isn't used really at all (as far as I know) professionally. I'm always hearing about how people are being interviewed for full-time positions around here (cough cough Microsoft) and are always declined; they don't really know what's going on. I'm sure there's a lot of Java jobs out there, but the kind I'm aiming at are not.
On November 18 2012 07:06 DodgySmalls wrote:I'll bookmark this and use it along side other references to try to get a "fresh" perspective when I have a problem. Pretty awesome amount of content in this, given that it's relatively short and covers so many topics. edit: I guess I'd also like to ask what are everyone's thoughts on java? I've seen some examples of how inefficient java can be in comparison to some c code, and it is true that you are denied quite a lot of low level access (pointers anyone? ) I feel like it's a decent medium for a hobbyist, like myself, but I really don't have any argument for why I enjoy coding in Java over c++. I don't use Java, but what all my superiors tell me is that it isn't nearly enough to cut it whenever you have a product that requires heavy optimization.
See for reference: http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
|
Nice article! Glad to see people documenting their learning progress and sharing their expreience with others.
Sidenote: '#pragma once' is awesome not those crazy header guards .
On November 18 2012 08:49 CecilSunkure wrote:Show nested quote +On November 18 2012 04:43 akarin wrote: This looks so sweet! I'm really looking forward to reading this later, I have just scanned through it. As a nooby CS student (we covered arrays last week ^^) I am wondering is java used (much) in programming games?
Thanks for writing this Cecil! Sorry, Java isn't used really at all (as far as I know) professionally. I'm always hearing about how people are being interviewed for full-time positions around here (cough cough Microsoft) and are always declined; they don't really know what's going on. I'm sure there's a lot of Java jobs out there, but the kind I'm aiming at are not. Show nested quote +On November 18 2012 07:06 DodgySmalls wrote:I'll bookmark this and use it along side other references to try to get a "fresh" perspective when I have a problem. Pretty awesome amount of content in this, given that it's relatively short and covers so many topics. edit: I guess I'd also like to ask what are everyone's thoughts on java? I've seen some examples of how inefficient java can be in comparison to some c code, and it is true that you are denied quite a lot of low level access (pointers anyone? ) I feel like it's a decent medium for a hobbyist, like myself, but I really don't have any argument for why I enjoy coding in Java over c++. I don't use Java, but what all my superiors tell me is that it isn't nearly enough to cut it whenever you have a product that requires heavy optimization. See for reference: http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
Learning java is great, just don't stop there. Once you learn one language (which you CAN use to make games, just possibly not super-awesome AAA titles), it becomes easier to learn a second language.
Android development is java, so there are at least some games written in java. I believe the ever-popular Runescape is also written in java. Most AAA titles for the PC are written in C++ however.
|
thedeadhaji
39489 Posts
On November 18 2012 02:42 CecilSunkure wrote:Show nested quote +On November 18 2012 02:35 PassiveAce wrote:many things in C and C++ are hidden away from the developer and in turn makes them slower. Having slow code isn’t acceptable for high performance real-time applications such as games. Hey Cecil, is this a typo also? the sentence seems contradictory in relation to the rest of the paragraph. This sentence comes from the "goals of the article" section at the top. once again, this guide is truly incredible, thanks for taking the time to writing it : ))) Haha yes definitely a typo, thanks for pointing it out. Should say something like "many things in interpreted and other high level languages", not C and C++.
C hides a lot of stuff away from the developer compared to assembly! (just this week, we actually had to implement something in Assembly since C was too slow, lol -- this was for an embedded systems environment tho)
|
On November 18 2012 08:49 CecilSunkure wrote:Show nested quote +On November 18 2012 04:43 akarin wrote: This looks so sweet! I'm really looking forward to reading this later, I have just scanned through it. As a nooby CS student (we covered arrays last week ^^) I am wondering is java used (much) in programming games?
Thanks for writing this Cecil! Sorry, Java isn't used really at all (as far as I know) professionally. I'm always hearing about how people are being interviewed for full-time positions around here (cough cough Microsoft) and are always declined; they don't really know what's going on. I'm sure there's a lot of Java jobs out there, but the kind I'm aiming at are not. Show nested quote +On November 18 2012 07:06 DodgySmalls wrote:I'll bookmark this and use it along side other references to try to get a "fresh" perspective when I have a problem. Pretty awesome amount of content in this, given that it's relatively short and covers so many topics. edit: I guess I'd also like to ask what are everyone's thoughts on java? I've seen some examples of how inefficient java can be in comparison to some c code, and it is true that you are denied quite a lot of low level access (pointers anyone? ) I feel like it's a decent medium for a hobbyist, like myself, but I really don't have any argument for why I enjoy coding in Java over c++. I don't use Java, but what all my superiors tell me is that it isn't nearly enough to cut it whenever you have a product that requires heavy optimization. See for reference: http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
Java sees HEAVY use in certain industry, and is capable of being highly performant when the code is written by someone who knows what they're doing. That doesn't mean it's a good intro language, or that it's the right tool for every job. Or that the language design is particularly elegant. But Java-bashing is a popular hobby for not terribly good reasons.
|
On my to read list ! thx a lot for a such a good work!
|
Bookmarked and saved! The Quick Refresher stuff is SO IMPORTANT and so amazingly well put together. A lot of the fundamentals in there is what people in the industry REALLY look for when hiring and during interviews. This is an amazing review sheet to use before an interview. Thanks a lot!!! :D
|
Wow, so much info. This is a good overview of many important concepts in programming.
You should add some info about using revision control systems. These systems are the foundation to managing a project between a group of people, and every programmer needs to learn how to use them.
Git is pretty famous and a really nice system. Github is massive.
Valve uses a system called perforce, which is basically a rev system for more than just code. We used it to store textures, vertex files and all the other things the artists make.
Some more design patterns would be cool too. I find the "Strategy" pattern is really well suited for making a simple game.
|
i will read this one day >.>
|
ALLEYCAT BLUES49484 Posts
holy hell yes, This is so useful for me I will read,reread this a lot as I progress on my own.
|
That's some insane amount of work you put in there, congrats !
However some things are just bugging me.
Arrays cannot be passed around from one location to another directly. If attempted, the name of an array will be converted to a pointer to the first element in the array. This incurs a loss of information, as a pointer stores information about location and type, whereas an array stores location of first element, type of the elements and number of elements. This “feature” of C and C++ can actually be viewed as a “language bug”. What do you mean by "name of an array will be converted to a pointer" ? Strictly speaking those two things are just the same: pointers. the name[idx] syntax is just some syntaxical sugar over doing *(name+idx). Furthermore the "size of the array" is never stored anywhere in C. You can write it explicitly when allocating on the stack, but it will eventually get lost when compiled, and the compiler won't give you any warning if you access out of bounds entries. Here's an example:
#include <stdio.h> int main() { int array[] = {1,2,3,4,5}; printf("array[3] = %d | *(array+3) = %d\n", array[3], *(array+3)); return 0; }
Running
test % gcc test.c -o test test % ./test
then outputs
array[3] = 4 | *(array+3) = 4
When asking gcc to output it as assembly (gcc -S -m32 test.c) we get (some parts have been cut) :
_main: pushl %ebp movl %esp, %ebp pushl %esi subl $52, %esp call L1$pb L1$pb: popl %eax movl _C.0.1863-L1$pb(%eax), %ecx movl %ecx, -32(%ebp) movl (_C.0.1863-L1$pb)+4(%eax), %ecx movl %ecx, -28(%ebp) movl (_C.0.1863-L1$pb)+8(%eax), %ecx movl %ecx, -24(%ebp) movl (_C.0.1863-L1$pb)+12(%eax), %ecx movl %ecx, -20(%ebp) movl (_C.0.1863-L1$pb)+16(%eax), %ecx movl %ecx, -16(%ebp) movl -20(%ebp), %ecx movl -20(%ebp), %edx movl %esp, %esi movl %ecx, 8(%esi) movl %edx, 4(%esi) leal L_.str-L1$pb(%eax), %eax movl %eax, (%esi) call _printf movl $0, -12(%ebp) movl -12(%ebp), %eax movl %eax, -8(%ebp) movl -8(%ebp), %eax addl $52, %esp popl %esi popl %ebp ret
Notice how our array entries get accessed:
movl -20(%ebp), %ecx movl -20(%ebp), %edx
. (then get pushed on the stack later on etc). As you can see there, both times it is accessed in the same way.
Arrays are just there to lighten up the syntax.
For example, you could want to iterate over a null-terminated char array this way:
void iterate_and_do_nothing(char *str) { int i; while (str[i]) { ++i; } }
That's valid, yet on this one the interrest of using an array-type approach is limited ...
|
|
|
|