Game development on iPhone using Unity engine - iphone

Im very new to game development on the iPhone... And I have a question:
If I was to unity, how would that work... Would I use objective-c in unity? or is all of it like just click it, and add properties, no code (that may be a stupid question, but im just wondering)
And once your done with the unity app, does it automaticly complile an xcode file for you?
Im just wondering... Thanks

Unity provides it's own visual design environment, and scripting language support. The scripting is done with C#, Javascript, and Boo for all the platforms they support. You can test your apps on the iPhone.
You can download the trial on their website.

I have used Unity and worked with some of their people, here is what I can offer:
Unity is a visual editor and as mentioned by ManiacDev you can use C#, Javascript, and Boo.
You can do a lot without coding a line and it outputs a file for you to compile in xcode. That's pretty sweet. It is very much WYSIWYG - but for some that leaves a lot to be desired.
Examining this further:
If you did want to use your own Objective C classes and code and bring them into Unity this would require purchasing their Pro version. Personally - I wouldn't go the basic license for this one reason alone. If I want to use my own server or anything else I have already coded in other projects of course I would want to take advantage of the work I have already created and not rewrite more code in C# - for the iPhone this makes no sense at all considering the uniqueness of the device and the other possibilities that could be imagined when having full access to the SDK.
The other thing you might want to think about is that their logo will appear with the basic version - if you don't care and you want to use their tools - the basic version is a great entry point. I personally do not mind their logo at all but again not having the full SDK at my disposal is not a place I would like to be locked in when you want to see your full creative potential.
Hope this helps,
Matthew

Related

Anything similar to XNA for Android or IOS?

