Fundamentals of Game Programming?

Started by
7 comments, last by mmakrzem 12 years, 6 months ago
Firstly - New to the forums: Hello all!
Before I ask my questions, a little background info:

I have a fair knowledge of C++, have been learning/using it on and off for a touch over a year - I have a firm grasp on most concepts.
With regard to game development, I have played around in S.D.L a little, but I am relatively new to game design.

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

I was reading around, trying to decide on the best way forward - and this led to me believing that I needed to create a simple game engine. After getting a cold hard reality check, I have realized that in order to get anywhere with something as complicated as game design, I'm going to have to start with small, completable projects, and work my way up (I was considering a Tetris clone). Does anyone have any guidance they could offer?

Note: I am particularly confused as to what level to approach this from. Should I be creating a simple, procedural program? or should I be using state/process managers and complex class structures. Any help would be greatly appreciated :)
Advertisement
"Should I be creating a simple, procedural program?"

Yes.

"or should I be using state/process managers and complex class structures"

No.
Just pick a game or three that you'd like to tackle, and go make them! Feel free to experiment with different tools, engines, SDKs, even languages - the more equipment you have to work with, the better your chances of being able to implement your designs down the road. In particular, don't feel confined to C++; if it seems like you're spending more time than you'd like wrestling with mundane stuff instead of getting games finished, then by all means swap to something else.

Other than that... just hack away, and pay attention to things that seem unpleasant or sticky - those are areas where you might be able to improve your programming. If you catch yourself feeling like "there's got to be a better way to do this" then heed that instinct - it'll serve you well. Don't worry too much about getting it perfect or even all that "right" to begin with; the best way to learn how to improve is to make mistakes and analyze them.

Final thought: keep it simple. Do the simplest thing that could possibly work. It isn't worth wasting time on complex reusable architectures or engines or whatever if that gets in the way of you doing what you're interested in.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Okay then, so I'll have a bash at Tetris, and see how that goes. Is it acceptable to post the code on the forums for people to make suggestions?
Thanks Apoch :)

Okay then, so I'll have a bash at Tetris, and see how that goes. Is it acceptable to post the code on the forums for people to make suggestions?

it's fine to post code. When you get stuck on something, we encourage you to post all relevant code, and a screenshot of your game if it sheds any light on the problem. People often post too little code for others to help without asking that more be posted. Also, post exact error messages. But if you just want a code review, put it on github or google code or some other repository and provide a link. Uselessly excessively long posts are the root of some evil.
You should not use the native version of C++ for high level game logic because finding memory leaks and protecting against access violation will take away your creativity and waste most of your time.
Or just use boost::shared_ptrs for everything, and then you won't have memory leaks.

Honestly, tetris really shouldn't involve that many memory allocations. I recall writing tetris clones in 20-30 lines of BASIC on 8-bit micros with fixed length arrays and things.

Or just use boost::shared_ptrs for everything, and then you won't have memory leaks.

Honestly, tetris really shouldn't involve that many memory allocations. I recall writing tetris clones in 20-30 lines of BASIC on 8-bit micros with fixed length arrays and things.


This. In fact, I'd bet you could write a Tetris game without using new or malloc() once in your own code, if you really wanted to.
I see this question quite a lot on game development forums.  I have decided to start a new video tutorial series that will address this concern by choosing a simple 2D single screen game (like pacman for instance) and show how to make it from scratch.<br /><br />I've called out the public to suggest which game I should make and shortly I will be choosing one from all the submissions and start to code.  Keep an eye on my website!

This topic is closed to new replies.

Advertisement