Archive for August, 2008


I broke a lot of stuff this weekend working on NetSketch. I’m not all that familiar with threading, and I wanted to add some progress indicators for long redraws. I ended up doing it a couple times, but it finally works. (You can cancel it half way through the redraw process and everything). For the longest time it was leaking memory, but it turns out I just forgot to call [pool release] when the thread received a cancel message. Oops :-)

Opening a 6MB drawing and immediately interrupting the drawing – no leaks! Finally…

Another great review!

I did a Google search for NetSketch a couple minutes ago (c’mon – I have to do it every day, right?) and I found this great review: 4.75 stars out of 5! I’m psyched :-) . It’s a bummer that the App Store pushes traffic off the web into iTunes, because I think people don’t read a whole lot online about the apps they buy. Could be wrong though – and good reviews certainally can’t hurt!

I’ve made some pretty huge changes to the app this week, including a few fixes that will give it a nice big performance boost :-) I was using an NSDictionary to store the strokes in memory, and then sorting them by key (a timestamp) when I needed to do a full redraw. The sort was necessary, because strokes coming across the network might be placed out of timestamp order, causing incorrect layering. I scanned through the entire drawing architecture, and it turns out I wasn’t performing key->value lookups in the dictionary very often. When they were being performed, the stroke being requested was usually one of the last few added to the drawing. I converted the NSDictionary to two NSArrays – one of keys and one of values. I decided to keep the entire structure sorted all the time, and wrote a modified binary search function so the most popular key-value lookups were really fast.

Should be a good update :-)

Maximum brush size in Flash

I’ve been having a lot of trouble with Flash recently. This weekend, I discovered a line size limitation that doesn’t seem to be documented anywhere. Unfortunately, was already live and people’s drawings were being rendered incorrectly. The goal was to create an online Flash viewer that replicated the behavior of NetSketch on the iPod. The iPod app supports infinite pan and zoom, and often it’s not possible to render things to a jpg. It’s just not the same. I wrote a small flash “viewer” that loads an XML version of the drawing and allows you to pan and zoom through the drawing the same way you do on the iPod.

Here’s a sample of the Flash viewer:

The problem is, lineStyle() in ActionScript 2.0 will only let you make lines with a stroke width less than 235. Yes… 235. I have no idea why, but I tested at increments of 5 and after 235 the line just stops getting bigger. In other words, these two statements produce the same result:

line.lineStyle(235, color, 100, false, "normal", "round","round", 2);
line.lineStyle(300, color, 100, false, "normal", "round","round", 2);

The fix turned out to be pretty easy. There’s a backend application that converts NetSketch’s binary vector format into XML, and I added another pass to the conversion process that scaled the drawing so all the strokes were thinner than 235pt… I was already doing some processing to fit the drawings within an Illustrator compatible EPS document (maximum size of 16383 x 16383). Still, it’s frustrating that Flash has such odd limitations. I haven’t experimented much with ActionScript 3.0, and I’m hoping that may resolve some of these things…


So it’s week 3 for NetSketch! I got a few awesome reviews on iTunes yesterday that basically made my day:

“Quite a good app. Has not crashed yet, which is better than every single other app I have. Well worth it, especially considering how reachable the developer is and how frequently it is getting updated with new features.”- Crabpot8

“Their website is a fantastic addition to an already great app. I’m on it almost every day to check out other people’s art.” – Obscurum

Somehow, that makes not sleeping for a few weeks totally worth it.  Apple released some sales figures for apps on the store yesterday, and it looks like NetSketch has been running about 60 sales a day for the last week or so. Older data isn’t available (yet?) so I’m not sure how the Facebook ads and initial release went. Guess we’ll see!