qq_tracker_code_advanced_default

In my attempt to develop my first iPhone game, I thought I might use a game engine that will make the process as simple as possible. I started searching the internet for available iPhone game engines and stumbled upon Unity 3D. The games you can produce with Unity seem to look awesome.

I started the download of Unity 3D for the iPhone. Below you will find a link to download Unity 3D iPhone.

For most of you, if you’ve come to this page you may have already downloaded Unity iPhone and are now looking for tutorials to get started developing with Unity. If you’ve already launched Unity and had a look at the interface then you may have already started to become discouraged as it appears very daunting at first look.

As I am developing my very first game I will be posting tutorials so that other people will have a chance to learn. In this first tutorial I will briefly cover the Unity iPhone interface as well as how to set up the correct settings for building for the iPhone so that hopefully you will not run into too much trouble getting started.

Unity iPhone: The Interface

Unity iPhone - The Interface

Unity iPhone - The Interface

The Unity iPhone interface has 7 sections. Starting with the very top is the toolbar and then on the left top is the scene view and below that you have the game view and below that are the play controls for the game view. To the left of the scene view is the Hierarchy view and below that is the project view. Next to those on the right is the Inspector view. I will be going over each of these views and explain what they are used for. Please also note that this is default layout for Unity iPhone and that you can move the views around as you want.

The Toolbar:

Unity iPhone - Toolbar

Toolbar - Transform Tools

To the very left of the toolbar, you will see 4 controls. These are called transform tools. The transform tools are used to interact with game objects in the scene view. From left to right they are: The Hand Tool, The Move Tool, The Rotate Tool and the Scale Tool. Clicking on the individual tool activates that tool.

Toolbar - Transform Gizmo Toggles

Toolbar - Transform Gizmo Toggles

The next section of the toolbar are the Transform Gizmo Toggles. These controls affect the scene view display. You can toggle the handle position to either center or pivot. Center will position the Gizmo at the center of the object’s rendered bounds. Pivot will position the Gizmo at the actual pivot point of a Mesh.

Toolbar - Layout

Toolbar - Layout

The last control on the toolbar is the Layout control. With the layout control you can choose from a list of pre-designed layouts to use with Unity. They each have their own pros and cons, you will have to pick the one that most suits you. I like to use Tall. You can also create a new layout and save it.

That pretty much covers the toolbar. Hopefully I have explained it well enough for everyone to understand. If there is something I left out please feel free to ask questions. Now on to the Scene View

The Scene View:

Unity iPhone - Scene View

Unity iPhone - Scene View

The Scene View is used to select and position environments, the player, the camera, enemies and all other GameObjects. Maneuvering and manipulating objects is done via the transform tools on the main toolbar at the very top using the transform tools.

As you can see from the screen shot above and subsequent screen shots, all views have their own tool bar. The Scene View toolbar has 8 different items that can be manipulated they are as follows.

  • View Selector – The View Selector as its name implies allows you to select the which view you would like within the current window. You would use this to switch the current window to any of the other available views.
  • Draw Mode – Here you have a few options: Textured, Wireframe, Textured & Wireframe and Occlusion
  • Render Mode – RGB and Alpha are your 2 options within Render Mode
  • Lighting – Enabling Scene Lighting will override the default Scene View lighting with whatever lights you have positioned to create your final light setup.
  • FX – Game Overlay will enable items like Skyboxes and GUI Elements in the Scene View.
  • Ortho – I haven’t figured out what this control does yet… If anyone has any idea, let me know and I’ll add a description.
  • Aspect – This control allows you to set your Scene View aspect ratio. There are some useful pre-defined aspect ratios for both the iPhone and the iPad.
  • Layers – This control allows you to toggle on and off layers to show in the scene view.

That concludes the overview of the Scene View. As I said before I am still in the learning stages so I am doing the best I can to get the terminology right. You’ll have to excuse any obvious mistakes.

The Game View:

Unity iPhone - Game View

Unity iPhone - Game View

