Thread: Whats the best way to begin games programming with c++

  1. #1
    Registered User
    Join Date
    Sep 2009
    Location
    Bangkok, Thailand
    Posts
    6

    Whats the best way to begin games programming with c++

    I want to know the best way to begin games programming with C++. Ive just started learning c++ so i dont expect any fast results but i want some pointers so i dont go off in the wrong direction.

  2. #2
    Registered User valaris's Avatar
    Join Date
    Jun 2008
    Location
    RING 0
    Posts
    507
    If you just started learning c++ then your first games should probably be mostly based around logic elements. IE card games, hangman, things that will get the language down in your head. You can throw in some ASCII type graphics by writing out to the console.

    This is mostly because even if you do manage to copy and paste some actual graphics code around and get something to display, chances are you will have no idea how it works if you dont have a decent understanding of c++.

    After you get quite comfortable with c++ then look into opengl/directx or some wrapper library.

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    399
    Once you feel that you're comfortable with C++ then I would suggest you try to code a 2D game that uses SDL for the graphics and input. Don't even think of coding a 3D game before you have at least some basic knowledge in algebra, mechanics and some 3D library like OpenGL or Direct3D.

    Here are some links to get you started with SDL

    Lazy Foo' Productions
    SDL Tutorial Basics | Dev Hub

  4. #4
    Registered User
    Join Date
    Feb 2009
    Posts
    40
    SDL is a C library, it is better to use SFML in my opinion, but of course, before you start to use those libraries you most have some basic c++ knowledge.

    SFML - Simple and Fast Multimedia Library

  5. #5
    i've lost my mind
    Join Date
    Jun 2008
    Posts
    26
    You need to be very comfortable with object oriented programming. Game are systems, systems that involve some number of players. Games have rules, implemented by logical conditions. Games usually keep track of a lot of information, games need to be able to calculate future steps based on various conditions. In order to deal with information you will track in a game you'll need to be very familiar with the data structures used to format and manage information, lists, stacks, vectors, linked lists, etc. You need to understand searching and sorting algorithms, in order to do quick look-ups and checks on many objects.

    GameDev.net - all your game development needs <-- is a community of people dedicated to computational geometry, game programming, and the like. Game programming is a big field, with many specialized areas. I always advise people to discover and join *DEDICATED* communities - it's the only way to get GOOD responses on all of the subject matter involved.

    If you want to get started right away, you can start with simple games, like tic tac toe, and instead of just making the game WORK, make the game RIGHT in software. What matters more than ANYTHING is that you understand the PROPER concepts and PROPER implementations of those concepts. A game like tic tac toe can be managed MANY ways. What few people learn to 'see' as learning programmers is the game from a larger, strictly organized, perspective that allows you to segregate the various aspects of it.

    Be organized, understand every part of the game well, figure out how each part of the game can best be managed.

    While you do need to understand a programming language well - it is far from all you need to learn. Games are mathematical puzzles, there's all sorts of challenges. The better you are at, and the more you enjoy, mathematics the easier of a time and the more enjoyable the experience will be for you.

    You'll spend most of your time planning things out on paper, figuring out the math for various visual effects and mechanisms. Think abstractly and you will be able to design good games.

    I bite. RAWRz! >:]
    Last edited by gltiich; 09-11-2009 at 02:30 PM.

  6. #6
    Registered User
    Join Date
    Sep 2009
    Posts
    29
    I know this is a C++ board, but I think XNA (which uses C#) is an easy to pick up beginners intro to game development. It's mostly just a wrapper for the DirectX stuff, so if you get familiar with it, you can try jumping into DirectX using C++.

  7. #7
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    By learning the components that go into games on their own first: most of the language syntax, idioms/patterns, networking, databases, input/output, gui, graphics, sound, synchronization/threading, ai, etc. In my opinion, once you're comfortable with most (not all) of the subjects then you're ready. I think graphics, ai (and possibly sound) can be saved for the first game.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    GameDev.net - all your game development needs <-- is a community of people dedicated to computational geometry, game programming, and the like. Game programming is a big field, with many specialized areas. I always advise people to discover and join *DEDICATED* communities - it's the only way to get GOOD responses on all of the subject matter involved.
    Incorrect. It is a good site but not the only place to get responses. Gamasutra is a bit more on the professional side and their articles are top notch. Gamedev seems to be catering more to XNA now than anything which is a bit odd. Your statement is far too broad to be true.

    Best way to get into game programming is to get a few good books and dive right in.
    Last edited by VirtualAce; 09-11-2009 at 09:08 PM.

  9. #9
    Registered User
    Join Date
    Sep 2009
    Location
    Bangkok, Thailand
    Posts
    6
    THanks for the advice, im still just learning the basics of c++ and i was impressed enough being able to create a small guessing game (basically guess the random number) and i managed to extend the game by adding a do-while loop so that you can have multiple tries. I know its kids stuff but i can see how these practices could later be linked to something like a puzzle in zelda where you have to choose the chest with the key in it. I'm in no rush to learn it.
    Thanks to gltiich for the insightful comments.

  10. #10
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by ryan_28 View Post
    I want to know the best way to begin games programming with C++. Ive just started learning c++
    Thats the best way to begin. Also, accept that you won't be writing an MMO or a FPS any time soon. Contrary to popular belief, games are actually some of the most challenging application's to write. They draw upon just about every aspect of programming. On the other hand you can write simple games much easier than say simple word processors. By simple I mean really simple, like guess the number. Then you can move up to more advanced games like tic tac toe.

    And shy away from askign for help on gamedev, that board has godo articles, but the forum has been overrun with hateful trolls with admin powaz.
    Last edited by abachler; 09-13-2009 at 06:45 AM.

  11. #11
    Registered User
    Join Date
    Oct 2008
    Posts
    84
    Quote Originally Posted by Bubba View Post
    Incorrect. It is a good site but not the only place to get responses. Gamasutra is a bit more on the professional side and their articles are top notch. Gamedev seems to be catering more to XNA now than anything which is a bit odd. Your statement is far too broad to be true.

    Best way to get into game programming is to get a few good books and dive right in.
    Could you name a few of these books? Not just the beginner ones but the ones which will be useful down the line or the ones you have found worth a read ?

  12. #12
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by rocketman03 View Post
    Could you name a few of these books? Not just the beginner ones but the ones which will be useful down the line or the ones you have found worth a read ?
    Here's a list of what I have in my home library that is specific to games -

    Tricks of the Game Programming Guru's ISBN 0-67230507-0
    More tricks of the game programming guru's 0-67230697-2
    Tricks of the Windows Game Programming Guru's 0-67232369-9

    Programming Game AI by example 1-55622-078-2
    Focus on 3D Terrain Programming 1-59200-028-2
    Introduction to 3D game programming with DirectX 9.0 - 1-55622-913-5
    Mathematical Techniques - 1-58450-58-1
    Level Design Terrain and Sound - 1-58450-213-4

    Massively Multiplayer Game Development vol. 1 - 1-58450-243-6
    Massively Multiplayer Game Development vol. 2 - 1-58450-390-4

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Resources for professional games
    By EVOEx in forum Game Programming
    Replies: 8
    Last Post: 06-17-2009, 02:42 PM
  2. When done right, PC games are amazing
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 08-13-2008, 05:32 PM
  3. Violent video games?
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 58
    Last Post: 04-26-2006, 01:43 PM
  4. Video Games Industry. 5 years left.
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 12-10-2002, 10:52 PM