Objective-C Game Programming [closed] - iphone

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
i'm starting game programming (for iPhone) and i'm would love to know more about it.
From what i seen i can choose 3 different ways:
1) Lua on Kobold 2D
2) Cocos 2d
3) Basic UIKit
Which ones are the real differences? For the ones that already have tried them, why should i pick one technique instead of another?
Do you know witch style was picked same the most game like: Angry Birds, Fruit Ninja, Ruzzle, Draw Something, Candy Crush, Words whit friends, Temple Run, Four pic one word, Song Pop, Fun run, and so on.
Are there any other ways to programming game to iPhone? Such as other Kit or API that i didn't mention?
Thank's

Cocos2D is a proper 2D game engine. You can find so many tutorial sources on the net. you can also use cocos2D with box2d or chipmunk physics engine if you need physics simulations or accurate collisions in game world. Beware though there are 2 versions of cocos2D one that uses openglES 1.0 ; which is used for older ios devices and the one that uses openGL ES 2.0; which has a support for shaders. Also there is a flavour of Cocos2D called Cocos2D-x which is written with c++. so if you planning for cross plaltform go for Cocos2D-x. be warned though cocos2D-x doesn't have as much tutorial as the Cocos2D.
Kobold 2d is actually suppose to be extended and improved version of cocos2d that acts as a wrapper arouund cocos2D, so that creating games are a bit more simpler compare to creating in cocos2D. However this is more likely based on personal view of the author of the Kobold2D. Personally I haven't tried it but I believe its going to cause more headache to me then it would help or more likely it will limit me down since I already started grasping the idea of developing games. Also there is less amount of tutorials on the web for Kobold2.
Basic UIKIT. erm... this is the hardest choice you can make. UIKIT is composed of OPENGL ES and QuartzCore framework and uses these to draw the your game on the scene. So its not a game engine. if you are going for UIKIT you will be reinventing lots of things from scratch. rendering textures, managing your scenes, handling your sprites, and resources.
Obviously rendering is not the only thing the game does. if you going for UIKIT you also have to find solutions for collisions "such as when a paddle hits a ball" and user interactions "such as how player controlls the game with touch screen". So my suggestion is keep away from UIKIT and start with Cocos2D. it will make the life simple enough to get you going yet complex enough to let you have freedom and think.

lua is a different programming language than objective-c, but you can use it in objective-c with the Wax api.
Kobold2d is an extended version of cocos2d, but i haven't tried so can't say much.
cocos it's like a wrapper that help you drawing lines, using collisions etc.
unity it's most used with 3d games
open gl it's more raw and you have to customize everything, it's more powerful but it require way more work
all of them are pretty much just wrapper frameworks that help you writing games because they include different functions that you normally would write on ur own. unity it's usually chosed for 3d games, open gl for bigger project but will require way more work. if you want to do a simple 2d games the real choice is between lua( throught wax api ), kobold and cocos.
personally i prefer kobold, because it's still objective-c ( lua uses it only with wax ) but still has many helpful functions and uses arc ( which cocos doesn't ) but try to see if other programmers give you different advices.
i don't know which is best to chose but i know that Angry birds is done with Lua ( which is a cross-platform programming language )
read more on this link
http://www.learn-cocos2d.com/2011/08/comparison-lua-scripting-corona-sdk-wax-kobold2d/
http://www.kobold2d.com/display/KKSITE/_Kobold2D+vs+Cocos2D+Comparison+Chart

Related