The Game View is rendered from the Camera(s) in your game. It is representative of your final, published game. You will need to use one or more Cameras to control what the player actually sees when they are playing your game.

The Game View has 5 controls. I will cover each of them below

  • View Selector – Just as with the Scene View the View Selector allows you to select the which view you would like within the current window. You would use this to switch the current window to any of the other available views.
  • Aspect Ratio – Allows you to preview how your game will look on the chosen device.
  • Maximize on Play – This control will maximize the game view to full screen when you press the Play button on the Play controls.
  • Gizmos – This will show the gizmos in the game view.
  • Stats – This will show some game stats within the game view.

That’s it, all there is to the Game View. Hopefully I haven’t confused anyone too much just yet. We are almost done. Just 3 more views to cover and then I will go over the settings that are required to build your project for Xcode.

The Hierarchy View:

Unity iPhone - Hierarchy View

Unity iPhone - Hierarchy View

The Hierarchy contains every GameObject in the current Scene. Some of these are direct instances of asset files like 3D models, and others are instances of Prefabs — custom objects that will make up much of your game. You can select and Parent objects in the Hierarchy. As objects are added and removed from the scene, they will appear and disappear from the Hierarchy as well.

The Hierarchy View also has a View Selector that allows you to change the view within the current window as well as a Show Prefab toggle that allows you to show Prefabs.

The Project View:

Unity iPhone - Project View

Unity iPhone - Project View

This is where you store all the assets that make up your game, like scenes, scripts, 3D models, textures, audio files, and Prefabs. If you right-click on any asset in the Project View, you can choose Reveal in Finder to actually see the asset itself in your file system.

Important Note: You should never move project assets around using the OS since this will break any metadata associated with the asset. Always use the Project View to organize your assets.

To add assets to your project, you can drag any file from your OS into the Project View, or use Assets->Import New Asset. Your asset is now ready to be used in your game.

Scenes are also stored in the Project View. Think of these as individual levels. To create a new Scene, use Command-N. To save the current Scene into the Project View, use Command-S.

The Project View also has a View Selector and a Create drop-down that will allow you to Create assets from within Unity such as scripts, prefabs, animations, etc…

The Inspector View:

Unity iPhone - Inspector View

Unity iPhone - Inspector View

Games in Unity are made up of multiple GameObjects that contain meshes, scripts, sounds, or other graphical elements like Lights. The Inspector displays detailed information about your currently selected GameObject, including all attached Components and their properties. Here, you modify the functionality of GameObjects in your scene.

Any property that is displayed in the Inspector can be directly modified. Even script variables can be changed without modifying the script itself. You can use the Inspector to change variables at runtime to experiment and find the magic gameplay for your game. In a script, if you define a public variable of an object type (like GameObject or Transform), you can drag and drop a GameObject or Prefab into the Inspector to make the assignment.

Unity iPhone – Xcode Settings

Unity iPhone has some basic settings that need to be set in order for you to build your project properly. Unity will export all of your game content into code that Xcode can understand. When your project finishes building within Unity, a script will auto open Xcode and start the compiling process. For this reason we need to make sure that the information that we would usually put into the info.plist file within Xcode is properly setup within Unity. You can get to the settings by going to Edit -> Project Settings -> Player.

The settings will be available within the Inspector View on the right hand side of the Unity application.

You should at this point be familiar with the settings that need to be set for your Unity app to compile properly within Xcode. If you don’t know what to put into this section then I suggest you spend some time with Xcode and on the Apple Developer site. If anyone needs an explanation for the above settings I will be more then happy to add to this tutorial but I think they are mostly self explanatory.

Well, this concludes the first tutorial for Unity iPhone. I hope you found it useful and please bare with me as I learn my way around this awesome game engine.

So… you’ve installed the latest SDK and XCode from Apple’s developer site only to find out that the only base SDK’s you are left to develop with are 3.2 and 4.0. What about if you have an iPhone 2G as your only development device? The iPhone 2G only goes up to iOS 3.1.3 and if you are stuck with the lowest base SDK of 3.2, you will not be able to push your apps to your iPhone.

