Dreamhost SVN catastrophic failure

Posted by Cory Petosky Tue, 26 Aug 2008 17:25:00 GMT

I did a stupid thing. That said, I was using an idiot-proof web interface and it let me do it, so I figured it was cool.

I wanted to password protect subdirectories within my Subversion repository. Accepting from the beginning that this isn’t possible in the literal sense, I went for the next best thing – making repositories mapped to what appear to be subdirectories of the base repository. I could then set these ‘subrepositories” to private, and give the illusion of a seamless repository with private subdirectories.

This worked for a while, and then suddenly (a month later when I checked it again) all repositories in the system were totally wiped.

This is a Dreamhost Happy Subversion Robot issue, not an issue with SVN in general. Tech support says “you shouldn’t have done that.” I’ve lost a year’s worth of accumulated Flash code.

Don’t do what I did.

I still think Dreamhost is awesome, despite this loss.


New house pictures

Posted by Cory Petosky Tue, 26 Aug 2008 02:41:00 GMT

I recently signed a purchase agreement on a new townhome – I should close on October 7th and move in as quickly as possible afterward. I snapped some pictures of the model home, which is exactly the same floorplan and basically the same options as my in-progress place, and I also took some pictures of my actual unfinished joint for good measure. Have a look, if you’re curious.


Making friends with binary representation

Posted by Cory Petosky Fri, 22 Aug 2008 02:46:00 GMT

This post is inspired by Nick’s aversion to bitwise operators all over the place. Despite this glaring personality flaw, he’s still worth hiring.

Many developers, and unfortunately almost every Flash developer, are far too comfortable with their abstract data types like double and int that they forget that, under the hood, everything’s stored as binary numbers. Having just a little knowledge about how things work under the hood makes you write better, faster, cleaner code.


Dungeon -- a Flash random dungeon experiment

Posted by Cory Petosky Thu, 21 Aug 2008 20:51:00 GMT

This is about 8 hours of work, porting Jamis Buck’s dungeon generator from C to AS3.

There’s no goal, as this is only an experiment. Apologies to Gauntlet, from which I ripped some quick graphics. The minimap doesn’t show your position, but rest assured it is accurate, and after running around for a few seconds you should be able to extrapolate where you are.


Clone -- a Flash Puzzle game

Posted by Cory Petosky Thu, 21 Aug 2008 20:38:00 GMT

This is a game I wrote in about 24 hours total. Mitch from Puny Entertainment did the artwork – those guys are awesome and Mitch doubly so!

Get points by making rows or columns of 3 or more clones! The clones are defective and, when matched with their unstable brethren, obliterate eachother and disappear. Get more points by matching bigger groups – a group of 10 with one swap gives ridiculous points, especially on higher levels.


Laid-back file loading in AS3

Posted by Cory Petosky Thu, 21 Aug 2008 20:09:00 GMT

This post is in response to Nate, who asked me this question a few days ago.

If you load a file using AS3, there are a couple of potential outcomes –

  1. The file exists, you have permissions to access it, and it completes successfully! Hurray! The URLLoader dispatches an Event.COMPLETE.
  2. The file exists, but you don’t have permissions – the URLLoader dispatches a SecurityErrorEvent.SECURITY_ERROR.
  3. The file doesn’t exist, or you otherwise can’t access it – the URLLoader dispatches an IOErrorEvent.IO_ERROR.

Flash is an incredibly event driven framework. Everything seems to dispatch an event or five. Most of these events you simply ignore, because nobody really needs this level of information. This leads to a tricky situation, however, when the default event behavior (just ignore it) doesn’t work.

Specifically, ErrorEvents and their subclasses, if not listened for by something, will pop up an error dialog to the user. So, in the case when you’re loading a file, but you don’t really care if it exists or not, you actually have to listen for IO and security error events, and explicitly ignore them, for the usually-default event behavior to work.

More generally, there are two sets of event behaviors an AS3 developer needs to know:

  1. ErrorEvents (and subclasses) must be listened for if they’re to be ignored, otherwise the user gets a error box.
  2. Events (and non-ErrorEvent subclasses) can be ignored without repercussion.

Welcome

Posted by Cory Petosky Thu, 21 Aug 2008 19:44:00 GMT

This is a website about game programming in general. As I currently work in ActionScript 3 professionally, many of my examples will be in Flash. I will occasionally post things of interest that I come across or invent.