Hello World!
I'm a Developer at Master of Malt, a University of Brighton graduate, a 1st Kyu in Kyokushinkai Karate, a video gamer and technology enthusiast. Read more about me over here.
CloudANDTidus
Search
Games


Monday
Jan092012

Intercepting iPhone/iPad keyboard events

So a problem; you have a web app running on iOS that you want to receive keyboard events at any time. The simplest solution would be to make the user put focus on a designated text field that you could watch for keyboard events in JavaScript, however it's a pain in the arse if the user has to keep putting focus back when they loose it. Unfortunately the app itself can't force focus on the text field as mobile safari blocks it (only a touch event triggered by the user will bring up the keyboard). 

The solution, as crazy as it sounds, is to create a native iOS wrapper app that can monitor keyboard events at all times and forward them onto the web app. To do so all you need to do is create is a view controller that displays a UIWebView with your web app inside and implement the UIKeyInput protocol

@interface ViewController : UIViewController <UIKeyInput>

In the implementation of your view controller you just need a few of methods.

- (void) insertText:(NSString* )text
{
    NSLog(@"%@", text);
}

- (void)deleteBackward { }

- (BOOL) canBecomeFirstResponder
{
    return YES;
}

- (BOOL) resignFirstResponder
{
    return NO;
}

- (BOOL) hasText
{
    return YES;
}

Insert text is where we will receive keyboard input and resign first responder is the crucial method that returns false to prevent the web app from taking the keyboard if an element receives focus. Obviously the negative to this is you can never type directly into elements in the web app. 

Once the native app receives keyboard events they can be passed onto the web app using JavaScript. You just need to create a receiving method in the web app and call it in the native app like so.

- (void) insertText:(NSString* )text
{
    NSLog(@"%@", text);
    [myWebView stringByEvaluatingJavaScriptFromString:[NSString 
        stringWithFormat:@"receiveText('%@');", text]];
}

And there you have it, intercepting keyboard events for a web app using a native wrapper.

Monday
Jan022012

I’ve done everything the Bible says - even the stuff that contradicts the other stuff!

Happy new year everyone, unless you don't believe in new year, in which case insert politicly correct good wishes for getting round the sun once more, with no offence intended to you or your friends and loved ones.

2011 was certainly a year, thats for sure. In my final semester of University I helped create a pretty awesome multiplayer flash game, I learned Object-C and created an iPhone app for my final year project and I graduated from the course with first class honours (go me!). I also got a little full-time job with some folk who sell fermented vegetable drinks online and was tricked into doing terrible things to my facial hair

It wasn't all sunshine and victory laps though. It rained a lot for one and the final few months of University were some of the most stressful of my life. It didn't help that at the same time as trying to complete my final year project and maintain a part-time job, I had the consecutive loss of both Tabby and Hamish, two long-term members of the family. They say a dog is for life, but you forget that it's their life, not yours. His death hit everyone hard, but my mum most of all, who became physically ill for over a week and caught an eye infection that could have made her blind (fortunately she fully recovered). On a more up beat note we also got a couple new members of the family in ones of the most unexpected ways (my older sister nearly tripped over a stray cat giving birth on her doorstep). 

The last month has also been "an experience". Working for an online e-commerce company means everything is about Christmas, and this one was the busiest yet. On one day in December the website took more orders than the entirety of 2008, so to help support the team and fix any issues that arose we had to move from our nice warm office to a very cold warehouse. Christmas was a success though, mostly because it didn't snow and we made order processing much more efficient, so yay us and all that. Next year our systems will be so efficient the whisky will be picked and packed by little robots and I can spend the last two weeks of December in Malaga instead of High Brooms, aka the coldest place in Britain.

Christmas wasn't all cold warehouses though, as for a person who doesn't drink very much, I did a lot of drinking. This included a surprise party in London for an old college and uni friend and consecutive days of going to work and hitting the pubs in the evening, which I'm positive did wonders for my programming. It was great to see a lot of people again and we defeantly need to do it more often.

I also learned in 2011 that I am terrible at ice skating. So there is that.

Friday
Dec302011

2011 in Gaming: Gave Up

We conclude this series of posts on games I played in 2011 (part one can be found here and part two over here respectively) with the ones I truly didn't enjoy. These are not only the games I didn't complete, but the ones I officially quit playing because of the reasons listed below.

2011 in Gaming: Gave Up:

Kirby's Epic Yarn (Wii) - I love Kirby and Epic Yarn is one of the darn cutest titles on the Wii. The  way you can manipulate the yarn world is just ingenious and the things Kirby can transform himself into are adorable and awesome, but this game sucks. It's depressingly easy, there is almost no way to loose and local co-op is down right boring. 

L.A. Noire (PS3) - L.A. Noire is critically acclaimed as a classic adventure game disguised as an open world GTA detective game, with amazing facial animation and voice acting. I was really into this game initially, but I soon realised how simple the "choices" were and got bored by how repetitive the game quickly became a few cases in. A brilliant idea, poorly executed. I ranted about this quite a bit on the latest episode of Downloadable Content.

Uncharted: Drake's Fortune (PS3) - The Uncharted series is extremely popular, and I was hoping to jump into it after finally getting a PS3 similar to how I marathoned Assassin's Creed, however the excellent voice acting and incredible graphics weren't enough to convince me to finish this incredibly poor third person shooter. The enemies soak bullets, the controls are awful and the the fights unnecessarily long. I'm told the sequel is excellent so I'm going to give the series another go.

Kinect Sports / Kinect Adventures (360) - I don't own a Kinect, but I did play with one. Kinect is a gimmick, it doesn't work very well, and these mini games aren't very enjoyable.

Crysis 2 (360) - I'm told this is a high-quality shooter, but I just never got into it. Just one of those "not for me" titles I suspect. 

Thursday
Dec292011

2011 in Gaming: Backlog / Uncompleted

Continuing from yesterdays post, here are the games that didn't make it. The journeys I didn't complete, both new and old. A lot of loooong games on this list. Hopefully I can knock more than a few of these out in the next year.

2011 in Gaming: Backlog / Uncompleted

Dragon Age: Origins (360) - A 2009 game on the backlog that I briefly tried to get into, Dragon Age is an old school dark fantasy RPG with branching dialogue trees and plot points  that change dramatically based on your choice of character and party members. I just need a lot more free time. 

Bastion (360) - Wonderfully whimsical, Bastion is a top down role-playing action game that leads you through a stunningly beautiful world. The soundtrack is one of the best this year and the narrator reacting to your every action provides an incredible amount of depth to this experience.

Deus Ex: Human Revolution (360) - One of those games I got distracted from near the end of the year and need to go back to, Deus Ex is an action packed first-person shooter set in a  cyberpunk world that is absolutely worth seeing.

Assassin's Creed: Revelations (PS3) - Possibly the weakest and most unnecessary edition in the Assassin's Creed 2 trilogy, Revalations is showing signs of deterioration in the series' annualisation. The series formula is still a blast, but it's time to move forward.

Tales of Symphonia (GC) - The game I famously lost £40 on because I bet I could beat it before my graduation. I had over a year to do the bet, but classically left it to the last eight days. In the 25+ hours that I played I found a brilliant classic RPG with an addictive combat system and a massive world to explore. The voice acting is up and down, but the story is worth experiencing and I intend to complete this challenge. Eventually...

Chrono Trigger (VC) - 2011 was the year of trying and failing to complete classic RPGs on my backlog. Chrono Trigger is worth including in this list because I made more progress than ever before, reaching the Forest Maze in 65,000,000 BC. It shouldn't need stating, but Chrono Trigger is an incredible JRPG, and one I might still one day complete.

The Elder Scrolls V: Skyrim (PS3) - The seemingly endless battle against dragons and giants is just so big I'm frightened to become committed. I admit to not playing this epic game as much as I should. It's technically flawed in many ways (including a deteriorating frame rate the larger my save file gets), but all should be forgiven because the title screen music is just so bad ass.

The Legend of Zelda: Ocarina of Time (VC) - Another Zelda game I am ashamed to admit to never playing to completion. This also receives acknowledgement on the list because I got further than ever before, reaching the Shadow Temple. Ocarina of Time has suffered greatly due to its age, but it's still an amazing game and worth playing to this day. Just appreciate its age okay?

The Legend of Zelda: Skyward Sword (Wii) - The newest edition to the franchise, Skyward Sword continues to add surprises to the classic formula, is beautiful to look at despite being SD and contains the best use of the Wiimote period. This is the Wii's swan song.

Wednesday
Dec282011

2011 in Gaming: Completed

I meant to do this last year, but never did. Inspired by Reeve (and originally namatamiku), this is a roundup of all the games I played this year. It will be posted in three parts, providing my thoughts on the games I completed, didn't completed (but intend too) and gave up on. As this is my list I can be as arbitrary as I like, so for qualification I either played it for the first time this year, or completed (or made significant progress in) for the first time. For example, I played the original Zelda years ago, but only completed it in 2011.