This is exactly what happened to me. I downloaded the beta SDK for the 4.0 iOS when it came out. Little did I know that when you install that, it removes all SDK’s prior to 3.2.

Luckily for us, Apple is kind enough to keep previous versions of Xcode and their SDK’s available for download. Here is a list of available downloads.

You have to be logged into the Apple developer site http://developer.apple.com to download the above listed SDK’s. I downloaded the 3.1.3 Snow Leopard SDK since I already have 3.2 and 4.0 and 3.1.3 includes all of the above mentioned SDK’s as well as 2.0 and 2.1.

Once you’ve downloaded the SDK of your choice it should be in the form of a DMG, go ahead and mount that and open up the resulting volume. You should get something that looks like the image below.

iPhone SDK Volume

iPhone SDK Volume

At this point you will need to open up the Packages folder rather then running the installer because all we want are the SDK’s. When you open up the Packages folder scroll down a bit until you see the SDK’s. You should see something similar to the screen shot below.

Packages Folder

Packages Folder

You’ll see that there are device SDK’s and simulator SDK’s. You don’t have to install the simulator SDK’s if you don’t want to because all we are really after here is to be able to push our apps to an iPhone with an iOS earlier then 3.2. Double click on one of the iPhone SDK’s and you will be presented with an installer screen like the one below.

iPhone SDK Installer Screen

iPhone SDK Installer Screen

Click on Continue and and you will get to the next screen similar to the one in the screen shot below

iPhone SDK Installer Screen

iPhone SDK Installer Screen

On this screen you need to click on the drive you want to install the SDK to. In most cases it will be your primary Hard Drive. If you have your Developer tools installed on a different drive then you should select that one instead. Next you need to click on Choose Folder and you will be presented with a Choose Folder dialog similar to the screen shot below.

Choose Folder Dialog

Choose Folder Dialog

If you are like me and installed Xcode in the default location then you should have a developer folder in the root of your Hard Drive. Click on the Developer folder and then click choose. You will see a screen similar to the one below.

iPhone SDK Installer Screen

iPhone SDK Installer Screen

You can verify on this screen that you’ve selected the proper folder. It should have a blue circle around the Hard Drive and if you’ve picked the Developer folder it should say the following on the bottom “You have chosen to install this software in the folder Developer on the disk Macintosh HD. Click Continue and you will be presented with a screen similar to the below screen shot.

iPhone SDK Installer Screen

iPhone SDK Installer Screen

This is just a confirmation screen, from here you just need to click on Install. You may be prompted with a password screen. Enter your password to continue with the installation. You should see a screen similar to the one below.

iPhone SDK Installer Progress Screen

iPhone SDK Installer Progress Screen

Depending on the SDK you are installing this part can take up to 5 minutes to complete. When the installation is done you will be presented with a screen similar to the one below.

iPhone SDK Install Complete

iPhone SDK Install Complete

Click on close. At this time your installation of the SDK is complete. You can verify that the SDK installed successfully by launching Xcode. Once Xcode is launched open an existing project or start a new one and go to Project -> Project Settings. You should see a screen similar to the below screen shot.

Xcode Project Settings - General

Xcode Project Settings - General

Click on the drop down towards the bottom where you can choose your base SDK and if all went well you should see a screen similar to the below depending on which SDK you installed.

iPhone SDK's

iPhone SDK's

Pick your SDK of choice and enjoy. Hopefully this tutorial has helped someone with their project. I spent many hours the other night researching how I could install older version SDK’s and once I found an easy method I thought I would share it with the rest of the world. If for some reason you don’t see your SDK listed here then it may have been installed in the wrong folder. If you can’t get it working feel free to ask me for help. I’m always willing to help out a fellow developer.

When Apple introduced the iPhone and the iPod Touch it changed the way we use the mobile phone and listen to music. When Apple introduced the iPad we were given another great device for listening to music and browsing the web as well as keeping us entertained with the thousands of applications that are available from the Apple App Store.

