How to blow up 2 computers in 2 weeks…(the the ballad of the spare computer)

The reason for this post is to pose a question.

Would it would it be wise to have your software, OS et al as an image, that you add to when you buy something new? Use something like Ubuntu and run Windows as a VM? Keep a backup of the image somewhere like a DVD or such, so that if you happen to have the following occur, you don’t end up wasting half a month getting back to where you started.

It all began some time about a month ago…

So there I was, happily designing away – not thinking much about much (im a designer after all :) ), and all of a sudden, my computer (12 months old) decides to restart itself. I figure, I must have somehow picked up one of those automagic viruses that does this kind of thing, and cursed my luck.

So I wait for the computer to reboot.

And I wait, and wait, and wait some more. Nothing. As far as the computer is concerned, it’s life ended then and there. Not that I knew any of this. So I decide to try some things…

  1. make sure the power is turned on and connected and the circuit breaker hasn’t been triggered – seems fine
  2. try restating the computer again.. hmm, the light comes on, but the HDD doesnt make its usual spinning sound
  3. bite the bullet and open the hood

Now, at this stage i’d like a disclaimer. While I might not be a mechanic, certainly im NOT completely stupid… or so I thought. So anyway, open up the belly of the beast – no funny smells, stuff spins and whirls when the power is turned on… but still nothing. I try a few more things :

  1. Remove some ram – no change
  2. swap out HDD – no change
  3. replace video card – no change

Then its down to last resort – replace the power supply. Now, you’re probably reading this and thinking, yeah I would do the same. Well… let me give you a bit of free advice, DON’T! Because chances are, the same thing will happen to you. That is, the new power supply will actually work.

Why is this so bad? Well, considering that the old supply had already shorted out the motherboard, by plugging in the new supply you are deliverring an electric shock to a patient standing in a puddle of water!!! No sooner had I flipped the switch then the RAM caught fire, and acrid smoke began to plume up and out into the office. Not nice.

So, my boss being the standup guy he is organises a new computer for me. Very nice. One of those Core Duo’s crapping RAM and generally being a famous machine to work with. OK so far. Loaded up with all the apps, plugged in old HDD for easy access to files (thankfully not lost – even though we use SVN there are always gonna be working files that don’t get versioned), in total a process that takes 5 days (if you include not having a computer for 3).

All’s well in the land of the interactive designer… or so I thought.

Not 2 weeks later, im pressing the SHIFT key in Illustrator (ed – used for dramatic purpose), and WHAM! Oops, I did it again. Exactly the same symptoms. Bastard. At least this time it’s under warranty. But could you believe it?!

Anyway, im rambling. Better get back to it… my second machine comes back from the doctor today, so I only have a few hours left to use this, the mangled remains of my first machine with a new motherboard et al, before I move yet again….

I pose the question to find the answer. How can we minimise these sorts of interruptions – for me it has spelt 2-3 weeks of having to float around the office on other peoples computers. One of my work collegues has already gone down the Ubuntu VM path, but he has to use less OS dependent software than I (read: Adobe). He seems satisfied with the performance though – and IM a big fan of Ubunutu. What do you think?

More Ruby links…

A few links you might find relevant while absorbing the Ruby machine. You could get these from Google – or if you’ve stumbled here, from me instead!

There are more, but I havent read them yet, so don’t know if they are any good. Happy coding…

ooh, is that a server I see before me?!

So, the plastic has been taken off and the foam all broken apart to resemble a winter wonderland, and it’s back to business as shiftperception celebrates it’s first day on a new and entirely local server. IF all has gone according to plan, the only difference you’ll see is this post – otherwise im typing into the old site, and this post will never be seen. Spoooky….

Paper Cuts

giaitrivietnam.net has some amazing positive/negative space paper cut artwork (thanks OJ). Seriously cool.

BlackApache gets a makeover…

Ill be brief. OJ at BlackApache has updated his site, and will be bombarding us all with the sounds of one hand typing in the woods. Here’s a picci of his ugly mug just cause I can (and of course the lovely Amy) :

Ruby’s first day

So, I had my first day hand-in-hand with Instant Rails today. Following the tutorial I managed to get all the way with only a few minor hickups (read: leaving for a few hours, coming back and starting from further down the page and missing a few important lines), which I think is pretty good.

Sure, its not rocket science when you are following on with the tutorial, but it’s a pleasant feeling when the ideas begin to stick. Anyway, here’s what I know, -which is nothing new to
others doing the tutorial:

1. The model
I guess you could call it a data binding. Its a file that connects a table from the project database, to a controller.

2. The view
This is where the HTML markup gets stored. It *does* have some Ruby logic in there, but only for display purposes.

3. The controller
I guess this is like the brains of the operation. It’s the logic.

Tie them all together and you have something like : Bob goes to www.site.com/products. Ruby goes and looks for a controller called “products_controller”, which has in it an “index” definition. This definition attempts to retrieve data via the model “products” and then Bob sees the results of the query because of the template called “index”. A little confusing at first, but then I got the hang of it. And then I realised i’d seen something like this before…

