views:

248

answers:

7

Hello all. I've been learning C++ for quite a while and a thought flashed in my mind to do a very simple game.

What is my first step? Any libraries available?

What books/sites you recommend?

Finally, is c++ ok to start with games programming?

+1  A: 

Depending on the type of game you're interested in, the Ogre project may be just the thing for you.

Ogre provides an open-source, cross-platform 3D environment with integrations into other projects including physics engines.

Eric J.
thanks Eric. I'll look into that.The kind of game i can think of is tetris and such.
torrtruk
@torrtruk: If you're looking into a 2D game, it looks like SDL might be more appropriate (though I have never used it). Ogre makes is fairly easy to get started with 3D games.
Eric J.
Yes, i'm still a beginner. Need to learn the basics of 2D stuff. Thanks for citing Ogre, though.
torrtruk
+4  A: 

SDL is a good place to start as well.

http://www.libsdl.org/games.php

http://gpwiki.org/index.php/Category:All_SDL_articles

datageist
thanks. I'll check this out.
torrtruk
+5  A: 

Check out gamedev.net. And happy fun and good luck with it! :D

Hope this helps, Best regards, Tom.

tommieb75
thanks Tom! this looks better for newbies like me :)
torrtruk
I agree with gamedev.net. I learned almost all I ever needed to know about OpenGL programming using the nehe.gamedev.net tutorials. +1
Tom
@Torrtruk: no problem :) the very best and have good fun! :)
tommieb75
There's a lot there, but be careful -- it isn't all good. Some of the articles are factually flawed, and some of the advice is (IMHO) very poor. I'm not saying this isn't a good resource, but don't turn off your BS filter.
Steve S
@Steve yes, i'll learn that as i move on. Thanks for the caution.
torrtruk
+2  A: 

If you're just starting out, and the main purpose is to learn about game programming...

Then I'd recommend pygame.

You will be able to develop and learn about SDL faster than in C++. Later you can switch back to C++.

Brian R. Bondy
yeah i kind of knew that some other language is easy to start games programming. thanks for pointing this out!
torrtruk
+2  A: 

You want to start out small and grow your experience. I would suggest you start with simple 2D games and work your way up. For a good library that hides the platform's details from you start with SDL as mentioned by a previous poster. Ogre3D is good but I would consider it too advanced for you at this time.

Then when you know how to build SDL samples try writing your own games to understand the main loop, input, sprites, other graphics, audio, animation etc. Start with a few projects. For example, write your own Tetris, or pacman, or space invaders. And then start getting more complicated by adding features. Try writing pacman with a scrolling maze (rather than on one screen). Then do a simple platform game like mario. You can see where I am going with this.

Then when you're comfortable with 2D games then perhaps make the leap to 3D - but this is a lot more complicated environment to learn in.

If you familiar with C++, maybe you can switch to C#. This is an easier language to deal with as you don't have to worry about low-level stuff like memory management. Microsoft provide a good framework called XNA which has the added benefit that you can play your games on your Xbox360 too. I would recommend that. XNA has support for both 2D and 3D games.

Good luck in your journey!

Cthutu
thanks for your advice, sir! I don't have enough reps to vote your answers :(
torrtruk
+1  A: 

Here's an article on why you should be using C++ to make games.

Here's a tutorial site that uses C++ (horrible UI though) and a really cool website on game programming patterns.

Stephen
Stephen, the first article you linked to, describes that c++ is chosen for the main reason that it's popular. But I don't really understand that C++ would be a pain in the ass (as I'm very new to the language as a whole).Will read these articles many a times and try to make a decision. Thanks a lot.
torrtruk
Sorry, I thought the first link was to an article that said that Ruby and to a lesser extent Python are slower then C/C++ in terms of going from code to machine language. I'll find the original link I was thinking of.
Stephen
It's probably worth pointing out that there are many people in the games industry these days who would make an argument about why you should NOT use C++ to make games :) The argument essentially comes down to the inefficiency of object oriented programming in relation to the specific hardware of modern consoles and the effects of cache coherency on your execution speeds.
Fraser Graham
@Fraser, Thanks. I'd like to know what is the current popular language to do this. Also, you being a game developer, can you please share me your initial experience with game dev.
torrtruk
Why do you want to know what is 'popular'? Popularity should never be a reason to do something. You might choose a language because there is a wide selection of existing libraries, or because it will give you experience relevant to a future career choice, or because it will be the easiest to program in, or because it will facilitate higher performance, or it has the most friendly and useful community... etc. C++ is the answer in most of these case but not all.
Kylotan
@Kylotan Excuse me, I used the wrong word, to be honest. Instead, what I should've asked was 'what is the current preferred language'. And you almost gave the answer for that. Thanks.
torrtruk
In the industry, it's C++. But a lot of that is down to inertia. If I were writing a game at home, despite having 14 years of C++ experience, I would use Python.
Kylotan
The trends i've noticed have been a drift back to straight C for anything low level that needs to be small and fast but often layering a lightweight and more iteration friendly scripting language like Lua on top of that for gameplay logic.
Fraser Graham
+2  A: 

Try this nice SDL alternative http://www.sfml-dev.org/index.php

TheFuzz
wow! looks like a real alternative to SDL.
torrtruk