views:

2012

answers:

11

I've always had an interest in creating my own games, and now at university I have the opportunity to create some 2D and 3D games using Java and C++ for those who are that way inclined.

I've never really programmed a game before, let alone graphics, so I'm completely new to the area. After a quick trip to the library today I came across very little information on starting 2D game development or even graphics programming in Java or C++. I can program in Java at a reasonable level, but I have never touched C++.

  1. Can someone recommend any good books on starting Graphics Programming in Java or C++?
  2. I have no C++ experience, but I've programmed in C and Java and feel reasonably comfortable in both. Should I take the jump and dive into C++ when important marks are at stake? I hear a lot of good things about C++ as far as Games Programming goes so I'm unsure as to what is the best option for me.
  3. I'm looking to write a 2D game in my own time for a bit of fun before I start getting into the heavy work at university. Can anyone recommend some good resources for those interested in writing their own games using OpenGL and Java/C++.
  4. For those who have followed my other questions here I am terrible at Maths and hold very little knowledge of even the foundations. Is this going to be a serious problem for me? If I were to need Math knowledge what do you recommend I brush up on?

I apologise if my questions seem a bit vague, as I'm a complete newbie when it comes to a lot of these topics. Any help you could provide would be much appreciated.

EDIT: I've already checked out the question titled "game programming", but have found it to not really cater for my specific questions.

+1  A: 

Similar question here that you might find useful: http://stackoverflow.com/questions/124322/game-programming#124427

Marcel Tjandraatmadja
+2  A: 

I have this book: Beginning C++ Through Game Programming. It might seem trivial at first, but it teaches you a-lot as you go through it. There is no GUI based programming in this book, just the console. Which is good to an extent if you want to see how an entire "story" of a game can come together.

You can also check out Gamedev.net, they have a vast amount of resources and articles to get you started. Good luck. :)

Zee JollyRoger
Thank you for the link to the book. I'm not very confident in my programming abilities as of yet and this book seems to be perfect for my needs. I'll be sure to check it out very soon.
EnderMB
+1  A: 

Here are a few books that I used when writing OpenGL code in C++:

Fundamentals of Computer Graphics

OpenGL SuperBible

OpenGL Red Book

OpenGL Primer

You might check out the MIT OpenCourse on computer graphics too. It might help supplement your development.

Best of luck!

itsmatt
+3  A: 

Honnestly, go buy a xbox 360 and download the free XNA SDK package to get started. Update your maths skills and modify some indie games in their sample kit. Build a small game, invite some friends around for some beers and have FUN!

Your going to learn a lot faster, than touching C/C++/Java, and also too your going to have fun well doing it.

Chad
Interesting answer. At university I am told to use Java or another language if we're feeling adventurous, but the Xbox 360 idea does sound like it'll be good fun when the coursework is out of the way and if I decide to keep making games. Thanks for answering!
EnderMB
The reason why i recommend the Xbox 360 approach is because its fast, has fast turn around times and is just fun! At this stage you do not want to be bogged down with the problems with large scale C++ development. This is were most young people dont get past.
Chad
Why is turn around time so important?In our game development studio, the turn around time from compile to run is about 5-10 minutes depending on the content. So if you make a mistake, and your new its going to take you 5 minutes to find out. This is why turn around time is important at the start.
Chad
A: 