I realised that I’d used a very similar concept to MVC when designing and implementing utsdesign. I had decided then to separate all the logic into one set of includes, templates into another, and then control how dynamic data gets fiddled with in one central location. The first big difference to that approach and Ruby is that in Ruby you don’t really have “pages” like index.php. Instead you have those def calls in the controller. Which is a much neater way of doing things.

Anyway, that’s day one of my learning. A good start.

Flash isometric engine

At the start of this year I began work on an isometric engine for a Flash game I was developing at work. Now there are heap of books that deal with the logic of game dev in Flash, and to get me started, I went out and bought Flash game dev demystified.

Now, because I was specifically interested in isometric engines, and knowing a fair bit about Flash already, I thought that reading the whole book wouldn’t really be a worthwhile experience… but I was wrong. It turned out to be a great read, and even though in my engine I didn’t really use much of the new knowledge I gained, it certainly helped round out some missing information – in particular basic physics.

Another good source of information was the web, most notably Kirupa, a site which continues to be a great source of information and techniques, and includes posts from the endlessly giving Senocular. There were more, but I can’t lay my hands on the addresses at the moment. The important thing to note though, was that both the books and the web had similar and differring ways to approach the same problem – which is a truth for EVERYTHING in Flash. And by exposing myself to them all, I was able to understand enough to get me a long way into my own attempt at an isometric engine.

So, why the rant? Well, I wanted to share with you some things that I’ve learnt from the experience, and for what it’s worth, here they are :

NB : The isometric engine I worked on was for Flash player 7. If you were unaware, Flash player 8 and above do many things MUCH MUCH better than 7, and this information is probably irrelevant for the newer Flash players – but very relevant if you are still making content for Flash player 7.

1. Optimizing code performance at runtime AND at compilation stage.
I was fortunate enough to come across Odd Hammer which outlines various techniques to make your Flash movie run better when exported from various Flash IDEs. Ill let you read al the good stuff there… its well worth it. What I was unaware of was that writing things in different ways at author time could effect quite dramatically performance at runtime.

2. Extensibility
I stuck with XML to feed my engine. It began using a similar format that other engines used, but as I wanted to add more interesting interactions, I found that I had to extend it. But thats the beauty of XML. On that same token, I also load all my tile artwork in at runtime, so that I can have various levels each with their own look and feel, and not affect the base file size of my SWF.

3. Limitations
The biggest limitation to the approach that I took concerned controlling the speed of the action. Because I introduced depth (that is, stepping up or down stairs or a platform) it became impossible to control the speed of character movement in the isometric world more than regular speed and half speed.

This was because if I moved a character in any direction at less than half a tile’s size, at some stage he would be slightly over the next tile. Normally, not a problem. But because in my world that next tile could also be a step up or down and in any direction, this meant I had to manage the swapDepth of the character in relation to each individual tile, rather than just a single movieclip containing the floor.

4. Artwork and workarounds
The engine I made was designed to have many levels each with different artwork. One thing I tried to do was make producing each level as easy as possible. I explored making a level maker, but time didnt allow. Also, I thought that it would be just as much work to make it as to make the engine. So, what I wanted was for the design of the objects that live in my world not be too difficult. IE, I didnt want the designer to have to cut each piece of artwork up to the size of the tiles and then have me recreate it
in Flash. So instead, I made a workaround that allowed for an object to be placed in the world, via an XML description of where it lived, and what tiles around it would be unwalkable. Flash did all the rest.

5. Link
Here is the engine in all its glory. Im pretty happy with it – i know it could be improved greatly, but I think for what I wanted from this project, it is a good result. I cant show the code for the project im afraid, seeing as it is a commercial project, but it follows the same ideas as outlined in the links above, with some small differences.

6. Future
There are examples of Mario-style 3D from many years ago, like this one, that make my little iso world seem old hat. And now, there is soo much more chances of developing cool and interesting 3D things for Flash, specifically because Flash 8 has added bitmap caching and blitting et al, that improve runtime performance exponentially. (some links : here, and here)

All this means more chances for us Flash developers to do cool things. It’s just a matter of the right output for the right project.

SWFObject for WordPress

Just testing a new plugin I downloaded for WordPress to insert Flash objects using SWFObject. If you can see stuff below, then it’s worked :) Find out more here
[kml_flashembed movie="/blog/swf/test.swf" height="150" width="400" /]

Ruby on rails

So, im sure im probably about a year behind the rest of the world… but I have started in ernest to learn the magic and mystery of Ruby on rails. For those (like me) in a wooden box with no window, Ruby is a server language (like PHP or *cough* ASP) and Rails is a framework that helps plebs like me to develop things faster and stronger.

Anyway, as part of my role at Red Ant I’ll now be honing my skills and posting some interesting experiments and progress reports as I go. I’ll be using Instant Rails, which has Apache, Ruby, MySQL, Rails, et al, all rolled into one small little folder. No nasty installs to worry about. I’ll prob use SqlYog to modify my databases, and a basic text editor for the code.