Starting in on game programming

Apprentice
Posts: 5
Joined: 2009.07
Post: #1
Hi, I've been lurking here for the last few weeks, and I've decided to try getting into making games on my Mac.

My goal is to make (or at least start) a sort of simple action/adventure style game to introduce me to game programming. My more immediate goal is to just get a sprite loaded on a map and give him some simple movement through keyboard input. I can later build on that with attack animations, enemies, a story, etc.

Before I state my ideas on how to achieve this, I'll give a little background on my computer abilities. I started by playing/modding Civilization IV about two years ago (15). I became a pro at using XML and I wrote a couple of simple Python scripts. The programming part was very light, but I really got into learning how to create some nice low-poly units and buildings and editing the other existing models. I belong to a great forum, civfanatics.com, which has a strong modding community. I first got interested in programming applications when I saw all of the cool little applications that Windows modders could use, but I couldn't. I started working through Aaron Hillegass' book on Cocoa Programming, and I got through a few chapters before I decided I'd like to make my own game, so here I am. Smile

I've looked at about a billion different languages, engines, libraries, etc. and what I've come up with is either C or Objective-C for the code and Quartz2d or OpenGL/GLUT for drawing. I was just wondering what you guys though of these options, and if you could offer some good tutorials/books for learning. I understand very basic Objective C, with even more rudimentary knowledge of C. What I've been stuck on with my own little experiments is understanding how to use OpenGL/GLUT. I got through OSC's GLUT tutorial, but I still don't understand it very well. I think Quartz might be easier, but I haven't tried it out yet. Eventually I will want to learn OpenGL, but for now I just want some simple 2d graphics.
Okay, enough rambling, what do you guys think about my choices, and where are some good places to learn for someone new to game programming?
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #2
There are other alternatives to C/C++/Objective-C/OpenGL/Cocoa for programming games on the Mac. I don't have any good suggestions off the top of my head right now, but I'm sure someone will come along with some.

Quartz really isn't going to be easier than OpenGL in the end, so OpenGL is probably best if you stick to the C/C++/Obj-C route, IMHO. It's a steep learning curve, but it's doable.

Be sure to consider other options like Unity.

There are many opinions on this topic around here, so I'm sure you'll get an eyeful soon. Wink
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #3
You could try using Python with Blender or Nu with Cocoa, I don't know how fast Nu is, but for basic games it should be fine. Of course you should know ObjC anyway.

Nu=Lisp+ObjC+Ruby for those who don't know Smile
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.07
Post: #4
Thanks for the input, guys.
Okay, so Quartz is out. I'm leaning towards Objective C I think, since I've had some (limited) exposure to it. I know I want to learn C sometime, but I guess its not necessary right now. I'm wondering if anyone knows of any good 2d OpenGL tutorials. The Red Book seems rather 3D oriented, but I just want 2D. As for Unity, I'm not exactly looking to spend $200 for a game engine. I'll go for a programming book, but there are plenty of free things available that would work fine.

I think I want to be learning more programming than just a level editor and scripting, but I'm a bit overwhelmed by OpenGL. I've been looking at Pyglet, which seems like an interesting option, at least to get introduced with. What are you guys' opinion on that? It seems interesting, but how in the hell do you compile .py files? It's built so much as a scripting language that it seems difficult to package anything you make. (I've Googled this a bit, but I couldn't come up with much.)
Just looking at Oddity's post..
I've played around with the Blender Game Engine a bit, but it's too 3D oriented and only has some Python scripting abilities (although I know you can still do some powerful stuff with it.)
Nu seems interesting, but I'm on Tiger.

Please keep the ideas coming, as I'm sure for every answer I'll have many more questions.
Thanks!
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #5
I believe it is generally recommended to learn C before Objective-C, but I don't see any reason you can't learn Objective-C first as long as you understand the basics.

Regarding Pyglet, diordna would be the guy to talk too - he made gw0rp using Pyglet(I think).

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
Member
Posts: 30
Joined: 2009.04
Post: #6
I would recommend C++ for a bigger, more advanced game that you could build off later but C is alot quicker than C++ and easier to learn so you might want to start with C and learn C++ later. Regarding OpenGL and GLUT I'd recommend you to go with SDL instead of GLUT because SDL is able to:

-Make a window (a bit harder that GLUT though)
-Do all the game specific things (Receive user input, draw graphics, play sound, etc.)
-Combine itself with OpenGL
-Portable

and overall it's a great API to start with and then later move on to OpenGL since OpenGL is harder than SDL and it can do most of the things that SDL can and it's graphics are ALOT better than SDL's.

But you know, that's just my opinion, I've recently started SDL and i've had a little taste of OpenGL. But you should really just go with whatever suits you best anyway.

Good luck on making your game, but i'm telling you now it WILL be hard!

