Beginner path to Game Development for OS X and iPhone - iphone

Another question. I have been researching everything this wonderful community has offered me in terms of my journey to pursue game development.
I have come to the conclusion that I would prefer to develop on my native machine, OS X - eventually leading to the iPhone.
I already own both Big Nerd Ranch guide's, Iphone Programming - the Big Nerd Ranch Guide and Learn to Program on Mac OS X - the big Nerd Ranch Guide.
My goal that I am trying to shoot for is a game similar to Blizzard's Diablo II.
When going through these books, everything seemed a bit over my head due to lack of Objective-C experience (so I suspect).
What it the best beginner friendly way for me to reach my goals? I have been looking at Objective-C books for beginners from Apress and the like, or straight C books.
How would experienced developers such as yourself guide a newbie through this path?
Regards
edit -
To answer why I have picked the apple route, it just looks to be the most comfortable (environment is native to the machine). I may be very wrong though. I was looking at Unity, it supports C#, JavaScript and Boo. Others like Panda3D use Python. I am just not sure, it seems like the decision process has become rather challenging.

It depends on the kind of game you're making - but many of the top games on iPhone were created with an open-source framework called cocos2d. It is fabulous, simplifies everything, has great tutorials and is available specifically for the iPhone.
Check it out at:
http://www.cocos2d-iphone.org/

I would recommend you
a) learn the basics of C (especially memory management)
b) learn the basics of Objective-C
c) learn the iPhone SDK from a book (I liked "Beginning iPhone Development" and its 2nd volume)
d) pick any project you find interesting and that is not too challenging and just code. You will find that by the time you are done, you probably think the things you did first are horrible, but you will learn a lot in the process
e) visit Stackoverflow.com as often at possible, it has most of the answers to the questions you will have :)

If you're working on a Mac, then things get interesting.
The largest game markets by several orders of magnitude are consoles and Windows. If you're just targeting the iPhone and OSX, the Mac is ideal for development. However, this is a limited (Mac OS), VERY competitive (iPhone) market. If you want to make something that will become a real product with real sales, limiting yourself to OSX from the starting gate is probably a mistake.
If you're just starting out and want to learn what makes all this game crap tick, stick with the language and OS that you're most comfortable with. Introducing too many variables into a learning expedition is a significant ingredient in failure. One of the nice things about this sort of app is that the algorithms and techniques you'll pick up are inherently cross-platform. Matrices are matrices, whether you're working on a TI-89 or an Alienware desktop.
However, if this is the case, try and remain aware of what platform-specific widgets you're using in your code. Plan to throw this one away. Write a bunch of test apps. And, when you feel confident that you're ready to build something real, you'll be ready to break out a VM or a new desktop with Windows (I LOVE XNA), C++ with DirectX or OpenGL, or whatever, and the variables, the new material you have to learn, won't be about graphics or math or gameplay, but about the platform itself.
Writing "Hello, World!" is a lot easier if you're not figuring out what you're trying to say, but only how to say it.
Also, rather than aiming for a Blizzard clone, start with something dirt simple, like Pong. Then make 3D Pong. Then add gravity. Then collision detection. And so on.
Also check out gamedev.stackexchange.com when you have game dev-specific questions. It's a LOT lower-traffic than SO, and a lot of the participants are teenage fanboys, but there is good knowledge there ready to be tapped.

You can develop a small game for the iPhone quite quickly once you've mastered Objective C and the iOS APIs. It took me about 4 weeks to develop a small iPhone-only game with limited game logic. Here's a writeup of my experiences:
http://corrino-software.com/how_long_does_it_take_to_make_an_iphone_game
However, something like a Diablo-style game would be a massive project. As David says, you're better off starting with something smaller and more managable to begin with, then you can move up to larger projects once you're comfortable with the development process and familiar with the tools and libraries you'll need.

If I were you, I'd start out with C, learn the fundamentals of programming, algorithms, and memory allocation (incredibly important concept in C). Then, you can move up to reading some books on Objective-C and get an idea for object-oriented programming and higher-level concepts like dynamic typing, garbage collection, etc.
As for software, if you're on OS X you want to get XCode, which is an integrated development environment developed by Apple for developing for iOS and OS X. Apparently, it's a free download (though that's just what Apple says on their website, dunno, I don't have a Mac).
As for books, etc. I'd just get some straight C books and look at some tutorials. Read them from cover to cover, and pay special attention to the important (and frustrating) concepts of memory allocation and management and pointers.

