Beginning Game Programming - Choices

Member
Posts: 60
Joined: 2013.03
Post: #1
Hello, I am obviously new here, so I hope this is in the correct section.
Also, I have rewritten this question about 3 times now!

My questions are: Is starting with C++ on Mac using Xcode a good idea for eventually making my own games? I am not overly interested in having them be portable to Windows, etc, and am not at all interested in iPhone dev at the moment, I just want to make games for Mac.

But, my question is, do I have to learn Objective-C in order to make a standalone window for my game/app? (As in, Cocoa - or is there an alternative - QT/Ogre3d?) And if that is so, would it be easier to simply learn Obj-C and have that as a main language?

And that brings me to my last question, if Obj-C was used for 3D/2D MAC games, what engines are used?

(But mostly: C++ vs. Obj-C for Mac game development?)

Thanks!
Quote this message in a reply
⌘-R in Chief
Posts: 1,256
Joined: 2002.05
Post: #2
I'm surprised nobody else has jumped in yet. I think they're all busy flying out to the Game Developer Conference this week. Smile

C++ is a fine language to choose for game development because of its combination of portability/ubiquity, features, and speed. Choosing Obj-C for instance, it's much more difficult to port your game to a non-Apple platform, though it is possible.

The issue with using C++ as your *first* language, is that it's a deeply complex language. Especially with the most recent version/specification of the language, C++11. There are so many features in the language and a lot of behavior you need to understand when using each of those features, it can easily be overwhelming for a new developer.

So generally, using a simpler language for your introduction is a better choice. What language that should be, is probably even more debated than your final choice.


For a Mac-only case, using Obj-C has a few benefits. Firstly tons of people know it and can help, second if you were to choose something like cocos2d (OneSadCookie is screaming in horror) there are zillions of examples and tutorials that you can follow, but even without cocos2d, iPhone game devs tend to use Obj-C quite often so there's a lot of general support and knowledge there.


As for whether you need to know Obj-C: no. If you use an environment wrapper library like SDL, it handles the platform-specific stuff for you, and you only need to deal with functions in SDL (along with OpenGL, OpenAL, etc as needed).

If you weren't going to use any of these existing libraries, then yes you do need to know a little bit of Obj-C and Cocoa to be able to create the "shell" that the rest of your code runs with in. Basically you simply need to setup a window, an OpenGL context, handle input events, and likely provide a few functions to deal with the file system, such as getting paths into the application bundle's resources folder.

It wouldn't be a bad idea to try to go down the thin-Obj-C-layer + thick-C++-game-code path, but for a beginner it's not trivial. It depends on how much programming experience and understanding you really have. Otherwise, there a bunch of other options available to you (pygame and Unity for example).
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #3
Thank you for a very informative reply!

So, Objective-C is still good to use as a simple 3d/2d game-programming language for Mac only? I just want to use one language for now, not learn multiple at a time.

I will probably just learn and use C++ later when I gain interest in PC games and other platforms Rasp

Thanks again!

Also, quick forums-noob-off-topic-question: Where the heck do I make a sig? I cannot seem to find it! haha
Quote this message in a reply
Moderator
Posts: 698
Joined: 2002.04
Post: #4
(Mar 25, 2013 04:03 PM)easy_e Wrote:  Also, quick forums-noob-off-topic-question: Where the heck do I make a sig?