What is required to develop iPhone games? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm new in iPhone programming but I have a good grounding in Java and I'm starting to understand how Objective-C works.
I'd like to start developing iOs games.
Do I need to study Open-GL?
Even for 2D games (like Angry Birds, Cut The Rope, Doodle Jump or Tiny Wings)?
What do I need to learn to switch from simple UI apps (with buttons, sliders, labels etc.) to real games?
First off, you need a developer account with Apple to publish games on the iPhone app store.
Second, you probably aren't going to be using Objective-C all that much for games programming. Its runtime binding just doesn't compare to the speed of C or C++ method calls.
For any cross-platform game development (probably iPhone + Android) you will need OpenGL. OpenGL also happens to be the only way to make hardware-accelerated 3D games on either of these platforms.
My recommendation would be to learn OpenGL for iPhone games development. This has the added advantage of allowing you to write games for most other mobile platforms as well with minimal additional learning.
You could of course use Apple's own 2D APIs for game development, but I wouldn't recommend it for the reasons previously stated.
Games programming is an entirely different animal from applications development. I'd suggest starting simple.
Happy games programming! Its my favorite development field.
Edit: I realized I made OpenGL seem as if it is exclusively used for 2D games development, which isn't true at all. OpenGL is well-suited to 2D as well as 3D games development, although the majority of its material is focused on 3D programming. 2D programming with OpenGL is effectively setting the Z coordinate to 0.
if your interested in making 3D games, check out Unity3D for iOS
http://unity3d.com/support/documentation/Manual/iphone-basic.html
Angry Birds was developed around the Box2D engine
http://www.box2d.org/features.html
.. and anecdotal wise the game developers didn't give the engine makers credit. (so don't make the same mistake when developing your game! :)
You don't need to know OpenGL at all. There are some really nice engine options, such as my company's BatteryTech Engine which you simply say what you want to draw and where you want to draw it, what sound to play, etc in Lua (which is super easy) and you also deploy on Android and others. There are a bunch of other options too but this is the one I prefer, though I am of course biased :)
The others are right - you need an iOS Developer account and you still need to understand the basic structure of an XCode project and how Apple does things no matter what solution you use. I've published over a dozen games over the past 4 years so Let me know if you have any questions and I'll be happy to answer.
Good luck!
Cut the Rope is actually created with HTML5/CSS3/Js...using the 'canvas' element...
I'm interested in creating games like Cut the Rope too. You need to know how to create Sprite animations though, which are used with Css3's #keyframe property.
But Unity3D seems to be the best choice to develop 3D games on iOS and Android.
If you know any 3D graphics application like Maya or Blender you can create your very own 3D game by importing assets into unity... such an example here... http://www.eatsheep.com/
In both the cases you need work with a 2D Game Artist and 3D modeler respectively, where as you can handle the development.
good luck with that.

