pictures | blog | videos

Archive for the ‘New Animation’ Category

Software Rewrite

Friday, October 17th, 2008

The problem with writing your own animation software is that you have to maintain it.

The software I’m currently using is actually my second generation of animation software. The first generation was written in college for The Emperor’s New Clothes, which was done on a student research grant (let this be a lesson for you kids – you can get money for your films if you call it research!). On that project I was the writer, director, producer, and lead software engineer, so thank god Marshall did the hard animation or the whole thing would have been trash. The quality of code was pretty good for a college student (read: pretty terrible overall), but I learned some good lessons:

  1. Debugging on set sucks
  2. C++ is like concrete in that the code seems completely malleable when you first write it and slowly settles until the mere idea of refactoring base classes is exhausting.
  3. With C++ you spend 10% of your time designing your GUI and 90% finding out why clicking a button is de-referencing a bad memory pointer.
  4. If you put too much of your business logic in the GUI you will never be able to reuse it.
It took me years after college to write version two, mostly because when you are a software engineer by profession the idea of writing C++ GUI code as a hobby is laughable. What got me started again was the discovery of dynamic languages in general and Ruby in particular. Ruby had a modify and try cycle I hadn’t used since Commodore BASIC, and the sexiest syntax I’d ever seen.  Scripting languages of course usually are not powerful enough to do the image manipulations I use, so I have ruby extensions I wrote called videoblox and audiolib that do my image and audio work, respectively. With Ruby I felt like I was liberated from writing monolithic applications; instead I could rapidly develop tools to suit my needs.
There is no such thing as a standard Ruby widget library, so I use wxRuby for the GUI work. Here is where the love affair began to sour. The first problem is that because videoblox and wxRuby had no concept of each other (they existed as seperate Ruby extensions), there was no way to pass an image from one to another except through a file. Rather than suffer that, I modified wxRuby to take a memory pointer for image creation. This led to problem number two – wxRuby has gone through a number of API modifications over time, some of which were complete re-writes. Every time this happens I have to re-patch the system, which can some times cost me a whole week. Thats time I’m not making Monkeys talk.
At this point I’m a number of versions off of wxRuby tips and I can only use my software because it’s quirks don’t bother me enough to get me to fix them. I think it’s time to consider the lessons I’ve learned over the past two years and begin on some new software. The first question I’m trying to answer is: what language will I use?
  • Ruby – Oh Ruby, how I love your beautiful syntax and object oriented ways. But alas, you have too many limitations from a system programmer’s perspective. You don’t support native threads for starters. Extensions can only communicate with each other through Ruby objects which is terrible when dealing with blocks of memory. And you don’t have a great cross platform widget set. Don’t fret: we’ll always have Rails.
  • C++ – I’d heard that C++ was much better than the bad ol’ nineties. It has the STL and iterators and Boost! After giving it another shot I found I spent 10 percent of my time creating and 90 percent figuring out why the hell my application is crashing when I try to print that string. New tools, same problems.
  • Java – Unlike most other languages, Java’s base image library is almost enough to suit my needs. In fact the Java standard libraries have a lot of useful tools. However, GUI code has never been Java’s strong suit; just doing simple tasks requires three or four proxy classes. Plus, after using dynamicly typed languages Java sometimes feels too constrained.
  • Groovy – It’s like Java and Ruby had a fling in Vegas and had a kid. Dave Thomas of pragmatic programmer fame recommends trying a new language once a year, and I haven’t tried something new in a while. I have to admit this language looks really neat – dynamically typed scripting language like Ruby but runs in a JVM and has access to Java libraries. I’m just fearful it is too new to really use.

I’m keeping my options open and focusing on what the application will be first, but when even picking a language is an issue you know this won’t be easy.

Three for One

Saturday, July 12th, 2008

Back when I was in college with big dreams of film making the one book I read over and over was Robert Rodriguez’sRebel Without a Crew“, where he documents the making of his first film “El Mariachi.” Originally he planned to make three low budget films for the Mexican home video market, and by the time he finished the third he would be a real filmmaker. This flawless plan was undone by the small problem that El Mariachi became an independent hit and launched him into stardom.

While I wish he had done two more for Mexican home video before becoming a film wunderkind as none of his following work has had the character of El Mariachi – it’s like his “American Graffiti” – I’m starting to think that I should try his original plan. Animation is pretty difficult and it is hard to put all your eggs into one long work, especially when halfway through you get tired of the characters.

My thought is to take the same set of characters and write a five minute, fifteen minute, and forty minute scripts for them. First, the effort put into writing the five and fifteen minute scripts will be invaluable in working on the forty five minute scripts, especially when it comes to plotting and characters. Second, much of the cost of character development and production design will be front-loaded onto the first two productions, meaning most of the problems will have been solved for the forty five minute production. And if I’m bored with the characters after the first project, it will leave a nice exit point.

In other news, I went back to the KU library to do research on the films. After my initial shock of how everything that has changed at Watson since my time at KU – they have concessions now! – I browsed the dusty stacks until found the books I needed. Special thanks and one up bonus to Brian who came with me and let me use his library card to check out my research materials . The down side is that I need to rewrite everything I’ve written thus far, but I’m getting new ideas about how history can play into the story. Exciting stuff.

What’s in a name?

Tuesday, July 1st, 2008

When I’m working on a computer program, I generally will mull a problem over for a long time, sometimes days, before a single line of code is written. This of course appears to the untrained eye that I am “juggling in my office” or “reading The Onion“, but I want to have a full understanding of the problem and understand all the implications before I begin. When I actually actually sit down at the keyboard, the initial coding often comes out in three to four hours of bezerk code rage, followed by two to three days of debugging.

XKCD!

In some ways the same applies to my writing. When I write stories, I generally have a fuzzy idea of what where I am going to go before one word gets written. I generally have an idea of who the people are and signposts the have to hit by the act breaks. The difference is that during the writing process I have a lot more points where I have to take a break and make a decision that affects everything going forward.

A good example is picking a name for the a character. The character’s name should be just a token that identifies them in the fantasy universe, but actually is much more. Once they have a name they have heritage, background, a family history, something kids made fun of growing up, and so much more. Making that one decision can give your character so much life they may no longer want to be bound to the fate you have planned for them.

In my case, I wanted my main character to name his dog “McGuffin”, which is something of a writers joke. I thought that I could make it work if he named it after a relative, and this introduced a Gaelic heritage to the character. Given he lives in the Old West it applies new rules to him that weren’t there before. It gives whole new areas to explore in the piece that I hadn’t planned on.

I think I will keep hacking away at my first draft, but I’ll need to go to the library as well to do some research. Three pages into the first draft and I’m actually starting to feel like a writer.