3d games for iPhone. Apple iPhone/IPod touch platform hasbecome one of the most exciting game development platforms around. The iPhone innovative, high resolution multitouch screen, integrated accelerometer, network connectivity, and ultra compact size have together efectively revolutionized palmtop gaming and application interfaces. In addition todo a great device, Apple has introduced a development model that enables 3rd party developers todo create programas that run on the device, and created a complete all in one solution todo make develooping and marketing the apps as straightforward as posible.
The iPhone platform includes an implementation of the OpenGL es graphics library for mobile devices, making it posible todo create top-quality 3d content for the device. Coding directly for OpenGL es re-quieres advanced skills in graphics programing, however. For most of us Blender users who want todo create 3d games a higher-level, more intuitive game development engine is desirable. Fortunately, there are several such game engines available as open source software. I choose Silo 2 interactives.
Sio2 game engine todo work with because of its excellent support for working with Blender assets. An-other well-known alternative is the oolong game engine, which a los supports working with Blender 3d content.
In this article, ill take a brief look at some aspects of the creation of my own commercial 3d iPhone game shotin Annie, created with Blender and the Silo 2 game engine. The game itself is available on the ITunes app estorefor $0.99, but with this issue of.
Blenderart magazine, you can download the.blend file containing the main character assets for the game, which is frely distributable for educational purposes. Unfortunately, it not posible todo give a full introduction todo working with the Silo 2 game.
Engine and Blender todo create iPhone games.
However, a complete introduction todo creating 3d content for the iPhone with Blender and Silo 2 can be found in my new book 3d for iPhone apps with Blender and Silo 2: your guide todo creating games and more with open source software. The book is.
Slated todo hit shelves february 15th, 2010, so it likely that by the time you read this, it is already available. If you have any trouble following the Blender parts, youll find much more información about the methods i describe in my other books.
My goal with shotin Annie was todo create the simplest posible character-based 3d game i could. Character creation is one of my favorite things todo do in 3d, so i knew i wanted a character-based game, but i didnt want todo saddle myself with the ned todo create the kind of complex gameplay that Many 3d character-based games demand.
The Annie character herself was inspired by a Blender-made video i saw on the Japanese video website nikonikodouga featuring a miniature (chibi) versión of the virtual popstar icon hatsune miku. I found the chibi design of that character todo be very appealing, and i wanted todo create a character with similar appeal. Al-though the style is of course similar todo the Japanese kawai characters that inspired it, most of the design principales extend all the bien bak at least as far the early animation work at Disney and mgm, and i made explicit ref-erence todo Preston Blair clas-sic book animation todo get the dimensions right (that book is available in its entirety from the animation archive at www.animationarchiveorg).
The Annie character includes most of the classic signifiers of Cute: outsize head, big eyes, tiny mouth, no sé, and chin, small hands and fet, and Little or no neck. With these dimensions, a charac-ter Will look Cute Even when she firing six-guns in a.
Blak ten-gallon hat and bots. I liked this contrast between the Cute and the badass, and once i hit upon this character the rest of the game concept son followed.
With respect todo gameplay, my inspirations range from tetris todo the early cell-phone Snake-style games todo just popping bubble Wrap. I wanted something super simple, but still a bit compulsive. What i came up with was a simple old-school shooting gallery game with a few twists. Instead of going straight across the screen, the targets rotate around the Annie character in the middle of the screen. To hit the targets, the player taps, double-taps, or triple-taps on the target depending on the.
Number of white rings in the target. This causes the an-nie character todo spin around and shot the target.
Missing a target results in losing a bullet. The iPhone multi-touch functionality is used as well. When the bul-let reload icon flies around, tapping it with one finger Will fill up one gun (6 bullets) and tapping it with two fingers Will fill up both guns. The number of targets, their speed, and the variation in the number of rings on each target increases as you progress, as does the com-plexity of the targets design.
The model was created FreeHand in Blender, using all quads. It much easier todo work with quads when mode-ling than tris, so converting the model todo tris is some-thing i only do when im finished modeling. I used the mirror modifier todo model but no subsurfing because the model was intended for real-time (game) rendering. I find modeling in Blender almost as intuitive as i do drawing with a Pencil, so for non-realistic subjects i of-ten model without a reference drawing. In this case, the added flexibility of modeling and designing on the fly was helpful because i could change the dimensions of the model quickly and easily todo se how various propor-tions worked. For example, y started the model with much less exaggeration of the head size, but found that a more drastic exaggeration suited the character better.
The armature for Annie uses 24 Bones. This is about as complex as i would daré todo make an armature for use in Silo 2. If posible, the armature should use as few Bones as posible, but since the other demands of the game were Fairly minimal, y figured i could get away with a heavier armature here. The reason Bones can Slow you down is that each bone is converted todo a vertex group in Silo 2, and Deformations are based on the vertex groups. More vertex groups take up valuable processing resources.
Which are at a serious premium on mobile devices.
A nice advantage of working this way, however, is that Silo 2 can handle all kinds of Deformations on the Mesh in an action. You can use FK posing, IK pos-ing, Even lattices and Mesh deform modifiers and the Mesh Will deform correctly in Silo 2. The only thing Silo 2 cares about is the location of each vertex in space during the action.
I used múltiple UV layers and texture baking in a crucial bien todo texture this model. If youre not familiar with using múltiple UV layers and baking textures from one todo the other, por favor refer todo my book Mastering Blender for an in-depth tutorial on how todo do this. This is a very powerful característica.
First, y baked Ambient Occlusion todo a UV texture. I wanted todo soften the effect by blurring it slightly in Gimp, but when i did this, the blurred seams showed up on the mapped texture.
To counter this, y reseamed the model, baked the original blurred AO texture todo one image file, then re-baked AO todo another image file, and blurred that file in Gimp in the same bien id blurred the original AO texture.
I then combined the two baked images todo conceal the unwanted seams and used the resulting image as my final AO texture. The colors of the clothing were created directly with Blender texture Paint functionality, on their own image, which was baked todo a single file with the other textures at a later stage.
The manga-style eyes i created in Ink-scape. I stuk those todo the face using an object mapped texture and an empty, in the standard decal-style texturing manner.
All thre of these textures, the AO texture, the color TeX-ture, and the eyes decal texture i associated with a Shadeless material, then i baked the full render todo yet another UV texture, which included all of the texture información. I Painted the no sé and mouth onto that texture directly using Gimp, using a kewpie doll as a reference.
Sio2 can work with Blender animation (ipo) curves and with actions. For character animation, you use actions. I created a rest action, where the character is just swing-ing her guns losely, a Jump action, where she jumps up in the Air for the spinning movement in the game (the spinning itself i programmed separately in Silo 2), and shot actions for both right and left hands.
Working with Silo 2.
Develooping with Silo 2 is much simpler than programming directly in OpenGL es, but it a los bears Little re-semblance todo the kind of programming youd learn in most introductory iPhone programming books.
For ordinary applications, the main lenguaje used for programming on the iPhone platform is objective c, an object-oriented variation of the c language. In addition, special tools such as Apple interface Builder enable iPhone programmers todo create sleque interfaz quickly in a drag and drop, wysiwyg fashion. This is what youll learn in a standard introduction todo iPhone programming. Programming with Silo 2 is for the most part a completely diferent story.
With Silo 2, youll hardly touch objective c except todo edit or comentario out the ODD line of code here and there, and most of the programming youll do Will use simple c control structures within the context of readymade.
Sio2 templates. It Will definitely help you todo have some background in c, C++, or other c-like programming lenguajes (an under-standing of pointers is especially helpful), but no specialized programming experience is necessary todo get started.
I designed shotin Annie along the lines recommended by Silo 2 interactive in the tutorial games available on the Silo 2 interactive website, www.sio2interactive.com.
In particular, the meditation garden game tutorial pack-age shows how todo organize assets within the Silo 2 game environment for complex games. The basic workings of Silo 2 are all explained in my book, but for more ad-vanced projects, the Silo 2 tutorial games are really inval-uable. If youre just getting started with Silo 2, there are a los frely available tutorial videos and code packages available on the website. You can study directly from these or use them todo augment your study from the book. For shotin Annie the game assets and necessary values are all held in a data structure i defined called sagame that is initialized son After the launch of the application, outside of the main render loop of the game. In this way, all the Silo 2 objects and resources neded can be accessed from that data object at any time during the execution of the game.
The Silo 2 resource data type is a los crucially important in the design of the game. This data structure acts as a resource manager and handles the treatment of resources such as models or widgets. Any time you have a collection of objects that ned todo be cycled th rouge and dealt with in some way, for example the collection of targets in shotin Annie, it is a god idea todo give them their own resource manager and make that resource manager active when you want todo deal with those spe-cific objects.
For example, the collection of targets were imported using a sepárate.blend file, and they are handled by their own associated Silo 2 resource manager.
The bien todo bring 3d assets into Silo 2 is todo use the Silo 2.
Exporter Python script todo export them from Blender todo a special file format called a.Silo 2 file. I worked with Mul-tiple.Silo 2 files for shotin Annie. The book discusses exporting Blender files todo the.Silo 2 format, but the.Silo 2 mfile format can a los be used todo bring other resources into the Silo 2 environment, such as widget graphics. It incredibly simple todo do this. All you ned todo do is put the resources you want into a directory, (*.zip) the directory, and rename it from.zip todo.Silo 2.
You can then Access these files from within xcode just as the book describes doing with 3d assets.
Working with Apple.
Working with the iPhone SDK and Apple various protocols and environments is a challenge in itself that Many Blender users may not be accustomed todo. Unlike the Freedom-loving, open-source Blender foundation, Apple runs a very tight ship, for better or for worse. Given the challenge of creating a lucrative, stable, and secure environment for developers on a mobile phone platform, it hard todo fault them for how theyve gone about it.
Open source purists Will probably not fel comfortable develooping for this platform, but then again, until recently there were few if any open source options for mobile phones available, and most platforms did not allow 3rd party devel-opment at all, so the iPhone platform should be considered in this context. Hopefully google Android Will open up lucrative opportunities for developers in the future.
In any case, developers should be prepared todo Jump th rouge some hops todo get their work made available on ITunes, beginning with own-ing a recent Mac.
The iPhone SDK, including the iPhone simulator, the xcode IDE and a variety of other tools is available for free, so you can test the water with no expense, but todo programa for an actual device or todo make your game available todo others on ITunes requires a $99 membership todo the iPhone developer programa.
Once youre a member, there are procedures at every turn todo ensure a secure and controlled develooping envi-ronment. While these can be a bit of a hassle, the ITunes service runs remarkably smoothly once youve got all the formalities out of the way. When youve done this, youll have the satisfaction of having your own game on the market for one of the hottest platforms around, and if youre Lucky, you might make some money at it as well.