This list required some effort, and I probably missed out stuff, so next year I plan to write it as I go. I doubt I will actually do that, but it's nice to be motivational and forward thinking.

For more end of year video game stuff, I was on the last 2011 episode of Downloadable Content talking about our best and worst games of the year. You can subscribe to the show in iTunes or download part 1 here and part 2 over this way.

2011 in Gaming: Completed

From Dust (360) - The spiritual successor of Populous reminds you why it's so much fun to play God, but does little to live up to past greatness. The wonderful way you manipulate the world and it's elements is ruined by a short and simple game with some terrible AI.

Guardian Heroes (360) - A remake of the Sega Saturn classic, Guardian Heroes is a frantic and crazy beat'em up  that works wonderfully in co-op over Xbox live. It's ultra short, but packs tones of replayability thanks to its branching story.

Batman: Arkham City (360) - While Arkham Asylum was a revolutionary game with an incredible combat system and fluid narrative, Arkham City is only evolutionary. The "open world" adds little to the experience and the story is nonsense, but the awesome core gameplay from the original is back and mildly improved. On the other hand; Batman.

Sonic Generations (360) - Incredibly short and full of padding, but still the best Sonic game (both 2D and 3D) that we've had in years. The physics and speed are just right, and the level design is excellent. Also, the 30 second time trial mode against friends is a blast.

Gears of War 3 (360) - Campaign-wise, an evolutionary sequel that should be given mad props for actually having the guts to provide a definitive conclusion. The package is also full to the brim with extra content, including a radically improved multiplayer and co-op experience.

Assassin's Creed / AC II / AC: Brotherhood (PS3) - Last Christmas I received a PS3 and played these three back to back to back. It was one hell of a video game binge. Each game radically improves over the last, continuing an epic (if totally nuts) narrative spanning generations. Scaling rooftops and assassinating never gets old and there are many addictive tasks that will feed the completionist. I strongly advise reading the Wikipedia article or watching some YouTube videos to get the gist of the first game however, as the gameplay becomes incredibly reparative and dull after a couple hours.

Portal 2 (PS3) - Without a doubt one of the best games of the year and a must play. From the  excellent character development, voice acting and laugh out loud humour, to the perfectly play tested puzzles, the beautiful world and the incredible closing moment, this game has little to no faults. The co-op is also incredible fun.

The Legend of Zelda (VC) - I completed this for the first time this year in anticipation of the new game, and it's still as wonderful as the day it came out. It may seem simplistic in comparison to where future 2D Zelda's would go, but the concept of being dropped into a world with no instruction and setting out on an adventure has never been better executed to this day.

Saturday
Dec032011

Well, it's just ineffable.

In support of the men's testicle charity Movember I embarked in the last month on the fine and noble quest of growing not just a moustache that could frighten small children, but a full beard to prove just how manly I can be and to raise awareness for said charity. I'm not really sure how much benefit to the world my single beard brought, but the guys at work raised over £6,000 by selling a limited edition whisky, so lets call it a rounding success.

Growing a beard was an interesting experience. Certainly the worst part was how incredibly itchy is became about a week in, but once that was over it was smooth sailing. Because I only had the fella for a month there was no need to maintain or shape it, so it was actually less work than the regular shaving I normally do. I certainly got some comments that I should have only grown a moustache as per the "rules" of the charity, but as was proven in the photo I took during the shave down, it was probably for the best that I didn't.

Unless you're my Dad, moustaches are a stupid concept. Very few people pull them off, and I have proven not to be one of them. As requested, I also took a photo of the obligatory moustache before it went completely.

I was certainly of two minds about shaving it off at the end, with opinion divided between whether I looked good with a beard or not. In the end I opted to axe the beard because of the maintenance it would require in the future and because I look much younger without it. It's certainly good to know I can pull one off though, and might reconsider in the future.

You can see daily photos of the beard's progression and ultimate death over here.

In other news, I was on another episode of Downloadable Content in which we had an open discussion about anything and everything video games. I don't really recall what I talked about, but I'm sure it was all podcasting gold. You can subscribe to the show in iTunes or download the episode directly via this linkage.

Sunday
Nov272011

Hey! Did you gain weight?