iOS Game Engine [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm basically new and starting iPhone game development and I want to create 3D games for the platform, I had a look around and it doesn't seems to have much choice if you want a pure 3D oriented game engine that provide you physic etc...
While Googling I come up with 2 solutions:
Unity (unity3d.com), which seems to be somewhat restricted to scripting and while testing I saw the even a simple build is like 28meg... Look to me that the basic version doesn't get you nowhere as most of the features to optimize your Apps. comes with the full version... and you still need a flash screen.
SIO2 (sio2interactive.com), they seems to just release a new version that seems pretty good, they seems to use C++ for coding which is great and have a blender integration. Executable size is like 2meg which seems to me unbelievable for the features they provide, and you can also get the source, and from my tests it run pretty fast too.
Anyway, my question is what does people are using out there?
Unity seems to be the popular choice for "easy" game creation, but SIO2 seems to be more expandable to me (am I right to think that?).
And finally, what would you guys recommend (basically iPhone 3D newbie) to use based on your experience?
PS: I have experience in C++ and basic knowledge in OpenGL (desktop).
Unity is very cool, IMO, but I just started using it for game dev.
I suggest you take a look at http://isgl3d.com/. it has written in Objective-C and has many good features, it has OpenGl ES 2 and bullet physics support and can import 3D objects from blender or maya with POD format.
also if you have C++ knowledge you can consider using openframeworks or cinder,
both are C++ and created for creative programming but can be used for some type of games.
http://libcinder.org
http://openframeworks.cc
There are far more iPhone 3D game engines to choose from than unity and SIO2. I can suggest at least 19 for iOS + 3D development: http://mobilegameengines.com/iphone/3d_game_engines
Unity would probably be the best option to use in regards to game programming. However, are you a one man or do you have modelers getting animation for your game? If you do not then I recommend Blender, which is an open source tool used to model characters for games and such.
Back to Unity, it seems like the best options just because of the many different types of coding you can do on it. This includes C# and a version of JavaScript for video games. Also, if you're interested in a career for game development then Unity can help you learn scripting so you already know how to do it if you apply for a job.
Lastly, Unity seems to be the like the best engine that is free that can do the most 'stuff' quickly. Prototyping is incredibly quick on Unity and this will help you in the long run when you need to test your game.

Game platform/engine for inexperienced/solo developer? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
There are a number of discussions on stackoverflow.com about what is the best iPhone game platform/engine. My question is not necessarily what is the best, but what is the best for an experienced iPhone developer but not not experienced in game design. This will also be a solo project plus a graphics designer. Consider I will be working full-time at my day job and will need to support a number of other iPhone apps. In other words, designing the game will be very much a part-time project but needs to go out in 2 - 4 months(?). Ramp up time needs to be quick. I'd like to build 2D in the beginning and then go to 3D.
I lean toward Unity 3D since it has lots of documentation and help. From what I can see, the iPhone basic version is $399 and you get the IDE for free. Can anyone confirm?
Unity3D is for 3D but I've read you can still do 2D. I'm trying to find out what is involved there. One drawback with Unity3D is the 8-15 second Unity splash screen. I've also read this doesn't get much better with the higher priced version. But I suppose that is the price you pay for the convenience of having a simpler framework available.
Cocos2d is a great framework and free but lacks documentation. It also requires much ramp up time to learn its framework and choose a suitable physics engine. I don't see this route as practical. I can see learning it across a long timeline as a side project but then you eat into getting your game out the door fairly quick. If I go with Unity, I probably abandon Cocos2d altogether since I will have invested so much into Unity.
Does my reasoning for Unity sound feasible?
---EDIT---
Based on some of the comments, here is the type of game I'm referring to initially: A 2D shooter similar to Zomebieville but most likely without its large feature set.
I'll vote for Unity 3D. It contains a very nice interactive development environment and supports a variety of platforms (including the iPhone). If you don't have experience writing game loops or any of that, then you will depend heavily on such development environments - you might as well get the best.
If your game is worth it, people won't mind the wait screen.
This will also be a solo project plus a graphics designer.
designing the game will be very much a part-time project but needs to go out in 2 - 4 months(?).
Two words:
Forget it!
Yes - Unity3D is $399 for the basic iPhone license.
Using Unity to create 2D games works in most simplistic terms as follows:
The Camera views a 3D world and creates a 2D game when the camera is directly facing a platform from the side. I guess you could also aim the camera straight down (birds eye view) on a surface as well.
The difference is as follows: In Cocos2D you are still running an openGL ES app. You have the ability to have layers in the Z coordinates.
Unity however would be best used when using 3D objects to be animated as the art. If your art is already 2D then in Unity you would be placing your art onto a flat plane. If you are concerned about the quality of the artwork when it comes to your game - if the art is 2D then there really is no point in using Unity and spending the money.
Also consider that Unity3D's basic package will not give you access to your own methods outside of it's framework - if you have some objective c you would like in your game from say another project or you have a special server you want to connect to using your own code that will not work. This kills it for me.
I understand there is a lack of documentation however - There are a lot of tools and tutorials to help.
First consider that Unity3D has a WYSIWYG approach with actions built in for physics.
Cocos2D allows you to use several different physics libraries including the one in Unity3D.
Youtube Cocos2d iphone box2d and chipmunk - mix the tags up
One nice thing about 2D art in cocos is SVG and tiles - see this tutorial / video - not much work - not much at all.
http://www.youtube.com/watch?v=yvZM-YPPbII
Cocos is actual simple - it is python and the documentation is poor - however there are plenty of small open source games out there using cocos - a quick google code search will reveal a few - open one up in xcode and it becomes quite clear and if you are a developer who knows an actual programming language it should look as easy as html form there.
I am convinced after working on several projects opening a few games that are out there will make complete sense of all of it.
I don't know much about Unity3D. But I know of a very nice game engine witch you can use it's called Game Maker. I think it's very useful for the inexperienced/solo game developer. With it you should be able to create good quality games in about two to three months. The last I checked it's about $20 for the full version of the software. So, I guess it's light on the wallet too.
2D games are easy with Unity. Its as simple as changing the view mode of the camera. Technically the game is still 3d but seen as 2d. If your looking to solo make a game in a short time then Unity is the way to go. Unity can make a 2d game for a iPhone to a super advanced MMO. Also there are hundreds if not thousands of tutorials out there that can teach you pretty much anything you need to know.
Unity is easy to make games for every platform and gets rid of the heavy lifting. I like Unity because you see the results fast and its cross-platform compatibility.

What are the "gotchas" when developing an iPhone Game? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Am used to developing business and reference apps. Now I have to do an iPhone game. What tips can you share to help me with:
understanding the scope of the project
defining the deliverables
specifying the game play and other parameters
estimating the development effort
testing the game
A big question, I know. Thanks!
My answer is not following the waterfall methodology response you were looking for because I think you will need to learn the skill of game programming before you can plan, design, implement and test it. Game programming is VERY different to business programming and a whole other field in and of itself.
Due to your lack of experience in programming games there are a few concepts that you will need to learn before you can program a game period, let alone one on the iPhone.
Some of these things will depend on whether you are programming a 3D game or going for the 2D platform style.
OpenGL ES
The first thing you will need to learn is the OpenGL ES programming language. This is basically a 3D API which enables you to do drawing of 3D primitives. You will still need to use this if you are coding a 2D game as it is quick due to using the GPU for acceleration.
There are some good tutorials on the Google that you should begin with.
Vector Math
If you are doing anything 3D, you will need to learn about 3D vector math, vectors are basically used for everything in games, camera look direction, position of characters, speed, collision detection, etc. 2D vectors (x,y) minus the z component are still needed for 2D games programming.
Collision Detection
How do I know when my ball hits the wall? The answer is collision detection. There are many forms of collision detection such as Sphere to Sphere, AABB, OOBB, Convex Hulls, Triangle Mesh, etc.
AI
How do I get the enemy to attack my player character? Artificial intelligence is another large field essential to give NPCs/Enemies the ability to make intelligent decisions. AI can be simple such as if else statements but usually requires Finite State Machines or Fuzzy logic to be effective.
Pathfinding
If you want to move a character from Point A to Point B while avoiding enemies and moving obstacles, you will need to use a pathfinding algorithm. A Star (A*) is one of the most popular.
Scene Graph
If you wish to have 10-20+ enemies on screen at a time, you will need to code a scene graph to manage the dynamic drawing, logic and creation and deletion of resources. If you don't know what polymorphism is you will need to know it as it is essential for your game objects to adhere to and it ties in with the scene graph.
Physics
Position, Speed, Acceleration, Gravity and Rays are all represented using vectors and you may need to brush up on your physics math in order to code any game. Start with Newton's Second law of motion F=MA (Force = Mass * Acceleration). An open source physics engine such as Bullet, ODE, Newton, Tokamak will make things easier, meaning you won't need to write these physics rules yourself.
Objective-C++
This is optional although recommended. If you don't know C++ this is essentially a mixture of C++ and Objective-C. I tend to use C++ for the core game engine and programming because of the speed of C++ and availability of third party libraries in C++.
Sound
If you need sound you can just go ahead and use the simple audio frameworks that Apple provide, however 3D positional audio is going to require something better. I would recommend learning the FMOD SDK for iPhone. As #Stowelly mentioned, FMOD requires a license for commercial distribution but there are others you can look for which are royalty free.
Use a Game Engine
There are game engines available for the iPhone at the moment which will make it much easier for you to get a game going, in your case this will be faster although you will still need to learn the concepts I mentioned above.
Here are some game engines I know of:
Unity3D
This probably the most popular one that I know of. Unity is a PC/Mac game engine that lets you write code on the Mac and compile for Windows/Linux/Mac OS X. I doubt the iPhone building is compatible directly with other platforms, I would imagine you'd be restricted to iPhone if you started a new project. This engine does however have a commercial deployment cost of $199-$399.
Cocos2D
This one is an open source 2D game engine that might be useful for a lot of games. Worth taking a look at. Hosted on Google code.
Here are some others to check out:
Ston3D for iPhone
OOlong Engine
SIO2Engine
iTGB for 2D Games
The main difference between business apps and games, especially on mobile devices, is the importance of performance. An app that puts up a form and waits for user input probably isn't doing anything in the meantime. A game loop, on the other hand is going all the time and probably doing alot. Business programmers are not used to thinking in these terms, but games draw down battery power and, believe it or not, how you implement your game will have a great effect on how quickly that battery is drawn down.
So, one question is, what is this game that you "have to" develop? If it is sudoku, no worries. If it's a real-time 3D space battle, that's another story.
If your business apps were on the iPhone, then you probably used 100% Objective-C. (If you were doing C# or Java apps on desktops, then welcome to managing your own memory.) There are those who will tell you that the runtime type management of Objective-C is too slow for complex games. People certainly make OK games using it with Cocos2D and other engines, but again it depends on the game. There are professional developers who will only work with C++ or even straight C.

What do I have to learn to get done with a 3D racing game for the iPhone? What Tools do I need?

I know Java pretty well. I know now most of the Basics in Objective-C.
I know nothing about Photoshop. I know how to use TurboCAD 10 Professional, so I do have some experience in 3D object modelling. Although not much.
What do I have to learn step-by-step, to come to 3D game Development for iPhone? What Tools do I need? Which Books help out? How long did you learn?
Learning the basic ins-and-outs of OpenGL ES on the iPhone took me about 3 weeks. I post some of my observations on the subject here. The source code to my Molecules iPhone application, which uses OpenGL ES, is available here. Maybe you'll be able to find something useful in that example. However, there's nothing in there that deals with textures, which you'll probably need for your game. Bill Dudney has posted source code for a Wavefront OBJ modeler on the iPhone that may help in that regard. For a good text on OpenGL ES, I'd recommend "Mobile 3D Graphics: with OpenGL ES and M3G".
When it comes to Cocoa development in general, it will take you a little while to get up to speed. For me, it was about 6 months before I felt comfortable with it, although that was in the more complex Mac desktop environment. I post some resources for learning Cocoa here, although that's by no means an exhaustive list.
I agree with diciu, this is a bit much for someone just starting out on the platform. I'd find a simpler application or series of targeted applications (that you may never even release) to help you learn the core concepts before you leap into 3-D game design.
Your goal is very ambitious - I think it's a very hard project to tackle as the first project on the iPhone and you'd be better off starting out with a couple of simple Cocoa touch applications to get a feel for the platform.
For a simulation game I would start with experimenting with some physics engine such as bullet. Bullet is C++ and you can use it from Objective-C++.
For rendering 3D you probably want to use OpenGL ES.
I guess that OpenGL is worth a look.