Sign in to follow this  
zodiacbrave

C/C++ Source Code for Games

Recommended Posts

Hello, I am currently taking a C class and I am interested in reading other C/C++ code that professionals have written. I am wondering if anyone can recommend any specific source code that might be worth looking at? I know the Quake 3 source was released but is that still relevant and I wonder if it is something worth studying? I guess what I am interested in is coding style, layout, etc... Also, how they setup math libraries, physics and such. Anyway, thank you.

Share this post


Link to post
Share on other sites
if c is an option for you, then quake 3 is a very good piece of code to look at.
I learned c programming with the quake 3 sdk and engine. it has very good coding style, and most of it is really easy to understand.

I worked for quite some time with the q4 sdk, but all the bugs aside, it is not very intuitive,
there are quite a lot of bad examples of what you shouldn't do in a game (or any other code for that matter).
I wouldn't recommend it for a beginner.

I haven't touched the source sdk yet, can't tell you anything about it,
but valve is one of the developers I respect for writing high quality games,
so I guess it would be a good choice.

Share this post


Link to post
Share on other sites
Just keep in mind, if you are just beginning then you are going to run into all sorts of things in the source of a triple-A title that you probably have never seen. And most of it you won't see even in University C++ classes. So it might be fun to look at and all of that but don't expect to learn a whole lot just from looking. You'll likely need the MSDN open right next to the source just to look up all the crazy syntax you'll see.

Share this post


Link to post
Share on other sites
Read this, then read it again:

http://scientificninja.com/advice/dont-read-source-code

I made the mistake you're making when I started out and I regret it. I wish I could have read that article years ago.

Most of a 3D game, at least now with rendering API's available for free, is nothing more than math. The difference between two pieces of code will probably boil down to variable names and structure. Otherwise, they are the same beast. Anything that doesn't fit that generalization is a hack that will screw you up badly in the end.

Develop your own techniques. It will actually take you less time since you wont be trying to fix another developer's mistakes. Professional code doesn't mean good code.

Share this post


Link to post
Share on other sites
Quote:
Original post by TTK-Bandit
I learned c programming with the quake 3 sdk and engine. it has very good coding style, and most of it is really easy to understand.


I would highly suggest that you don't learn C from the Quake 3 source.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this