As a kid growing up you were either a Mario guy or a Sonic guy. Sure I loved both game franchises and played each religiously, but when it came to comparing the two Sonic was always my winner. Mario was fat, slow and very Italian. Sonic on the other hand was ultra fast, super cool and definitely not Italian. I had both a Master System and a Mega Drive, all the games, and would get up on Saturday mornings just to watch the cartoons.

Obviously I'm referring to the awesome cartoons...

…and not this.

Thus the general decline of awesome in the Sonic franchise after my childhood was rather upsetting. Every year folk get their hopes up that this would be the good one, only to discover it has a warehog in it, or Sonic kissing children. We fall for this every time. Most recently Sonic 4 promised a return to the series' 2D roots in episodic format, only to provide a single, short episode that had wonky physics and terrible level design.

Which is why the news that Sonic Generations was actually decent blew my mind. On the recommendation of a friend I picked up the game for 360 and was amazed by how good it is. The simple premise of the game is that "unknown dark evil" has gone through time and merged the worlds of classic 2D fat Sonic and svelte, obnoxious 3D Sonic. The nine levels in the game are each inspired by a different Sonic game and each one has two acts, one played in 2D reminiscent of the Mega Drive era and one in 3D like the Dreamcast era.

Remarkably they got both of these right in a single package. The physics for 2D Sonic are spot on, you always have a feeling of speed and it doesn't suffer from bad level design such as bottomless pits just off-screen that kill you because you were going so fast and didn't "know" to jump. The 3D levels are also shockingly good, thanks to the boost button and the homing attack that keep sonic moving. Sonic has always, and should always be about speed. The moment you stop and have to navigate difficult platforming, it all goes to shit, because Sonic is a terrible platformer. 

The story around the time zones of two Sonics being merged isn't half bad either, with the short cut scenes between levels including some comedic interactions between the two. Sega even make reference to the stupid change from Robotnik to Eggman, which makes me happy. 

Unfortunately its not a perfect package. The boss battles are lousy, and getting to them requires you to do three challenges (of which there are many more optional ones) in the levels you previously completed. None of these challenges are of particular high quality and feel entirely like padding. Similarly, you collect points that can be spent on upgrades for Sonic, which are supposed to add some depth to the game, but they never felt like they were needed. With nine actual levels, each with a 2D and a 3D act, the game felt incredibly short.

The real surprise for me was a mode Sega probably threw in at the last minute with very little thought. The game has a 30 second time trial mode where you try to get the furthest distant you can in each level, which is then recorded on a leader board. Myself and the friend who recommended the game have been viciously competing on this, going back on forth trying to get ever so slightly further in the level. As I said, Sonic is about speed, so constantly trying to better your time, particularly on the 2D levels, is an absolute blast.

So in summary; its very short, but what there is is the best Sonic we've had in years. Also, if someone tries to touch you in a place you don't like, thats no good. Especially if they're Italian. 

Sunday
Oct302011

What are you, nuts?

I've been using this profile picture about the place for a month or so with no real explanation for why I have an appallingly fake beard and an incredibly ugly hat. As it turns out, I wasn't trying to get arrested for looking like a child molester, it was for a Movember photo shoot.

Movember is one of those charity things, where you do something effortless and stupid and people give you money to make themselves feel better about their life. This particular one is for men's balls, so as a man who has a reproductive system and the offending gland, I must profess some self-interest in supporting this one over starving Africans. To offset this selfish behaviour I did donate to other charities during the year, so I feel pretty good about this.

So Movember is where you grow a mustachio in November (M-ovember. Get it? I thought it was clever to). In support of this charity my day job has released a charity bottling every year, and this years one (in partnership with Glenfarclas) features a photo of all the men in the company looking incredibly stupid.

I actually thought it came out quite well. As the company gets behind this charity every year I thought I would attempt to participate (after avoiding it two years running), by growing some facial hair. I'm going to bend the rules though by not just growing a mustachio, but a full beard, as young people with mustachios simply look like pedophiles. I'm sorry, its just a fact. It's on the Internet, so it must be true. I've never truly attempted the whole facial hair thing (beyond laziness which always stops at the point that it gets itchy), so I'm interested to see how this turns out.

If this post has convinced you to donate to saving my balls, and you like whisky, you can buy a bottle here starting November 1st. If you want to save my balls, and don't like whisky, you can donate directly over here.

In other news, I've started hosting a new blog by my friend and co-worker Michael. He writes funny stuff, so I urge you to go read him, as I'm not funny at all.

Disclaimer: In case it wasn't clear, I don't have prostate cancer (yet), so think of this as saving my future balls. Not my present ones. Those are just fine.