Ultrabook­™ Work, Create, Play Challenge - 15mm of Game Dev Goodness

At CES2012 will.i.am expressed that when he grew up, music was made in a studio then played on records, but how cool it is that today music is created on computers and played on computers. I've been thinking about this idea. Can the Ultrabook™ be versatile for other work/create/play scenarios. So why not game development? How well can you both create and play games on an Ultrabook?

Here's the task I've challenged the Ultrabook to complete:
- Create concept art
- Model game objects from concept art
- Code sample game
- Play sample game

So first I set out to find is there a low cost to free sketch application I can use to start testing my app idea. I tried a number of applications but eventually settled on an open source app called MyPaint. MyPaint has been developed for mobile devices and PCs and allows for input using drawing tablets and styluses.

I found MyPaint to be exceptional allowing me to control brush pressure and styles. I have just as much control if not more with MyPaint then paper and pencil. The ability to quickly zoom and provide detail, change colors on the fly and undo make sketching a breeze. I finished a set of doodles to get some ideas out. I believe with an app like MyPaint, the Ultrabook can have you sketch and illustrate virtually anything. The only limitation is the skill of the artist.
Doodling with MyPaint

Within the set of doodles you'll see I scribbled a spaceship, which is based on a vector arcade game I had developed a year ago. I then decided to take the idea further and sketch out a more detailed 3D version of the craft. The Ultrabook made is very easy for me to quickly bang out these idea. I did these over a few hours over a weekend, when I had spare cycles. Never powering down the Ultrabook, I was able to jump right into my app faster than I could on my mobile device.
Altmega1 Detailed Ship Sketch

Next step was to model the object in 3D. I needed an application that would allow me to work with shape primitives and do some boolean subtraction especially to create the shell body of the craft. I looked for a number of simple modelling applications then realized I needed to use something subtancial So I settled on Blender, an open souce 3D application that is on par with 3DS and Maya and used to produce cinematic level 3D films and animations.

Creating the ship was quick and simple. Again I really never shut down my Ultrabook. Like a mobile device I could pick up, press a key and boom I'm in and working in Blender. Having immediate access to a power app like this is SUPER convenient. With Blender I was able to easily create the craft using spheres and boxes. I figure the easiest way to create the body section was to create an elongaged sphere and intersect it with a cylinder. I then used the Boolean feature to cut away the part where the cylinder intersected the sphere. That created the bowed shape of the mid section of my craft. I then applied some procedural textures to give it a real world look.
Ship Rendered From Blender

Now came a decision on how to code an application using this ship. I first considered HTML5 and exporting Blender images as 2D PNG files, to create a top down arcade shooter. I've used Canvas before and I figure that would be pretty simple to do. But in the end I realized a 2D HTML5 app could be built on nearly any device. So, decided to create a 3D game to push the limits of the Ultrabook. So I drove head first into Unity. Good thing, it allows for Javascripting so I didn't have too far to learn how to code for it.

Unity installed like a charm and imported my Blender files, but my procedural maps did not come over. I quickly learned about UV Mapping, to create the Normal (Bump) maps and Texture (image) maps for each section of my craft. After bringing in the texture maps I was able to show off my craft in Unity.

Now to control the ship in my game I would need to add some javascript. I first created simple script to transform the X & Z position of my craft depending on what arrow keys I hit. But I then thought, I'm not taking advantage of the physics engine and really only animating the ship. So I re-coded the inputs to add Force physics to the object. I then added some barriers to the scene with collision component, to interact with the ship via the physics engine. Here's my sample script attached to my ship. With this in place and the ship set with a RigidBody component it properly react to any object with physics.
Ship Movement Script

I then coded a smooth camera follow script based on a sample version provided by Unity. I adjusted the script to allow for X & Z variation in the camera, allowing the camera to follow behind as the ship accelerates away, then to catch up and hover over the ship when at rest. And thus I have the basics of my game. I found I could run in full resolution at a 60 frames per second frame rate. My ship renders nicely with textures and shadows. My ship zips with my camera in tow, rotating and swinging left and right to align to my object

I could do more, to spawn enemy ships, create missiles, add audio events, particle effects and explosions, but that's just an iteration of the work completed. I'm pretty satisfied that Ultrabooks can be used for gaming work, create, and play. Here's a video of the game in process.

Based on my experience I think the Ultrabook is a pretty compelling device, and not just for game developers. You can play the same scenario out for just about any profession, hobby or interest. From will.i.am's perspective he sees the Ultrabook as great professional music studio, and as today's new ghetto blaster. Ultrabooks, as amazing work/create/play devices, have broad potential for app usage across all sorts of interests. For developers this translates to an opportunity.

Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.