Thursday 16 June 2011

Swiss Army Computer

It might be apparent that I think every OS since the abacus has been an increasing pain in the arse, but it has to be said that some modern developments mean even the heavier contemporary OS has enough advantages to make it useable.
At the start of the year I was dipping into Ubuntu as a breath of fresh air from my otherwise stale Windows 7 desktop and I've continued my affair with Ubuntu through a VM so its become more of a launched application than operating environment, and its also meant I can try builds of ChromeOS and other Linux flavours to keep up to date.

Added to the VM belt has been half a dozen OS choices, including WindowsXP which has provided the unique ability to install applications and trial them without polluting an otherwise pristine Win7 setup.
The routine is rather neat - you clone your fresh-os-install VM image and install demos, trials and apps. Given Uninstall wizards tend to be more akin to Tommy Cooper than Mary Poppins in their ability to perform cleaning magic, keeping Windows skippy is all but impossible and the OS eventually gets bogged down. So you reformat and reinstall - Except this is VM, which means you only have to delete the OS and clone the fresh image again. The process takes about five minutes and you have a fresh windows install to use.
Better yet - because I've done the install once it already has its drivers perfectly configured, Chrome is installed, Acrobat Reader, Antivirus and firewalls are already up. Better yet, I'm just copying an OS image, so I can do this without rebooting and without a minute of downtime.

The surfing/browsing experience inside a fullscreen VM is seamless and secure. Day-to-Day operation is confined to a walled-garden super-sandbox that has no access to your hard disk, documents, or personal files. Want the best of both worlds? Switch to your OS of choice and take a stab at anything with your new swiss-army-computer.

As you can imagine, by now my Host OS doesn't have much installed. There are a few apps I want to run without a VM in the way but its fairly minimal.

Playing with VMs has lead to me a rather startling discovery though, one which I really didn't expect. It turns out, your OS choice doesn't matter as much as you think it does. With more and more apps running online, its only the hard-hitters that are restricted to one or two OS options. Everything else 'just runs'

LootBox

Each passing day, week, month or year has seen the occasional upgrade of my PC. Often to quiet down a noisy fan, sometimes in the spirit of moving with the times, other times for the sugar high of a new purchase feeding the construction avarice. At each step I am tinkering with machined aluminium and a servant to the sleek silicon-and-steel overlord and its maintenance.

But a change has come and now all is quiet and still. The process has always been the purpose - differential diagnoses, research, budget, purchase, construction and satisfaction - but the journey inevitably comes to an end, and it has - for the time being - led to a box of loot that does its job very well indeed.

The paper specs currently read well enough. Its no supercomputer, but each component has a story behind it. In an age of minitureisation, I bought an oversized monolith of a case - not my smartest move ever but I wanted space for a HDD enclosure, DVD drive and 3.5" external slot - that culled a lot of options. I wanted holes for water pipes, too.
The HDD Enclosure is loot in itself, almost silencing the WD Green drive inside - again an extra 1.5TB of loot. The DVDRW drive has been replaced with a Blu Ray drive. The external 3.5" is a card reader, not floppy drive. In this way, every component has come along one more step that its 'default' configuration.

My solid blue-veined throbbing tower is a Zamlan Reserator, replacing a Domino ALC watercooling kit in a lootier-than-thou upgrade to cool the GPU and I'm considering a Northbridge block because the now fanless-and-silent case has quite low airflow.

Corsair provided 8GB of RAM, although I have yet to fit the optional cooling fins they shipped with. 8GB isn't that looty in this day an age, but at the time or purchase it was quite respectable and is going to be more than enough for a while yet.

While the extra RAM is to reduce paging, a pair of 180GB OCZ SSDs speed up /swap no end. Despite its finite write cycles, SSD makes great swap because of the fast access and zero seek time. When paging to disk, the computer becomes throttled by the HDD seek time not the bus bandwidth so the <0.1ms seek time equivilent SSD beats the >9ms average HDD seek and is a hundred times faster. Actually its a hundred times not-as-slow, which isn't the same as a hundred times faster but still pretty good going.

A third lone Crucial SSD serves as a Boot drive. While OS boot isn't as performance critical or capacity limited as /swap it's worth noting that even a single SSD is bigger and faster than I need for boot so I'm quite happy with it.

The zero-noise build policy has informed a number of decisions, so its a reduced power rig not a super computer. Four Cores and 8GB isn't a monster in this day and age, but the machine is built for shiny things and loot rather than for brute force high-performance and its more than fast enough with no shortage of RAM and fast disk access. Its cost a few extra quid here and there to put the computer together but its been spread over a few months and you start noticing the improvements straight away.

Overall if you are building a rig or just tinkering with upgrades, consider RAM and SSD Raid to make it less slow which is just as important as making it faster. Buy loot because its shiny, because you want it and because you are worth it.

The weird thing about having 'finished' construction, was realising that it was the constructing that was fun. That was the driving force, not the end result. Now I've got an end result, I just don't know what to do with it - its the end of the chase, once you've won there is no more "looking forward to winning" feeling. But on the plus side... winnzies for me!

Homebrew Programming

Sometimes I write code at home. Often its a sample, example or fragment. Sometimes I'm working from or writing to a tutorial. Maybe I'm sharpening my skills and every now and then its recreational. Homebrew for me tends to be a quite polarised affair - its either VERY close to my day job, solving the same problem a different way or just exploring the problem domain - or its that I've chosen to tackle something that I'll never get paid to do.

And this is one of those times, except I've let it run away with me. I stated glancing at the code I've got scattered around there are classes for a simple physics integrator, some camera code, an input tutorial I wrote for somebody, maths libraries that date back to the 90's, some file IO and resource management. Left over from a previous project I've got some network replication and RPC code I wrote, and last Autumn I wrote a streaming perlin-noise landscape.

So it wasn't long before I realised I'd accidentally written a game - or at least most of it - piecemeal over the past few years. In fact, just adding a message pump and sprinkling it liberally with Dependency Injection provided a mulitplayer first-person sandbox I can use to write a game.

What I can't get over is how similar foresight and hindsight are when you are writing code. Knowing the author and intentions of each system in a codebase really helps, but believe me - you don't want to live in this guys code - or his head. On the plus side, he wrote a lot of code and quite a bit of software. It all 'works' and is an entire working games codebase with an example game sitting on the top - but some of it feels like legacy code rather than a lean games API.

Oddly though, the project is coming together - so much so that I can't put it down. Every now and then I open up the project and tinker a little further. Adding something small, contained and complete.

Each of these steps has been reasonably self contained and a brief retrospective revealed that I'd fallen quite comfortably into agile habits as I've bounced from feature to feature. The discipline is getting each step "just working" with minimum effort, regulated by user-story based production.
At each step I've started with the Statement "I want feature X so I can get result Y" and attempted to follow the shortest stable path from here to there.

Agile does make programming games even more fun, and I've never had a satisfying goal further than arms-reach away. After sprint four, I realised I was cherry picking items from the backlog rather than taking the highest priority item so sprint five was a backlog-clearing exercise of assorted odds and ends that I had been avoiding. The few sprints since then have been quite clear sailing, and the empowerment of always doing something important combined with constant drip-feed satisfaction keeps momentum quite high. I'm now finishing Sprint thirteen, with a large product backlog to choose new features from and invaluable feedback from a couple of players.

By working in a free, almost goal-less manner, I've scored more goals than this metaphor makes sense. I've gone from a single rendered triangle through to a 3D world made of bricks where you can construct and shape the world in a first person perspective.

Watch this space. Its evolving.