I would recommend starting with C++ and SFML. C++ has the largest available library of existing code and every example you find will probably be C/C++ oriented. SFML is a windowing and graphics library (comparable to SDL if you've heard of that) done using object-oriented design that fits into C++ better. It'll allow you to get up and running with an OpenGL window right off the bat, and the documentation is pretty good as well.

Ron Warholic
+3  A: 

I am going through a similar process to you at the moment. I found the following site helpful, it has a great tutorial (space invaders in Java):

http://www.cokeandcode.com/node/6

You can get the source code and mess around with it. You will probably benefit from an IDE, if you don't already have a favorite you could try Netbeans (netbeans.org) which is free and I think it's pretty good.

As for books this one is OK (it's java-centric):

http://www.amazon.com/Killer-Game-Programming-Andrew-Davison/dp/0596007302

I personally decided to use Java for games (for now) because I am very comfortable with Java and far less so with C++. But you will find that most people use C++ for commercial games. Actually I started with pygame (python games framework) which is also nice to get started, especially if you know python.

unintentionally left blank
That tutorial is great! I've just downloaded the source, run through with it and it all looks a lot easier than I had anticipated. Thanks for the answer!
EnderMB
+1  A: 

Something to help you get into OpenGL is GLUT - the OpenGL Utility Toolkit. It takes care of a lot of the lower-level setup that's a pain to deal with if you're starting an OpenGL project from scratch. It makes it easier to jump right in and start putting stuff on the screen. GLUT hasn't been updated for awhile but you can also try FreeGLUT, which is a newer open source replacement of GLUT and is included by several linux distributions out of the box.

sk
A: 

Game programming, especially where graphics are concerned, involves a fair amount of math. You'll at least want to have a basic familiarity with vectors and matrices, specifically with regard to representing rotation, translation, and scaling transformations. To that end, I recommend Geometric Tools for Computer Graphics. A course in linear algebra wouldn't hurt, as well, although that's probably already in your curriculum.

As far as game programming in Java, I recommend taking a look at jMonkeyEngine, an open source game engine with all sorts of fun example code to get you started. It was originally based on the engine presented in the book 3D Game Engine Design (same author as Geometric Tools above), which is another good source of information about game programming in 3D. There's also C++ code and papers on various topics in 3D graphics at that book's official site.

CapnNefarious
+1  A: 

I know that you specifically asked for Java or C++, but I have found that PyGame (based on SDL) has been a really good primer for me on basic game techniques. They have a couple of comprehensive tutorials and examples, and python is a very clear and easy to pick up language.

I would also suggest the Xbox 360 option as well if you already have one. That is what I will be moving onto next, so that I can learn all the 3D stuff that PyGame is not so great at.

As for math, you could probably get by without real skills for simple 2D games. If you intend on having any kind of physics simulation then are going to have to actaully learn some real math. Even basic 2D games like riding a motorcycle over jumps involve a lot of physics math to make it work/fun

Geoff
+4  A: 

Short answer: Don't write in C++ !!! You'll spend more time futzing with the language than actually learning about games, physics, collisions, etc.

Get a copy of Python and PyGame. It's easy to get started but you'll actually learn heaps. Having learnt Java, you'll be amazed how much simpler Python is for getting the same things done.

Once you're comfortable with your skill set, then look at Panda3D. It's what's used at Pixar / Disney. If you choose to get your hands dirty with C++ at this stage, then diving into Panda3D is going to be good.

All the major studios use Python as does Google. If you end up specialising in C++ you'll become an engine-room programmer. Very necessary but not as glamorous.

Oh, you mentioned grades, etc. Unless you need to take a course in C++ programming, you'd be wasting precious time and energy on it.

CyberED
I don't know that any major studios use Python for much game code, other than EVE Online which uses it on its massive server backend. Certainly for any console platform I've found Python to be unacceptably memory-bulky.
Crashworks
A: 

I am currently doing exactly the same thing as you are now at university but I have nearly finished studying that part of my course! How bizzare!?! Mite be able to send you some extra lecture material aswell, if it helps?

On top of books, I think you should check out these sites:

NeHe Productions

Video Tutorials Rock

Opengl Programming Guide: The Official Guide to Learning Opengl , Version 2.1, Addison Wesley, 2007

Here are the books that I would also check out: Hearn & Baker, Computer Graphics with OpenGL, Prentice-Hall, 2003.

I'd also seriously consider using C++ as your programming language. From what I have been taught and what I have been reading around C/C++ language branch are the most used by the game industry, for example I heard STEAM who made the half life series use C++ and some others.

Here is a free C++ book on the internet: Thinking in C++, 2nd ed. Volume 1 ©2000 by Bruce Eckel

Here is what I learnt from: C++ in 24 Hours, Sams Teach Yourself

Graham