I want to start creating games for Android/IOS. I have already created 2D games using XNA and I want to publish them on other platforms even PCs but my highest priority is Mobile platforms. As I said I am familiar with XNA so I need a similar Engine for 2D. It would be great if I could write once and publish on many platforms. Please dont suggest Unity or Unreal. They are not that easy when it comes to 2D.
By similar I mean, for example, how easy to draw a sprite on the screen.
Note: I am working on Windows so no Mac suggestions please.
Regards,
You may also want to consider MonoGame ( https://github.com/mono/MonoGame/ ) as that is also an Open Source, OpenGL implementation of XNA that currently has support for iOS, Android, MacOS X, Windows and recently Linux. It is now all ES 2.0 on the mobile platforms. Our biggest change is that we now support Windows 8, and have a DirectX 11 backend thanks to SharpDX. We now also have initial PlayStation mobile support.
Actually ExEn, is a fork of MonoGame( originally called XNATouch ).
For a list of games on the AppStore or Android Market place and even NaLC, currently using MonoGame look here -
http://monogame.codeplex.com/
I hope this helps.
D.
You might want to keep up on the project called ExEn, which has already successfully ported some XNA samples and smaller games to iPhone and Android. It requires relatively little work to port and refactor to these platforms.
I suggest you check out AndEngine, its an open-source 2d open-gl based game engine that has a strong community. If you want something that you can make cross platform games with check out LibGDX It too is free, open source and based on openGl but it also allows for 3d games. It is also cross platform so a game you write for android can be compiled for, Windows, MacOS (see below), Linux. It also has a really strong community.
Regarding iOS and OSX games you really can't make them unless you buy a Mac. Apple doesn't distribute their SDK for use on any other platform but their own. That said you could maybe get something working under VMWare
Check out MOAI SDK. It's completely free and open-source. It is in beta right now but it is still pretty good. Crimson Pirates for iOS was developed with it.
Right now it supports iOS, Android, Mac, Windows, and Linux. Really good. I thought I liked Cocos2D-x, which is a C++ variant of Cocos2d-iphone supporting windows, iOS (not Mac), and Android but not truely supporting desktop kinda made me like MOAI more.
You can use C++ with MOAI or you can use Lua (they highly encourage using Lua). Being built in C++ is really great because you get access to a vast amount of libraries and you can easily bind them to Lua.
You should try games development with cocos2d.
Cocos2d is one of the best 2d engines for ios/Android I have come across.
http://www.cocos2d-iphone.org/
It is openGL based free engine.
Regards,
Sam
These might be useful to you. However, the first two aren't free, but they have editions for both iOS and Android.
iOS:
http://ios.xamarin.com/
Android:
http://android.xamarin.com/
I've never used either of them, but it's something I've been looking into a bit.
Apparently it lets you run C# and .NET code on both iOS and Android which is pretty cool considering how much easier drawing and things like that are in XNA compared to Open GL ES 2.0. Not to mention the fact that you'd be using C# instead of objective C.
There's also a free open source version sponsored by the same people who make the two I listed above. This one lets you run C# and .NET code on Windows, Linux, and Mac OS X.
http://www.mono-project.com/Main_Page
I have been researching this topic intensively over the last few weeks.
I think the best solution for you is Marmalade, formerly known as Airplay SDK. It is actually more Windows-oriented than Mac (work in Visual Studio), although you still need a Mac for the final step of getting a signed app onto the store. It sounds like a very capable pure C++ product with iOS and Android as well as a bunch of other platforms, Personal license with splash screen $150 pa, single seat Professional $500 pa for all platforms. They have a 45 day trial license which I'm currently using.
I was tempted by MonoGame, could live with the $400 price tag for each platform (for the needed MonoTouch) but it is just way too buggy. The final straw was a combination of a bug causing it to crash all the samples on iOS5 and that keyboard input is broken on iOS.
Too be fair, I'm pretty sure that is all on the MonoGame side and was very impressed with how well MonoTouch worked and was looking forward to programming in c# with LINQ et al.
Since it is not obvious from the other answers, it should be noted to those who are unaware that the ExEn project and the MonoGame projects both build on the Monotouch platform from Xamarin (formerly from Novell) - which is a prerequisite for both for iOS games.
The Xamarin projects was mentioned in another answer as an alternative to Xna, but is really not. Monotouch and Mono for Android are a way to run C# and .NET on iPhone/iPad and Android.
Game development at least on the iPhone side, is typically done using OpenGL and OpenGL is also wrapped in Monotouch. The Xna implementations in Exen and MonoGame also uses OpenGL as the foundation as far as I know.
It should also be noted that Monotouch and Mono for Android are commercial products.
BTW: Exen also compiles to other platforms e.g. silverlight.

How to use 3D models in Xcode (iPhone)? [duplicate]

Closed. This question needs to be more focused. It is not currently accepting answers.
Closed 3 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I want to display and rotate a single 3D model, preferably textured, on the iPhone. Doesn't have to zoom in and out, or have a background, or anything.
I have the following:
an iPhone
a MacBook
the iPhone SDK
Blender
My knowledge base:
I can make 3D models in various 3D programs (I'm most comfortable with 3D Studio Max, which I once took a course on, but I've used others)
General knowledge of procedural programming from years ago (QuickBasic - I'm old!)
Beginner's knowledge of object-oriented programming from going through simple Java and C# tutorials (Head Start C# book and my wife's intro to OOP course that used Java)
I have managed to display a 3D textured model and spin it using a tutorial in C# I got off the net (I didn't just copy and paste, I understand basically how it works) and the XNA game development library, using Visual Studio on Windows.
What I do not know:
Much about Objective C
Anything about OpenGL or OpenGL ES, which the iPhone apparently uses
Anything about XCode
My main problem is that I don't know where to start! All the iPhone books I found seem to be about creating GUI applications, not OpenGL apps. I found an OpenGL book but I don't know how much, if any, applies to iPhone development. And I find the Objective C syntax somewhat confusing, with the weird nested method naming, things like "id" that don't make sense, and the scary thought that I have to do manual memory management.
Where is the best place to start? I couldn't find any tutorials for this sort of thing, but maybe my Google-Fu is weak. Or maybe I should start with learning Objective C? I know of books like Aaron Hillgrass', but I've also read that they are outdated and much of the sample code doesn't work on the iPhone SDK, plus it seems geared towards the Model-View-Controller paradigm which doesn't seem that suited for 3D apps.
Basically I'm confused about what my first steps should be.
Once again, if I may plug my own work, I have written a post about the things I've learned from developing an OpenGL ES application on the iPhone. That application, Molecules (referred to by frankodwyer), is open source and I have a writeup on some of the other tricky issues I ran into while developing it. The application generates 3-D models and lets you rotate and scale them with your fingers, which sounds close to your needs. You can download the code, compile it, and run it on your desktop in a matter of a few minutes. If you join the iPhone Developer Program, you can install it on your device.
When it comes to object loading, Bill Dudney is working on a Wavefront OBJ loader for the iPhone that might be able to take in your Blender files, should they be exportable in that format. I haven't done much texture work on the iPhone yet, but it sounds like his example has that working now.
Overall, I find that learning by example and by jumping into development of some small, targeted applications (that you may never release) are what works for me. Try tweaking the examples listed above and see what happens. You should be able to read through the Objective-C code in those examples and start to get a feel for what they're doing.
Even though Hillegass's book (the third edition just came out and is up-to-date) focuses on the Mac, the Cocoa fundamentals he teaches are still relevant for the iPhone. The MVC design pattern serves you just as well on the iPhone as the Mac. I actually deviated from that pattern in a few places within Molecules, and I regret that decision because those sections of the application became a mess. The book is an easy read and well worth your time.
You should probably start with some simpler iphone apps/tutorials, just to get your footing on obj-c and xcode etc.
For that, I recommend the pragmatic programmer's iphone book, which has enough information to get started (I started with no knowledge of xcode, obj-c, iphone or mac and got to a working app fairly fast, using mainly this). However I should add that I come from a fairly good background in C/C++ and Java.
For your particular project, perhaps take a look at this answer which refers to an open source 3D app that you can look at and get tips from.
This is an ancient thread and I am terribly late. But still I am going to post my 2 pence here.
A Sneak Preview
Before I get in to the beast, this is my setup.
I use
Blender to create 3D models. (You can use Maya or 3D Max, I
will tell you how to export the model for Blender, same works for 3D
Max and Maya).
Cocos3D game engine.
PVRGeoPOD blender extension from Imagination Technology to
convert blender model to format that Cocos3D understand. You can see
that the link downloads an installer file which in turns downloads
the entire SDK. I can't see an easy way to download the blender
extension alone.
So if you are not intending to use Cocos3D, you can skip this answer and run for your money.
Initial Setup
Install blender.
I am not going to embarrass you by going in to details.
Download Cocos3D..
When I type this, the current version is 0.7.2.
Download Cocos2D.
Cocos3D is written on top of popular Cocos2D, a popular 2D game
framework. Important think to note here is that, Cocos2D 2.x version
is already there and stable. But Cocos3D works with Cocos2d 1.x
version only.
When you unzip the source you downloaded you will find a README file
inside and it specifically says,
PLEASE NOTE THAT cocos3d 0.7.2 IS NOT COMPATIBLE WITH cocos2d 2.x. BE
SURE TO DOWNLOAD cocos2d 1.x FOR USE WITH cocos3d.(emphasis mine)
The README file clearly tells the installation procedure. After
installation, you will get a nice Cocos3D project template in XCode.
Add PVRGeoPOD extension to Blender.
This requires some explanation. When you run the PVRGeoPOD
installer, a screen shows what and what features need to be
installed. I only selected
PVRGeoPOD - To convert my models in my .blend file to .POD format that Cocos3D understands
PVRShaman - you can view the model inside .POD using this tool.
You can install other tools in the list, but I only used these two.
Now after the installation process (which may take some time), you
need to add the PVRGeoPOD AddOn to blender. You can find the
PVRGeoPOD.UserManual.PDF file in the just installed folder, which also contains below information.
Find Blender Add-On folder, you can open blender python console and run command bpy.utils.script_paths("addons") to see the
path to this folder.
Find the blender add-on files inside the PVRGeoPOD folder, in your installation path. When you see files like
libPVRGeoPOD.dylib and PVRGeoPODScript.py and 2 QTfiles, stop there as this is the location. Copy these 4 files and paste them in
blender add on folder.
Now open blender, choose Preferences, find Add-On tab, search and find PVRGeoPOD extension and enable it by clicking the
checkbox on the right.
Now Quit and restart blender, if needed, and select file->export and see if there is an option called PVRGeoPOD(.pod/.h/.cpp),
if yes,you are successful.
Now you can create models in blender, and export these
models as .POD files which Cocos3D understands.
If you are using other 3D designing tools like Maya, 3D Max, this
PVRGeoPOD extension can be added to them also. Just see the PDF I
mentioned above.
Using in project
Step by step procedure is given below.
Create your model in blender (.blend) and export it as .POD file.
When you export I normally select following options
Primitive Type - Indexed Triangle List
Material tab - Check Export Material Option
and rest I left it as default.
Create a new project in XCode, choose Cocos3D template.
Add the .POD files to your project. If yours a textured model, add
that texture to your project also.
The template project itself contains a HelloWorld.POD file, you
can replace that line with your .POD file so that your model will be
visible.
[self addContentFromPODFile: #"YourPODFileName.pod"];
Now you have your first 3D model visible in iOS device.
I'm having a play with iPhone development for a bit of fun and bought Beginning iPhone Development by Dave Mark and Jeff LaMarche (ISBN13: 978-1-4302-1626-1) and am enjoying working through the chapters. I have a Win32 Delphi background with a bit of .NET and so Objective C is very new to me.
One of the chapters is on OpenGL and Quartz which may be of interest to you. I've haven't got that far yet so I can't really comment on how useful it will be for yourself but the writing style is very accessible and it's paced well (for me anyway).
The initial chapters explain exactly how to get up an running with a good introduction to Xcode and InterfaceBuilder.
For anything on iOS 8 or later, the answer is SceneKit. SceneKit will render Collada (DAE) files. Any decent modelling package (eg Cheetah, Blender) should export a DAE file - it's a documented portable format in XML (though xCode compiles them into binary format to save space).

why use xcode if monotouch is available?

if mono touch is available than why we should use mac environment(sdk,xcode+Interface Builder)?
what are the disadvantage of monotouch compare to xcode?
I always prefer working in the language that is most philosophically aligned with the platform I am developing for.
That is to say, the frameworks the whole platform is built around were written for and in Objective-C. As such, if you are working in Objective-C yourself for a while you understand why things are built the way they are, and can also anticipate calls that might exist or behaviors.
Just as I would not develop for Windows Phone 7 in anything but Silverlight, I would not program the iPhone in anything but Objective-C in order to get the most out of the platform. New language? That's a benefit as people should learn new languages now and then anyway. And it's not like it saves you that much time to use a language you already know since a large majority of your time will be spent learning the frameworks (which MonoTouch lets you call into).
I feel like this needs an answer from the MT camp, too.
Why eat fish, if you can have meat? Why speak German, if English is understood? Why watch CNN if there is FOX? Why vote vote for the Republicans if there are the Democrats? Why...? And so on.
It is your choice! If you have worked with C# for a long time and want to have quick results on iOS, go MonoTouch. Especially if you have a collection of APIs or methods you can reuse, MT is the way to go. If you want to learn a new language (ObjC), go for it. Even if you use MT in the end, knowing ObjC is somehow crucial because it helps you understand why things work as they do.
Hello here is my personal opinion,
I've also been on .Net world for a while, when iPhone launched the ability to create native apps, it called my whole attention and i really tried to learn objc, i took 2 books and started trying and trying and trying like for a month and then I left iPHone programming due to you had to make tons of things than on .NET was a line away for example the GC.
When Miguel de Icaza launched MonoTouch i gave it a try and i realized that most of my previously done code was fully funcional (i've always tried to separate ui code from business code) and this is really the point of .NET on the iPhone, to bring most of your already done business logic to the device.
Also on objc you wont find anything like LINQ or var keyword, consuming web services on MonoTouch its just a few clicks away etc.
If you want to target the Android platform there is also MonoDroid (monodroid.net) wich its coming out later this year the stable release, you can give it a try right now on the beta state. Also if you want to target Mac OSX there is MonoMac. So you can share class libs between all this 3 platforms (also al mono/.net supported ones) without hassle not to mention it will work on windows too and viceversa (when possible) (Also dont forget about WP7).
The only thing you will need to worry about its the UI but most of your business logic should work. here is a complete list of .NET Assemblies supported in MonoTouch http://monotouch.net/Documentation/Assemblies and also MonoTouch exposes a C#/CIL binding to all the CocoaTouch APIs.
Also the support of the MonoTouch team is awesome you can just get on IRC ans ask a question and it will be answered right away, mailing list too :)
I really enjoy MonoTouch, i know that no language is perfect for all tasks, and Objective-C is no exception.
Every example, tutorial, and piece of documentation will be written in Objective-C, and mono will just be calling into Objective-C code under the hood. If you really feel like C# is worth mentally translating everything, and adding an extra layer in your code, go for it I guess.
As a C# developer, I've found Objective-C to be horribly painful to become confident with. It's taken about two months, and two excellent resources to get to this stage.
Get your Visa card out, you'll need to spend a total of $54.
1. The free Stanford "Developing apps for iOS" lectures.
Pure brilliance, and it makes learning Objective-C very clear.
http://itunes.apple.com/us/itunes-u/developing-apps-for-ios-sd/id395631522
2. The iOS Apprentice series.
This is where you'll need to cough up the $54. It teaches you, step by step, how to program in Objective-C, and the apps you build are actually pretty impressive. Part 1 (of the 4 parts) is completely free, so you can give it a go before parting with any cash.
http://www.raywenderlich.com/store/ios-apprentice
I've yet to find any iOS books which match the clarity and friendliness of these two resources.
Finally, don't buy any books unless they specifically say that they're for iOS5 and XCode 4. This latest version of XCode is simply too different to make them useful.
Disclaimer: I don't work for any of the resources mentioned in this thread !

Mixing Unity generated code with Objective-C in iOS?

Is it possible to mix iOS code and interface elements with Unity generated iOS code?
For example if I am working with a game developer who is developing a game in Unity, could I take his xCode project (generated by Unity), and add interface elements which I code myself using Objective-C & Interface Builder etc?
From what I can see this isn't possible as everything is created via Unity.... but hopefully I am wrong...
Thanks!
You can even use 3rd party libraries in XCode and integrate them in the build process. After fiddling around with the right settings I wrote a blog entry about this:
iPhone & Unity3D: Integrating 3rd Party Static Libraries in Unity3D Generated XCode Projects
You should be able to generate Native plug ins to interact with the Unity code. You would need to write a wrapper though. Read more at: http://unity3d.com/support/documentation/Manual/Plugins.html
Read the part at iOS :)
I came across this general guide to working with Unity native plugins in OSX which was useful and is probably where you need to be looking for your answer, as Zophiel said
https://blog.reigndesign.com/blog/unity-native-plugins-os-x
You can just design a view and button to trigger the unity to run or stop, but models in unity can't be controlled using Obj-C, although unity has import to Xcode, it only import the start code, game scripts depending on the link libraries which couldn't be modified.
I think you can do it as the same way I probably has been working with Objective-C without any changes. For Unity's code generator preserves the native codes under Classes.
And furthermore there is an another way to do this which is called "Plug-in".
But I hope the developers in Unity find a better way seamlessly combined with Xcode as staffs in Apple usually does.
Combining IB and Unity's integrated editor would be better and more welcomed in future.
Possible yes. Advisable for beginner or intermediate level Devs? Probably not. The Unity project is generated and regenerated every time you push a build. Now I believe that if you use Append when you do builds that it should keep existing changes to the Xcode project... but 'should' is the operative word there. You may need to implement some sort of build system like Jeeves to keep the headaches to a minimum if you are trying to do this on a large project in which you for see a constant stream of updates from both the Unity side and the Xcode side.
Now if you're integrating code that is in it's own files and doesn't overlap or rewrite the code Unity has generated, then the Append feature is really going to work for you, but if you're deleting, altering, or adding code to any of the files that Unity generated then definitely use SVN or some other form of source control and snap shot before and after every new Unity recompile / Xcode generation.
Also, take a look in the Unity Asset store. Whatever functionality you are trying to home brew in Xcode can definitely be written in C# on Unity. Someone else may have already conquered the problem you're trying to solve and placed it in the asset store for $5.
Hope that helps.

Do i have to buy mac for iphone application development?

Is there any MacOS virtual machine that can run on PC?
Is there any source to get it?
What is the best way to develop apps for iphone?
Yes all the developer tools are OSX only.
There are lots of iPhone development books out there go check out amazon and find one with some good reviews and that will get you started.
You might not, in the strictest terms, have to get a Mac to develop for iPhone; but it will be extremely helpful. Apple is relatively talented at squashing efforts directed towards Hackintoshes and virtual machines running OS X.
The shortest answer that will give you the least hassle is: Yes you need a Mac.
But, as far as I know there are a few possibilites, that try to reimplement some Cocoa Frameworks (however they might be Mac OS X only and not iPhone): GNUStep is an example.
But I don't think you get something aquivalent to Xcode (the IDE for iPhone development) this way.
And I think there are some OSX86 Virtual Machines (however these seem to be against Apple's EULA and thus seem to be clearly illegal so I won't point you anywhere to get them).
So to conclude - if you want to develop for iPhone: getting a Mac is the easiest way, even though not cheap.
Hope this helps.
The short answer is - yes.
One possibility for learning some of what you need to know before getting a Mac is GNUstep.
However, GNUstep is mainly useful for learning Objective C, especially since it provides many of the classes that the Cocoa toolkit for iPhone does. This can be run on Windows.
It doesn't, however, support some of the key 2.0 language features that are used 'all the time' in any sample code.
What it will allow you to do is design a UI using their UI designer GORM, and use a near-identical message-based system for implementing a UI, and you could theoretically write Objective C classes in GNUstep and then use them on iPhone.
However, to compile an app for iPhone you basically need to have a Mac, because then you can get the key for signing an app, etc. Since you need to get a Mac at some point, there's really little point in going the much harder route of using GNUstep first and learning a more limited implementation, unless you really need to get started before funds are available.
Despite the new SDK terms that can other programming languages, if you're really wanting to start without a Mac, I'd probably be tempted to look at something like Unity, or perhaps even Appcelerator Titanium, and figuring out all the non-platform-specific logic first on whatever platform (Unity has a free version that can be run on Windows, for example).
I'm not that big a fan of xcode, but is is far and a way the best IDE for Objective C development simply because there's almost nothing else out there.
There are, as always, other options. If you do a web app type project, you can implement the website and test a lot of it in a browser. Furthermore, since Android and iPhone browsers are both WebKit based, you can use the free Android SDK to see what pages look like on a comparable mobile device. And since you can use C and C++ classes as well as Objective C (N.B. not for the GUI, since that needs the Objective C extensions for messaging between objects), another option for making a start without a Mac would be to use Eclipse, QT Creator or some other C/C++ IDE to implement non-GUI classes, so long as you make sure you don't use platform-specific libraries.
But the end of the long answer is still that whatever you do, to compile a proper iPhone app you'll be using xcode and associated tools to finally build it and sign it, and so you need a Mac in the end. If you want to create something targetting the iPhone and won't have access to a Mac, then perhaps you're best off looking at creating an iPhone-adapted website using iui or a similar toolkit to give the site a suitable look and feel.