Thursday, December 18, 2008

Space Attack!!

I have released my first iPhone game recently, called Space Attack!! Please check it out.

Developing this game in my spare time took me about two months longer then I expected. Between Xcode, Objective-C, OpenGL I had a lot to learn and there is almost no example code online. That is starting to change now as more and more iPhone developers are free to talk about their work. This is pretty exciting, working with Apple's development tools is painful, but you get the feeling there are some really powerful tools that you are missing.

Core Animation is one of those tools I missed on the first game. I have started working on a second (and third, fourth...) game and have decided to use Core Animation for it. It is for a lot more then just animation, it should be thought of as a scene graph API, where you assemble a hierarchy of objects and then Core Animation renders them to the screen. By adding CAAnimations to objects, the scene is animated. This is excellent.

After my 3 frantic weeks working on a JavaFX project for the release, I starting thinking in the JavaFX way, and I think is has spoiled me. Things are so easy in JX and are so hard in other languages/APIs. Core Animation is part of the way there, thankfully, but I really wish I could bind things. that would be excellent.

Monday, September 08, 2008

SSD Thumper

I had a thought today... what could one do with a Thumper packed with solid state drives? With 48 of the 160Gb version of intel's SSD drives, there would be 7680 Gb of storage at an incredible read rate.

Render farms come to mind, as well as video servers or any large data set. I have to see if Sun can configure me one :)

Friday, August 15, 2008

JavaFX and Adobe Illustrator

JavaFX is Sun's attempt at capturing the Rich Internet Application market. Currently the king of the RIA domain is Adobe with it's Flex and AIR products. Adobe is king not because their flash run-time is excellent or because Flex is such an excellent language to work with. It is king because it integrates its creative tools, such as illustrator, into the development process. This integration has made Adobe's products the go-to option for the vast majority of web content developers. Sure there are a few great applets out there, so great, people often assume they are flash applications.

Sun has recently released a preview SDK of JavaFX which includes plugins for a hand full of creative products, including Adobe's Illustrator. The following is a review and critique of how these new tools address the development process.

The required downloads are Netbeans 6.1 with JavaFX and Project Nile. Project Nile is a collection of plugins so designers can export content from their favorite design applications as long as they are either Illustrator or Photoshop.











The installation of both of these components is simple enough and a quick inspection of Illustrator shows that, yes indeed, JafaFX files can be exported.














There seems to be no real guide as to how to set up a JavaFX project for development. Creating a new project in Netbeans sounds like a good place to start, create a project of type JavaFX.












Once a project is created it is worth spending some time to checkout what Netbeans provides. There seems to be a Main class created automatically, there is also the JavaFX Library, please note in the image that the JavaFX SDK is actually running on Java 6, not 1.5, there was some configuration issues leading to this typo.

















Now in Illustrator, create some content. It should be simple to have it displayed in a Java application.

Export the file and save in the same folder as the Main.fx file from the Netbeans project created earlier. Be sure to use Java class capitalization for the file name, as the name of the file you select will be the name of class that is created.













As can be seen a class with the same name is the exported file. The Font used in the content is also exported, which is very handy. The next step is to actually display this content, this is done by editing the Main.fx file to display an instance of this exported class.

Here is the code to actually display the content in a JFrame:

package fxtest;

import javafx.application.*;
import javafx.scene.*;
import javafx.scene.paint.*;

var content:Content;

Frame {
var stageRef:Stage;
visible: true
stage:
stageRef = Stage {
fill: Color.WHITE
content: [
content = new Content()
]
}
}

First is the output from Java and the second is a close up of what is displayed in Illustrator.








There are some obvious fidelity issues, the blacks are not exactly the same, and worse yet, the text layout is messed up in the Java version.

There are also some issue where not all content in Illustrator is exported, try using the "symbol spray" tool to add some tasteful blue birds and export it again. Rerun the Java application and notice there are no birds displayed. Also, notice that the export dialog did not remember which directory you last exported in, this is super annoying.


Pros
It is excellent to be able to produce content in Illustrator, it would simply take forever to create even the simplest content if this has to be done by witting code.

Netbeans is an excellent IDE and a pleasure to work with.

Cons
The development cycle is not well thought out. With Flex, the designers and the coders work from the same source code. This makes things like version control a snap. Flex also allows coders and designer to work with the same tool, enabled by eclipse. It is not clear how an iterative development process will deal with the current system.

The fidelity of the export, coupled with some content not being exported at all, is worrisome. It will be difficult for the designers to produce good content when they can not trust the WYSIWYG tool they are using.


Conclusion
A good start, this is a preview release after all. The cons listed above simply have to be addressed, especially if one accepts the premise that Adobe's RIA technologies are the leaders because of their tool support.