Posts from 2009

First days in Aion

Aion login screenshot

I have decided, perhaps foolishly, to start playing an MMO - Aion. If one were to ask the reason for me deciding this, I could not give a single answer. I can quantify my reasoning, but not give a single definitive motive.

To backtrack, I don't usually play MMO's: I haven't played one extensively since Ultima Online back when 28.8 modems were considered cutting edge. I have dabbled only once since, joining the first iteration of Guild Wars, an NCSoft cost-to-buy but free-to-play system that was bought for playing with my significant other of the time; suffice to say neither of us took to it and that experiment ended with a little fanfare. I did hear of Aion when it was released in Korea at the tail end of 2008, although at the time it blended in with the general background noise of the Korean gaming scene of which MMO's play a large part.

I capitulated and purchased the Collector's Edition that had been beckoning to me, siren-like, on Steam
I think one of the aspects which swayed me into at least trying Aion was the aesthetics. Despite my ordinary avoidance of superficiality, I am by nature drawn to pretty things, a severe character flaw I'm sure. So it had crested the first hurdle in getting my attention. The second draw was the pleasant buzz surrounding it, anime and game blogs alike weren't exactly haemorrhaging praise but there was a decent undercurrent to the otherwise acerbic MMO discussion. Partnered with the looks came the lore, typical high-fantasy fare with a generous sprinkling of ethereal names that only just manages to be convincing of when it was conceived: moments before it was decided to be an MMO. And then there was the marketing:

Read the rest of this entry

Evangelion 2.0

Evangelion occupies a very special place in my heart: I watched the series on VHS in 1997 when I was fourteen and - without hyperbole - it was a life changing experience. A series that was smart and brutally obtuse and flitted from Jungian psychology to religious dogma was revelatory for me at the time and it questioned a lot of what I had not yet fully formed questions about; so as well as being gob-smackingly awesome, it changed who I was and consequently who I am. For those reasons I am utterly fanatical about the franchise and concept. Like a delusional lover I put up with a lot of the nonsense that GAINAX throws: I own the original series on twelve VHS tapes which I upgraded to DVD when they were first released, then upgraded them to the Platinum DVDs; I did manage to stay away from the deluge of tat that has been continuously released but it's fair to say my own lot of Evangelion merchandise is not insignificant. In what is a truly savvy move, just as patience for the constant re-releases was beginning to wane news came of the Rebuild project.

If 1.0 was meant to prime the fans for what was to come, 2.0 det­on­ates with mag­num force.
Not just a fresh coat of paint but a fresh take - that was the promise at least. It was hard to get excited, especially when there was also word of a live action Hollywood adaptation bolstered by some mightily uninspiring concept art - the only promise being that WETA are on the case. Regardless, the news came out over a year before the first Rebuild release so there was plenty of time to build up my scepticism. The first movie, "Evangelion 1.0: You Are (Not) Alone" released in 2007, deserves a post of its own and the number of pages I've devoted to notes and thoughts and theories bordering on absurd. The second movie, "Evangelion 2.0: You Can (Not) Advance" released just this summer is easy to write about because I have not yet had a chance to analyse and unpick it as I am wont to do. For want of a better description, this is a review rather than an unravelling.

Read the rest of this entry

Building the carousel

chaostangent.com footer carousel

The newest addition to chaostangent.com is the carousel nestling comfortably at the foot of every page. Sporting a variety of "social media" feeds as well as other morsels, it showcases a number of interesting technologies and techniques including: a fully looping carousel (JavaScript and CSS), integration with numerous external APIs (PHP, Zend Framework), screen-scraping and local caching of results to name but a few. It successfully fulfils the primary goal I had for it: cramming as much functionality into a contained a space as reasonably possible.

I can just boot up Zend_Service_Delicious and be done with it right? If only things were that simple.

JavaScript