OMG! IT'S A SQUIRREL!!!
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #7
If you are determined to do things the hard way (i.e. you don't want to choose more sensible paths like Unity), my standard recommendation is to learn C first and get into OpenGL using GLUT. That way it's easier to move up to SDL/C++/Objective-C later on. Starting off with SDL is not a terrible idea though, but I would personally prefer to stick with GLUT first since there is less to have to learn. C and OpenGL are a huge pile on the plate as-is.

A few quick points to clear up any bits of mis-information in this thread:
- Yes, to learn Objective-C you'll need to know C first anyway since Obj-C is a strict superset of C.
- C++ can also be learned first, but I *strongly* recommend against taking that path first (as some may well know by my other posts on the subject), since you'll need to learn C along with it as well, plus it is a very complicated language -- powerful but complicated, and very dangerous for beginners IMNSHO.
- C++ is not slower than C in any practical sense. Slower to learn, but certainly not slower performance-wise.
- GLUT is portable too.

All that said, I would still recommend looking into alternative paths like processing, Python, basic, etc... But I don't know much about those for game programming, so I can't offer specifics. All I know is that C/C++/Objective-C/OpenGL/Cocoa/SDL are pretty steep in terms of learning curve.
Quote this message in a reply
Member
Posts: 30
Joined: 2009.04
Post: #8
AnotherJake I wasn't saying that SDL is better than GLUT or anything like that I was just telling FlintLock my Opinion and listing some of the good things about SDL. All I was saying is that learning SDL and then learning OpenGL instead of learning GLUT and then learning OpenGL will be more helpful and useful since SDL was made by game programmers for programming games, so it's really game-specific. Also learning C++ before learning C is not that hard, I, myself learnt C++ first and then tried learning C with not much success Annoyed. I just couldn't get used to typing %d before outputting a number, IT WAS SOOO FRUSTRATING MadMadMad!!

But I'm really just going to encourage whatever FlintLock goes for since it's not THAT big of a difference and besides that's just what I recommend anyway.

[EDIT] Also sorry about the whole "C is alot quicker than C++" thing I meant that incorrectly, good thing you understood what I meant though [/EDIT]

OMG! IT'S A SQUIRREL!!!
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.07
Post: #9
I think I'm going to try out Pyglet for a while, and then move up to C/GLUT when I feel ready for it.

What I'm really interested in is what are some tutorials or books you guys would recommend so that I could learn C? (I know about K&R, but it seems more like a reference vs. a learning book.)
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #10
Flintlock Wrote:I think I'm going to try out Pyglet for a while, and then move up to C/GLUT when I feel ready for it.
Good call!

Flintlock Wrote:What I'm really interested in is what are some tutorials or books you guys would recommend so that I could learn C? (I know about K&R, but it seems more like a reference vs. a learning book.)
Besides K&R, my favorite is Learn C on the Mac. It's a digestible introduction to C for beginners. You can even start that right away to get your feet wet while you're messing with Pyglet.
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.07
Post: #11
Yea I actually went to B&N to pick that up one time, but they were out so I got Objective-C on the Mac instead. Mad
Oh well, I maybe can try again or pick it up online.

Thanks for the help guys, and more info (esp. on Pyglet) would be great!
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #12
More info on pyglet? I'm writing a book on it. I'll PM you a link to my current example code and manuscript.

The pyglet mailing list is extremely helpful. Feel free to email me if you have any specific questions. (steve.johnson.public.removethislastpart@gmail.com)

My web site - Games, music, Python stuff
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.07
Post: #13
Thanks for the link, I'll check it out in depth when I get back from my basketball tourney this weekend. I know I'll have plenty of questions for you. (esp. how to compile .py files.) One more question though, how long do 'I have to wait until I can PM people? Its really annoying not being able to...

Thanks again!
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #14
Flintlock Wrote:One more question though, how long do 'I have to wait until I can PM people? Its really annoying not being able to...
Unfortunately it's turned off for everyone except moderators. The forum owner, Carlos, says it's to stop some sort of spam. Most (all?) of us think having it off does more harm than good, but it's not our joint Wink

Email is off too, last I checked... Annoyed
Quote this message in a reply
Member
Posts: 30
Joined: 2009.04
Post: #15
AnotherJake Wrote:Unfortunately it's turned off for everyone except moderators. The forum owner, Carlos, says it's to stop some sort of spam. Most (all?) of us think having it off does more harm than good, but it's not our joint Wink

Email is off too, last I checked... Annoyed

Heh, I didn't know that!
But anyway, I didn't know you could PM people Rasp.

OMG! IT'S A SQUIRREL!!!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Playing the game you' re programming Najdorf 19 8,056 Mar 29, 2003 06:15 AM
Last Post: Dr. Light
  game programming as an artform antadam 18 8,062 Feb 21, 2003 03:58 PM
Last Post: Zachary