Program Languages 202

Discussion in 'Mac Programming' started by MstrPBK, Sep 30, 2008.

  1. MstrPBK macrumors newbie

    MstrPBK

    Joined:
    Jun 20, 2008
    Location:
    St. Paul, MN
    #1
    In THREAD: Program Languages 101 we talked about which languages I ought to learn so that I might be able to do much of the work on a RPG game (doubts I can do the work of 8 people). The community settled on the following "languages" for me to try to learn:


    • [*]C language
      [*]Objective C
      [*]Open GL (API generator)
      [*]Python
    In this THREAD Program Languages 202 I ask the next obvious question ... Which books would this community suggest to for me to learn these from? True most book stores have a decent selection of books, but sometimes a good glance at a books description does not always lead you to the book you need to find.

    To remind the group I do have foundational lessons in 1970's BASIC Language and the scripting language of FileMaker Pro and Advanced.

    Peter Kelley
    St. Paul, MN
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Our course text at Uni for C was A Book On C. I used it to learn having only a small amount of Pascal and quite a bit of Basic experience...
     
  3. mobilehaathi macrumors G3

    mobilehaathi

    Joined:
    Aug 19, 2008
    Location:
    The Anthropocene
    #3
    I'm sorry I don't remember what I used for C/C++, but I recently picked up Cocoa Programming for Mac OSX. It has been good for me to start learning ObjC and GUI construction, since I do entirely C/C++ terminal apps. I don't know any OpenGL, but the red book is apparently the OpenGL bible. I imagine its fairly advanced and assumes a strong foundation in C/C++. I'm a big fan of O'Reilly, and I learned python from Learning Python and Programming Python.
     
  4. skinnybeans macrumors newbie

    Joined:
    Dec 6, 2007
    #4
    have a look at http://www.gamedev.net/

    Near the top of the page there is a Resources menu, under that there is a Beginners link and a Books link. When I was new to game programming this is one place where I looked for resources.
     
  5. Heath macrumors regular

    Joined:
    Aug 19, 2005
    Location:
    Canada
    #5
    And of course one of my favorite websites.
    http://freecomputerbooks.com/ which has all sorts of publicly available computer books which will include programming language books.
     
  6. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #6
    My public library has a woefully out of date selection of computer books, but it does have both volumes of "C for Dummies." Fairly breezy reads. If you have some programming basics, you can skim through these books fairly quickly, lingering on the parts you need to spend more time on.

    The books assume you're using either a DOS or Windows based C compiler. Macs are never mentioned. But you get an introduction to most of the concepts you need to know.

    mt

    Heath -> That's an unbelievable web site. I've never seen it before. Thanks for posting it.
     
  7. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #7
    For C, I actually read the K&R book. The langues itself is very simple. You can cover it in 20 pages. It's all those hundreds of API calls that take forever to learn and each programming environment has a different set

    For OpenGL. First yu need to understand the basics. There is a bit of math involved and some grapic theory. This is universal. Things like how to construct a linear transform as a matrix. Basic linear algabra. The code for an FPS is going to have just tons and tons of coordinate transforms. THes will be expressed a matrixes and the number you stuff into those matrixes will be the result of some physics models. Study up on basic mechanics (Newtonian Physics) and Linear Algabra. After that just keep a copy of the Red Book at your desk

    You are going to need a "Physics Engine" this is what drives those wire frames that you use OpenGL to render. Your game logic drives the physics engine. Look here for more info. http://en.wikipedia.org/wiki/Physics_engine
    Of the engines lists above I like ODE.

    Next you need to learn about threads and concurrent programming. For CS students, most of the theory is covered in Operating Systems classes. Look for texts the cover the basic theory of OSes. You can start by reading the pTreads man pages but without knowing the theory you'd be wondering why you might want a "semaphore" or "protected section" and so on.

    IN the real worls almost nobody knows all of this and that is why these games are built by teams. But you could lay out the design and then over months and year flush out the parts. Just be sure and remember that any modern design will be multi-threaded. But how far to cary this? Is there one thread par simulated actor? or just one for the physics engine, user input and rendering?
     
  8. MstrPBK thread starter macrumors newbie

    MstrPBK

    Joined:
    Jun 20, 2008
    Location:
    St. Paul, MN
    #8
    In this post I am not trying to be offensive but rather funny. If I offend anyone my apologies ahead of time.

    I think the following character said [Lucy Van Pelt: (character from the Peanuts Comic Strip by Charles Schultz)] and it summarizes the comment even better I think:
    "God put me on this planet to do so many things; AND at the rate I am going I will never die."​
    Your right ChrisA a project like this takes team work. In my last post from Programming Languages 101 (the thread preceding this) I acknowledged that fact, and skim the top of just how complex a project like this can become. And I am sure that many of you with more experience can point to that list and add to it, or even rip it to pieces.

    Readers of this thread may want to go back to Programming Languages 101 again and look for my post talking about my limitations in life; before reading further.

    More to the point of this thread topic: You as programmers would say to me: "Oh those are nice databases." If I just brought with me the databases but IF I brought to you the databases and a little of the code development you might be more tempted to say: "Umm interesting; have you thought getting a little help with this?"

    I can not inspire others if I have not proven myself. Learning what I can I only hope that at some point will inspire someone to think it is time for someone to help him move this faster. For now I can only do what I can and that is to demonstrate I am very serious about this project.

    Respectfully Submitted,
    Peter Kelley
    St. Paul, MN
     
  9. perrien macrumors newbie

    Joined:
    Apr 26, 2008
    #9
    Language books

    While I can't comment on Python (haven't looked into it at all) I've been teaching myself how to program for the last 5 months or so and am currently able to build fairly simple models in OpenGL, light them, use the mouse to move them around and such, use GUI sliders and text fields to affect the drawing and of course all the general GUI stuff (handling buttons, menus, windows, text fields, tables, blah blah blah). The reason I say this is to give you an idea of the time frame you may be looking at.

    That being said, here's the route I took and it's worked out well for me. I didn't bother with getting a book on C, as others have noted it's fairly simply. I went to <http://www.howstuffworks.com/c.htm> and ran through the first 25 or so sections and then skimmed the rest. All my coding was done in TextEdit (get BBEdit or something similar, they're a big help) and was compiled and run from Terminal. I'd suggest avoiding Xcode for the moment.

    After I was fairly comfortable with the basics of C I picked up Programming in Objective-C by Kochan and went through the whole thing. EXCELLENT book, very highly recommended. From that you'll learn the Objective C part of C and how to use the foundation in OS X (NSString, NSArray and so on). I was still in BBEdit and Terminal at this point but at the end of the book I could write command line tools, read and write out to files, etc.

    Then I picked up Cocoa Programming for Mac OS X by Hillegass and things slowed way down. Everything in Kochan's book was very thoroughly explained so it was easy to read a chapter, run through the examples and have a pretty firm grip on what was being taught. Hillegass (my opinion) is not like that. He'll introduce a topic, give a very cursory explanation, give the code for the program and then move on. I rarely felt as if I was comfortable with anything by just reading the chapter. I had to read the chapter a couple times, read over the Apple documentation for it and then write several small programs to make sure I really knew what was going on. By the end of the book I was using the book pretty much as a reference as to where to go next in the Apple documentation. For instance, when I got to chapter 17 on custom views, I skimmed that chapter only and then went to the Apple documentation to really explain it all. His book taught me to know ane love the Apple documentation. It's with this book that you'll finally crack open Xcode and Interface builder and begin using that.

    My final stop (so far) is the OpenGL Superbible (4th edition). With OpenGL I went back to Terminal and BBEdit because Cocoa and Xcode do things in different ways and I couldn't figure them out. I spent the first few chapters of the OpenGL book in Terminal. Once I had a small working animation (built a simple solar system with lighting and such) I took a couple days off and figured out how to "port" it from C++ in Terminal to Objective-C in Xcode. I'm currently going back and forth, usually trying something first in Terminal to keep it as simple as possible, then moving it over to Xcode.

    So that's where I'm at. Again, I'd skip the C book unless the web site listed above and some other easily Googlable C tutorials are not enough. Also don't try and rush over to Xcode and the GUI. Get comfortable with Objective-C in the Terminal first. Learning to program is NOT easy and it's going to take some real time and dedication but I've very much enjoyed it. Feel free to get in touch with me directly if you have any questions.
     

Share This Page