This post is aimed at comparing the iPhone, iPod Touch and the new iPad. I will be highlighting the features of each device and hopefully help someone make an educated decision as to which device to purchase. Of course there is nothing wrong with owning all 3 of them :)

What do you need?

  • A Phone – Get an iPhone
  • Want to listen to music – Get an iPod Touch
  • Want to read books / listen to music / more power – Get an iPad

Only an iPhone can make phone calls. The iPod Touch and the iPad both have speakers but no microphone so even using the Skype app, you will not be able to make phone calls using either of these devices.

Wanna get an iPhone?

Since the release of the iPhone we have seen many variations of the original. The current models are:

  • iPhone 2G (The original)
  • iPhone 3G
  • iPhone 3GS
  • iPhone 4

If you don’t own an iPhone and you sign up for a new AT&T contract you will get the iPhone 4. The 16 GB model will set you back about $199.00 with the 32 GB model at $299.00 and at the time of this post you should still be able to get the 3GS 8 GB model for $99.00 (don’t get it unless you are strapped for cash and really really want an iPhone)

If you don’t want to get a contract with AT&T but still want an iPhone you should check eBay, craigslist, etc… You can get an iPhone 2G from eBay for about $120.00 and it will run up to version 3.1.3 and can be jail broken. If you want to get something better for a little more cash I recommend going with the 3GS as it has more capable hardware and can run the latest iOS 4 which supports multi-tasking.

However, if you like to tinker, you can get a 3G and jail break it and then run a modified version of iOS 4 which will allow you to enable multi tasking on your 3G iPhone.

So what are the major differences between the iPhone 2G, 3G, 3GS and 4?

Camera:

  • iPhone 2G – 2 Megapixels / Rear Only / No Flash
  • iPhone 3G – 2 Megapixels / Rear Only / No Flash
  • iPhone 3GS – 3 Megapixels / Rear Only / No Flash
  • iPhone 4 – 5 Megapixels Rear / .3 Megapixels Front / LED Flash

Talk / Standby Time:

  • iPhone 2G – 2G 8 Hours Talk / 250 Hours Standby
  • iPhone 3G – 2G 10 Hours Talk, 3G 5 Hours Talk / 300 Hours Standby
  • iPhone 3GS – 2G 10 Hours Talk, 3G 5 Hours Talk / 300 Hours Standby
  • iPhone 4 – 2G 14 Hours Talk, 3G 7 Hours Talk / 300 Hours Standby

Display Size / Resolution:

  • iPhone 2G – 3.5 inch / 320 x 480
  • iPhone 3G – 3.5 inch / 320 x 480
  • iPhone 3GS – 3.5 inch / 320 x 480
  • iPhone 4 – 3.5 inch / 960 x 640

Size Height / Width / Depth:

Note: Without being to specific all 4 versions have a height of 4.5 inches and a width of 2.4 inches. The depth however is slightly different

  • iPhone 2G – .46 inch depth
  • iPhone 3G – .48 inch depth
  • iPhone 3GS – .48 inch depth
  • iPhone 4 – .37 inch depth

One thing to note is that the iPhone 4 is superior in every way when comparing its earlier models. If you have the cash then you should go for it.

There are a few things to consider when deciding which device you should ultimately purchase. If you are strapped for cash and can only afford to purchase one of the 3 devices then think about what your needs are. If you really need a phone then you have to go with the iPhone but if all you want to do is listen to music, browse the web and enjoy all of the available iPod Touch apps from the app store then get an iPod touch.

If you need a device with a fairly decent sized screen and a high resolution that will make web browsing fun and reading documents online easy as well as allow you to send and receive e-mail either via wi-fi or 3G then the iPad is for you. Utilizing the new 1GHz Apple A4 processor makes the iPad a powerful mobile device that is perfect for people who have an on the go type of lifestyle.

If anyone has any questions or anything to add that I may have missed then please leave a comment…