User CP->Change Signature Wink (Although you might have to have ≥ N posts before you can create a signature - I'm not sure Annoyed)

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #5
(Mar 26, 2013 11:14 AM)sealfin Wrote:  User CP->Change Signature Wink (Although you might have to have ≥ N posts before you can create a signature - I'm not sure Annoyed)

Yep. 10 posts. Thanks.

Back on topic:
A little bit of refining to my last question, although I have been going through the books suggested on here, and researching other ones, they mostly all seem to be for iPhone dev mainly. Do you personally suggest any good books for 3D Objective-C Mac game programming/beginners' introduction to Obj-C?

Thanks again!
Quote this message in a reply
⌘-R in Chief
Posts: 1,256
Joined: 2002.05
Post: #6
There are no books for 3d Obj-C Mac Game Programming. It's too specialized for a single book and too small of a market. Game programming books basically come in two flavors: iPhone and Windows. Outside of those, you're lucky to have any books at all. Wink

The "3d" part is covered by any book that uses OpenGL, the Obj-C/Mac part is covered by a few books on exactly that, and the "game programming" part is pretty universal across platforms.

Just because an OpenGL book is assuming you're using Windows doesn't make it completely useless. You just have to spend a little time figuring out how to replace the Windows-specific bits with Mac bits. The majority of the book is universal.

It really will take mixing and matching and a lot of Googling.
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #7
(Mar 27, 2013 09:59 AM)SethWillits Wrote:  There are no books for 3d Obj-C Mac Game Programming. It's too specialized for a single book and too small of a market. Game programming books basically come in two flavors: iPhone and Windows. Outside of those, you're lucky to have any books at all. Wink

The "3d" part is covered by any book that uses OpenGL, the Obj-C/Mac part is covered by a few books on exactly that, and the "game programming" part is pretty universal across platforms.

Just because an OpenGL book is assuming you're using Windows doesn't make it completely useless. You just have to spend a little time figuring out how to replace the Windows-specific bits with Mac bits. The majority of the book is universal.

It really will take mixing and matching and a lot of Googling.

Alright... Well, I am going to purchase 'Programming in Objective-C' (Would post link but for some reason it's not working). Hopefully it will do the trick!
Quote this message in a reply
Moderator
Posts: 3,573
Joined: 2003.06
Post: #8
As Seth already mentioned, most game programming books nowadays are Windows and iOS, therefore you will practically have to do a little programming on the iOS simulator in Xcode while you are learning. 90% of the skills learned on iOS will cross over to the Mac.

I haven't seen "Programming in Objective-C" but it looks like it will probably work for you.

I understand you aren't interested in iOS right now, but a fantastic resource is the Stanford "Developing Applications for iOS" video series on iTunesU (the winter 2013 version). I can't say enough good things about his teaching style. You need to know at least C first though. The video series covers a lot of ground, and while it is focused on iOS, again, these skills mostly cross over to the Mac as well.

When you are ready to tackle 3D, I would highly recommend Learning OpenGL ES for iOS. While the examples are iOS based, it is primarily about OpenGL, and you'll use nearly the exact same code on the Mac except for the context setup code (note that you'll need to be using Mountain Lion for GLKit compatibility). This book is important because OpenGL has undergone a fairly radical change in the last few years, so almost all of the existing OpenGL resources you find will lead you down the wrong path to get to "modern" OpenGL. Along with this book you can use other OpenGL resources, but follow the book's advice as much as possible.
Quote this message in a reply
Member
Posts: 60
Joined: 2013.03
Post: #9
(Mar 28, 2013 10:42 AM)AnotherJake Wrote:  As Seth already mentioned, most game programming books nowadays are Windows and iOS, therefore you will practically have to do a little programming on the iOS simulator in Xcode while you are learning. 90% of the skills learned on iOS will cross over to the Mac.

I haven't seen "Programming in Objective-C" but it looks like it will probably work for you.

I understand you aren't interested in iOS right now, but a fantastic resource is the Stanford "Developing Applications for iOS" video series on iTunesU (the winter 2013 version). I can't say enough good things about his teaching style. You need to know at least C first though. The video series covers a lot of ground, and while it is focused on iOS, again, these skills mostly cross over to the Mac as well.

When you are ready to tackle 3D, I would highly recommend Learning OpenGL ES for iOS. While the examples are iOS based, it is primarily about OpenGL, and you'll use nearly the exact same code on the Mac except for the context setup code (note that you'll need to be using Mountain Lion for GLKit compatibility). This book is important because OpenGL has undergone a fairly radical change in the last few years, so almost all of the existing OpenGL resources you find will lead you down the wrong path to get to "modern" OpenGL. Along with this book you can use other OpenGL resources, but follow the book's advice as much as possible.

Thank you very much. The Book is Programming in Objective-C by Stephen Kochan (fifth edition). It is actually in the 'books' section on this site Rasp.

Thanks for the book ideas for OpenGL. I will purchase those whenever I learn the basics using this book. Which reminds me, I highly suggest Programming in Objective-C by Kochan for any beginner. It is amazing, and includes Cocoa overviews and is a book for absolute beginners (such as myself).

Thanks again to the both of you.

Edit: I have been reading the book I purchased, and from what I gather in order to learn how to program and design games the books needed in order are an Obj-C book, a Cocoa book, and then an OpenGL book. Does that sound about right? Thanks again.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Cocoa Game Programming Workshop jeonghyunhan 5 6,024 Mar 20, 2009 08:40 PM
Last Post: SethWillits
  Starting a 2D game programming. How? andrern2000 4 4,823 Dec 19, 2007 05:34 PM
Last Post: BinarySpike
  Game programming resources for Java JeroMiya 3 3,933 Sep 28, 2007 04:06 PM
Last Post: JavaGuru
  "Beginning Game Programming" - game engine skrew 5 5,795 May 15, 2006 03:52 AM
Last Post: MattDiamond
  J2ME game programming library and book Leisure Suit Lurie 4 4,982 Jul 18, 2005 12:17 PM
Last Post: codemattic