I find that a good way to learn a new language is to start with replicating common command-line tools like wc, grep, ls, etc. This will teach you the basics of I/O (both file and stdin/stdout) and some basic string parsing, as well as other goodies here and there. Additionally, you have a deterministic method of determining whether your program does it right or not, since you can easily compare to the standard command's output or behavior.
K&R, as well as Programming in Objective-C 2.0, are good places to learn the basics of C and Objective-C.
Once you have the basics of the language down, start with basic GUI programs (the ones in Hillegass's book are a good start). Once you can hook a basic GUI on the front of some underlying logic, it's time to start thinking more seriously about your game. Hillegass's book has a basic intro to using NSOpenGLView, which you can use to manually draw in 2D and 3D. It's important to note that when going through the examples in any book, you'll want to thoroughly understand what they're doing and how they're doing it, enough so that you can make some modifications yourself to enhance/change the behavior of the sample program you're working with.
Once you understand the basics of how your underlying game logic can hook to something the user can see, it's time to go find a game/drawing library that will get you where you're going. You definitely don't want to write all of the graphics routines yourself for a game similar to Diablo.

Related

Beginner's Language app

Hi I'm a techie with no programing experience. I know html and css, but I'd like to someday be able to make an app for my phone (I have an android) and possibly mobile websites.
I made learning a programing language and creating a mobile app a goal for my job, and now my boss would like me to pick a programing language to learn. I found a free open course from MIT (http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/) called introduction to computer science. In the course they teach python, but more importantly it seems they teach how to think like a programmer.
When I told my boss about the free online course she didn't think that Python was an appropriate language for me to learn. She'd like me to learn a language that is more similar to one used to make Phone apps. Does anyone out there know a better language for me to pick up that would be similar to Android or iPhone's App language.
Thank you
A few things stood out to me as your goals:
You want formal training on how to program (this is independent of a language)
You want to learn how to develop apps for a mobile device
Your boss is on board with goals 1 and 2, but wants to see the best return on her investment.
I think the easiest way for you to meet all of these goals is to start learning how to program with Java. Java is often used in introductory computer science courses, so you should be able to learn the language and programming concepts in parallel. Once you have that foundation, you will be able to start learning Android development, since Android applications are built with the Java language.
You can start off by reading some of the resources from Oracle: http://download.oracle.com/javase/tutorial/java/concepts/index.html
And there are plenty of good intro books too:
Thinking In Java by Bruce Eckel
Head First Java
There is nothing wrong with starting off by learning Python. Once you have a good grasp of programming fundamentals, you can learn new languages relatively quickly. However, from your boss's perspective, there is more value in paying for you to learn a language for mobile development and programming at the same time.
Learn to program first before learning how to develop for the iPhone. That will give you a much better chance at success. Python a perfectly good language for learning to program, especially in the context of an Intro to CS course environment. But any intro programming language environment will do (even one designed for kids).
Once you're comfortable writing non-trivial programs in Python (or whatever first computer language you choose), learning Objective C and the iOS APIs (or Java and the Android APIs) will become much much easier, compared with starting from scratch and zero programming background.
Python is a good beginning language, but you need to ensure that you do more than just course work.
Why not just run through tutorials on Android development right off the bat? If you are worried about wasting time by not using Java immediately, then why not just start there?
Android uses Java, and iPhone uses Objective C.
If you need a quick solution, try learning Java and using a framework like NimbleKit for iPhone, which lets you build your app out of HTML/CSS + Javascript.
http://www.nimblekit.com
If time is short and you need results to motivate you I would suggest this O'Reilly e-book (http://ofps.oreilly.com/titles/9781449383268/) that is tailored to a reader with HTML, CSS, and Javascript (jQuery) skillset. Alternatively, the App Inventor (http://appinventor.googlelabs.com/about/index.html) also looks like a perfect way for you to dive in and explore; it is designed to be non-programmer friendly.
After you have some quick success, you might then be interested implementing some feature that is not readily supported by these two environments. Then I agree that the traditional approach in taking a course and learning a language would be a good long term investment.

How hard is iPhone/iPad development

I've been developing for quite a while but while I consider myself competent (or better) with C++, Java, C# & AS3/Flex in areas from web-servers to desktop applications to 3D games, I'm aware all these languages are pretty similar; even on the libraries side I know what to look for based on using libraries that do similar things in another language.
But Objective C I understand to be a different kettle of fish, and developing for mobile devices has always struck me as likely to be hard work since you have to develop on your PC and test on the actual device itself - my experience developing for PS2 put me off such things due to poor debuggers and other tools.
What's the reality? Is it a paradigm shift to move from web-servers and desktop apps and rich web-clients to iPhone... or for an experienced developer is it just another language to learn and new libraries to play with? Is there anything to be scared about at all?
edit: My main question on Obj-C specifically was if it's a different way of programming, like it would be moving to Haskell from Java for instance. It sounds this is not the case.
For starters, ObjC is fairly easy to grasp so long as you focus on the fundamentals. Don't worry about the syntax, there's not much there above C which I will presume you already are familiar with. There are excellent books out there this book is the definitive guide I recommend to most new users, Erica Sadun also has a good book on iPhone development, I recommend both of these highly.
Secondly, the tools aren't hard to use, and you will be pleasantly surprised with the debugger and other tool integration. Instruments was a long time coming, but it's indispensable for catching things like memory leaks, cpu time usage, and now power consumption.
But really, nothing to be scared about, and as for another platform to learn; well, yes and no. There is always going to be another thing to learn, regardless of iPhone or something else. Don't resist. :)
There's definitely a "paradigm shift" (ugh, buzzwords):
You don't have all the memory in the world (and there's no swap either)
You don't have all the CPU time in the world
You probably don't want a binary bigger than about 20 MB (the size that can be downloaded over the cell network)
You can't just change the server backend to make things right.
Graphic design is important if you want to be successful (but you don't want to bloat your app)
Web requests take a while (a website with redirects feels really slow compared to the desktop beside it).
JavaScript animations are painfully slow (ever tried the Google Maps website on an iPhone?)
UI design is heavily constrained by the size of the user's finger (even though the iPhone 4 has a comparatively huge screen).
UI design is really tedious.
The user can do more things than clicking and typing.
I find that the biggest difference is in the UI, not in the language. Languages are easy. Libraries require a little reading/searching/asking around, but then they're easy. UI design and UI programming are very difficult to do well.
Objective C is different but not far removed from normal OO methods. The syntax was the larger barrier for me.
The problem I saw was/is you learn ObjC for iPhone, and you can't take the skill (ObjC knowledge) outside the Applesphere really. I haven't seen a use for it. I have a handful of books I went through to get my feet wet. Some of these, the Apress books, contained errors in the code walkthroughs causing me to Google the book errata countless times.. so be careful of that, if you learn that way.
Also, unless this has changed, you can only develop under OSX with the SDK tools because no Windows version exists to my knowledge.
With that, you also have to play by Apples development rules to get published into the AppStore, which has had its share of dev horror stories.
That said, a working app is fun and beautiful in the end.
On a scale of 1 to 10, it's about a 6.
Apple does use Objective C and it is different then normal C. So Iphone and IPad development can be hard if you've never used Objective-C before. If you are familiar at all with a language called SmallTalk, then Objective-C will be very easy for you to pick up.
Now other mobile devices, such as Android, uses Java. If you are competent in Java then Android development may be easier for you.
Some devices use Windows Mobile. If you are a .NET programmer, you can use .NET compact framework to develop Windows Mobile Apps.
Just so you know too, most mobile SDKs come with an emulator to test your app on. So if you don't have an iPhone, for example, you can still test your app with the emulator. I understand that the emulator is supposed to be 99% as accurate as an actual device
I don't think there's anything to be scared of.
The simulator's pretty alright, even if it can't handle some things - it's hard to simulate the accelerometer, for instance!
Once you're over the hurdle of figuring out what certs you need and setting up the iPhone development account and such, it's fine.
It's a bit of a pain writing something, loading it on the device, trying it out, etc., but the fact that you can actually debug the code running on the device makes it rather a lot nicer than it could be. (I had to maintain an application for the Nokia 9110, and there I had to edit, compile, load, run, crash blindly, stare at code, guess, edit, compile, etc.)
As a long time Windows C++ / .NET developer, I didn't find it very difficult to begin developing in Objective C.
There are some syntax differences that take some getting used to, but in general it similar enough to C/C++ to not feel like a completely new language.
Learning the library code and what you can and can't do easily seems like the larger challenge to me, which is going to be a challenge with any new platform.
I am writing a beginner book called Hello! iPhone, and I've made a mailing list of beginner tips to help people get started. After a week or so of tips, you'll be much more equipped to check out other books and understand the basics a bit better to judge.
http://loufranco.com/beginner-iphone-programming-tips/
It will take you through Hello, World and some other simple stuff (Outlets and Actions, basic memory management, etc).

Time to learn Objective-C/Cocoa for an Apple agnostic [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
This question is inevitably subjective, but I will ask anyway.
I'm a PC. I've always been a PC. I have very little Apple expertise, although I'm completely happy in *nix. I've plenty of experience with development, and consider that I am able to pick up new languages and concepts faster than most of my colleagues (although ML/F# still hurts me on a regular basis). I'm reasonably familiar with C++, although haven't touched it since the nineties, work on a daily basis, and 100% confident with C#, would consider myself advanced to expert with Java and have developed a reasonable amount of stuff in Lisp and Prolog back in the day.
We've had a recent request to develop an iPhone app, which sounds like quite an interesting proposition that we'd be quite interested in taking on. We have very little in-house experience with Apple platforms. Given our ignorance of most things Apple, little to no familiarity with OSX and the Apple UI paradigms and assuming we acquire the necessary hardware for development:
What one would need to learn?
How long would a good developer need to get up to speed?
Are there any non-obvious expenses that might arise from pursuing this route?
Once again, apologies for the subjective nature of this question. Many thanks.
It took me a couple months to feel comfortable with it; but that was only evenings/weekends. I came from a PC/VC background and had never owned a Mac.
Objective-C is OK, if a little unusual. There are the usual gotchas that you learn once and then don't do again. IMHO its easier to shoot yourself in the foot than C++, but it's not a big deal to switch. I think the bigger learning curve is XCode; it's certainly not a patch on Visual Studio, and can take a bit of getting your head around. That said, it is getting better with each release. One of the things that bugs me the most is the Mac keyboard vs the PC keyboard - particularly in the IDE - I keep jumping to the end of the file instead of the end of the line, etc. And then going back to PC you find save, etc. isn't the same key combination. It can get quite confusing.
The Mac & OS X is a breath of fresh air - wish I'd got one sooner. I bought an iMac 24 to get plenty of screen space. It's a lovely machine.
For Cocoa, I took the slightly unusual approach of starting with a Mac app before doing a phone app. I used the book 'Cocoa Programming for Max OS X' which gave me a good grounding. I then moved onto 'Beginning iPhone Development'. I think this approach worked well for me because the Mac OS is the bigger picture, and the iphone is a subset - it helped me get context on how things had been put together. I also bought several books on linux, mac internals, etc...whatever I needed to fill the gaps in my knowledge. I found I needed to get pretty comfortable with the Terminal, and read a book on the bash shell, and polished up my 'vim' usage. I also discovered 'git' along the way and haven't looked back.
For the phone itself, you really need a device, not just simulator; I've found several problems where the simulator didn't match the device (particularly if you intend to use OpenGL ES) - for that reason I'm going to test on iphone 3G/3GS & touch. Credit where it is due; all the differences I've found were problems in my code which needed repairing to make it look the same on simulator vs device. If you've done any device programming, it's probably the best device programming platform you've ever used - easy and stable, with good debugging.
I'd say the cost is one Mac + 2 iphones + ipod touch, and $200 worth of books... Haven't found any hidden costs...
There are a lot of questions here about getting started with Cocoa on the iPhone and Mac, listing many great resources:
"Getting Started With iPhone Development"
"Starting iPhone Development"
"Howto articles for iPhone development, Objective C"
"Are you doing iPhone development? How do you learn?"
"Best Cocoa/Mac OS X programming blogs?"
"Cocoa and Objective-C resources?"
"Good ways to Learn Cocoa?"
"Can anyone recommend a complete ObjC/Cocoa or Cocoa-Touch tutorial?"
"What are some of the best online resources for learning Objective-C?"
"Are there any Open-source iPhone applications around?"
From my own personal experience, it took me six months before I felt comfortable with Cocoa, but that was years ago when I was only tinkering with it part-time. Since then, we've moved all of our robotic control software to Cocoa and the Mac, so it's what I now do full-time. Adjusting to the iPhone was a pretty quick process, taking me three weeks of nights and weekends to produce my first application, which has been on the App Store since launch.
In addition to all the resources in the questions listed above, I highly recommend reading Apple's iPhone Human Interface Guidelines cover-to-cover. They don't provide hard-and-fast rules, but they do explain the overall UI design of the platform and the reasons behind why things are done the way they are. Also, make sure that you use the device yourself on a regular basis, so that you understand what does and does not work when interacting with the platform.
As a final resource, I also recommend paying the $299 for the WWDC 2009 iPhone Session Videos. They are well worth the money, particularly if you are just getting started on the platform.
Beyond the cost of an entry-level Mac (the Mini is a good choice, but the 13" MacBook Pros are a great value and can run Windows well), the $99 / year membership in the developer program (which you don't even need to pay until you want to install the application on a device or distribute it), and the cost of the books or videos listed above, the only hidden cost to worry about is time. I've spent a lot more time tinkering with the iPhone platform than I imagined I would when I started over a year ago.
The Cocoa-Touch framework is a cut down version of the full cocoa framework, so fortunately, this makes things a lot simpler to learn as there are fewer ways to do things, so not so many choices and design decisions.
You require an Intel Mac to develop on, and would also need an ADC membership to publish the application. Other than this and test devices (iPhone and iPod Touch). This should be all of the require expenses. You could use only the Simulator to develop, but I would recommend on device development as well.
There are some good online videos in iTunes. I found the Stanford University iPhone Developer Course particularly useful.
A good developer could probably be up to speed in under a month. Especially if you have C/C++ skills, along with your other skills I would expect you to be productive in under a month.
The Apple docs are not the most forthcoming, but are quite complete. You could learn everything just from these.
Good Luck
I came from a heavy Java background, with lighter amounts of C++ and also some Lisp/Scheme as you have - I've been doing iPhone application development full time since the SDK release. Here are some thoughts I have on the questions you raised.
What one would need to learn?
You need to learn Objective-C, the language - a helpful guide showing you comparatively how things are done in C++ (and some Java) compared to Objective-C is:
http://ktd.club.fr/programmation/fichiers/cpp-objc-en.pdf
I found that very handy in quickly understanding the Objective-C syntax, since it's not a large divergence from C syntactically but is more so conceptually.
Beyond that, just like Java Apple's Objective-C has a very large set of foundation classes you can work with - just as rich in terms on string handling, internationalization, complex time/date support, etc. Just like Java, that will take some time to get used to - but knowing the Java libraries, a number of things are conceptually similar. The GUI classes are also extensive and pretty powerful, as are some of the other frameworks like CoreData and CoreAnimation. Happily I find the documentation very good, it's well integrated with XCode and even has sample code links in the docs.
Also, the GUI development tool Interface Builder is very good to work with. I never found GUI builder tools of much use in the Java world (or really in any other world) but the model that Objective-C uses where you basically are creating objects that get wired up at runtime to your code, works really well and does enhance productivity. It's good to know how to do some things manually to understand what is build built by the components you are adding, but I'd start learning how to use Interface Builder when possible, early on.
I also highly recommend the O'Reilly safari online book service, because you can hunt down a few books that are of use and search for extended examples on something you are having trouble with for a marginal monthly fee. You can get the widely read Hillegass book there, among others.
How long would a good developer need to get up to speed?
That's tricky to say, because it depends on just what kind of app you are trying to build. Some areas of the frameworks and GUI components are easier to understand than others. But, I would say probably a month or two of full-time working with it would yield a pretty decent level of familiarity, and you would be productive before then. Someone with a good background in a variety of languages will have an easier time I think. Also it pays to really learn the ins and outs of XCode, because it's a very powerful tool but at first may not seem that way depending on what IDE's you are used to.
One thought is that you may way to go to a training session somewhere. There's actually an in-depth iPhone conference in Denver just a week from this post date, 360iDev:
http://www.360idev.com/
(Disclaimer, I am a speaker at a few of the session there)
Although if you do not yet even have a Mac, It may be a little too soon for that to be of full use. You could check around for other such conferences, or other places that offer training.
Are there any non-obvious expenses that might arise from pursuing this route?
Financially? Not really. You can use pretty much any modern Intel Mac to develop with and it will work great, with the caveat you should have 2GB of RAM.
You'll need a device, but if you are not using features found on the phone a Touch is fine to develop against for all platforms so you could avoid a recurring fee if you do not need one.
Time-wise, as noted there are a large set of foundation classes and so that takes some getting used to. But one good thing about the mac as a platform is that while it differs from windows, it has a good Terminal app so you can be productive in a standard UNIX shell with all the UNIX tools you are used to having. You can even do command line builds although realistically you end up working pretty much all the time in XCode (though I admit to breaking out to Emacs on occasion when I need to do some tricky bit of editing better suited to Emacs' abilities).

2D Lua Games on iPhone

Are there any libraries / frameworks that facilitate 2D game programming in Lua on the iPhone?
It looks like http://anscamobile.com/ and http://sio2interactive.com/GAMES.html are the only reasonable options at this point. Someone should create a simple Lua binding for OpenGL, AL and iPhone Events for the iPhone!
#richcollins: Actually, as of late last year you CAN test on the physical device using Corona (anscamobile.com).
If you want to check this out, download the free trial at developer.anscamobile.com, and it'll let you make developer builds for your phone.
The full version will also make App Store builds -- feel free to email support (at) anscamobile.com if you have further questions.
I'm trying out SIO2 as it apparently supports lua.
http://sio2interactive.com/GAMES.html
While it is for 3D and may be overkill for 2d it looks pretty powerful. Just make your models in 2d and fix your camera position.
--jdkoftinoff
There has been a fair amount of discussion of Lua on the iPhone on the Lua list. It appears that Apple is touchy about allowing user-supplied scripts, but has approved apps that used Lua internally as an implementation language.
I know I've seen reference to several approaches to wrapping iPhone goodies mentioned, but since I'm not personally an iPhone developer (or even user) I haven't paid attention to the details.

Quickest way to get started with OS X app development?

I need to build an application which will run on OS X, polling for data, and displaying that data full-screen in a purty, graphical way - generally "identifier: value" text in some sort of tabular format, but possibly with spark-lines to display historical changes, and "animations" (nothing fancy, just fading text and similar) to show updates.
However, I've no idea where to get started. I've no experience with desktop application development or development on a mac.
Where/at what should I be looking for OS X development information which will get me quickly up-to-speed (coming from a web-dev background)?
For OS X development, and a really nice overview that will get you writing actual applications quickly, I'm not sure anything can match Aaron Hillegass' book, Cocoa Programming for Mac OS X.
It's considered by many to be the Bible of Cocoa programming, and it is example driven. You are writing applications that you can actually run throughout.
It is useful, although not as much so, for iPhone development, which you don't mention in your question, but you do in your tags.
If you really want to go native with OS X that will mostly mean learning Objective-C and Cocoa. You get started by becoming an Apple Developer Connection (ADC) member and downloading XCode. Inside the ADC site there is a lot of information that will help you get started, Objective C reference, sample code, etc. .
Depending on your background you might want to consider using Adobe Air for your application, if you know Flex or Flash that might be easier for you to learn.
There are also a couple of question already up on stackoverflow on this subject https://stackoverflow.com/search?q=learn+cocoa
Take a look at http://www.realsoftware.com. It's a cross platform development environment. Easy to learn, established user community, lot's of sample, shared code to get you started.