The carousel interface is design du-jour at the moment - sported by sites such as Apple, BBC iPlayer and Gametrailers - they manage selective display of information while still providing a high degree of interactivity. In short: they're swish and solve the problem of too much to feature in too little space. The carousel library I am using is a simplified, stripped-down version of one I developed for a large work project - for this reason I'm unable to release it under any kind of license. The original has a number of features that I wouldn't be using including automated construction of a "jump to" control and being able to navigate over a number of entries at once. My library is the only one I know of which successfully loops, providing an "infinite" carousel of sorts; other publicly available libraries cease at either end of the carousel which in some situations is more intuitive but the challenge of making one not do this was posed to me, and I couldn't very well pass it up.

Read the rest of this entry

Tidbits from gallery.chaostangent.com

These are some of the neater parts of gallery.chaostangent.com that don't warrant a full exploration on their own but serve the goal of making the application more streamlined. I've crafted these examples to be focused so they don't contain superfluous details like error checking, timestamp columns and the like.

Database

The gallery schema is as follows:

CREATE TABLE IF NOT EXISTS `galleries` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `left` int(10) unsigned NOT NULL default '0',
  `right` int(10) unsigned NOT NULL default '0',
  `parent` int(10) unsigned NOT NULL default '0',
  `title` tinytext NOT NULL,
  `directory` tinytext NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `parent` (`parent`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ;

This covers both the Modified Preorder Tree Traversal (`left` and `right` columns) model as well as the more standard hierarchical model (`parent` column). I'm still undecided as to whether indexing the `left` and `right` columns provides any benefits. Most of the queries on the gallery table involve getting the direct children of a particular node; the breadcrumb trail at the top of the page however is built using the `left` and `right` columns:

SELECT * FROM `galleries` WHERE (`left` >= ?) AND (`right` <= ?) ORDER BY `left`

Doing a multi-column index in MySQL works from the left column onwards, so for the above query, indexing on `left` and `right` would be a benefit. However when inserting and deleting nodes, queries are done singularly e.g. one for `left` and one for `right` which having an index on one and not the other may turn out to be detrimental in terms of update times. I could always do two indexes:

ALTER TABLE `galleries` ADD INDEX ( `left` , `right` ) ;
ALTER TABLE `galleries` ADD INDEX ( `right` , `left` ) ;

This runs the risk though of having a table that's more index than data. I haven't done a full benchmark of the different queries for each scenario but I would imagine only for large trees would indexing provide any tangible benefit.

Read the rest of this entry

Calculating the geodesic distance between two points

I was recently tasked with recreating an existing supplier search for a client; I was provided with a database of suppliers, most of which had been geocoded, and not much else. This scenario is fairly standard when dealing with mapping applications: a user enters in a postcode and the system will return a list of the closest suppliers to that location. The postcode part of this equation is well travelled - the Post Office in the UK will not relinquish the mapping from a postcode to a latitude, longitude tuple without a large outlay of cash (and numerous non-disclosure agreements), the easiest option is to use an external service for this. I opted for PostcodeAnywhere as I had used them before with great success. The latter part of this challenge - the return of the closest database entries - was something that I wanted to try myself as I didn't known when I would get such an opportunity again.

if something is worth doing, then it's worth overdoing

To say there are many different ways of calculating the distance between two points would be an understatement. One which I had used before involved northing and easting co-ordinates from a known point within the UK (usually the centroid or London). Using this meant a smattering of trigonometry would be enough to return a decent list of matches; this always struck me as crude, despite it's usefulness, using an antiquated and subjective co-ordinate system seemed the wrong way to approach the problem. Latitude and longitude are globally recognised and provide a precise way of defining points on the globe - reading up on how they are calculated was the step one. Step two was finding an algorithm that calculated the distance between two arbitrary points. The first one I found was the Haversine formula: simple, easy to follow and easy to implement. Knowing that this formula was based upon the assumption that the Earth was perfectly spherical grated slightly with me - I reasoned there must be a more accurate algorithm. I found this precision in Vinencty's algorithm, it was then I decided to enact a contrived but deliciously fun maxim: if something is worth doing, then it's worth overdoing.

Read the rest of this entry