NCrunch in practise

Update 18/10/2012: as of version 1.42, released on the 15th Oct 2012, NCrunch requires a licence to use. Although expanding in terms of functionality offered and with no doubt over the developers commitment to the project, you may find it difficult to justify 159 USD for the benefit of automated test execution.

In February 2012 I was given the opportunity to step onto a project that was nearing its first release. Given it was the first bit of greenfield development I’ve done for a while (read: yonks) I was very keen, it also gave me a chance to try out NCrunch properly.

NCrunch is a Visual Studio add-in that sits in the background running your unit tests, providing visual feedback in a ye-olde dockable panel.

After checking out the project’s code base, I was fairly sceptical to begin with. Having had a great deal of experience of Murphy’s Law, I was expecting NCrunch to implode catastrophically, that I’d see red, un-install it and ultimately never touch it again, ever.

Continue reading

Ice Cream Sandwich First Impressions

I’ve been running now with Ice Cream Sandwich (v4.0.3) on my Nexus S for the last three weeks now thanks to an OTA update. I decided to share what I think of it as well as some screenshots which are now a hell of a lot easier to take than in previous versions (just hold volume down + power key).

One huge improvement I’ve noticed is in the gallery. I was never a huge user of the gallery in previous versions but the interface has been significantly improved, in my opinion, with a nice scrolling timeline of photos as the default browsing method. The new Instant Upload feature (which I’m led to believe came in with previous versions) allows seamless integration and instantaneous backup of your photos (or at least the ones you take with your android device). Using my Google+ account I found this has made it a lot more likely that I’ll actually share photos online.

Google provided 1Gb of free storage space for photos/videos uploaded using Instant Upload, I found more info about this on the Free Storage Limits page on the Google support site. Of course you can also disable this altogether check out the Photo settings and About Instant Uploads support pages for info on this.

Another thing I loved is the new Data usage screen, which shows a graph of data usage over time and allows you to set warning and cut-off limits meaning its less likely I’ll go over my data allowance, there’s also the breakdown of usage per app. It’s slightly easier to enable/disable data but there still isn’t a power control switch to do this.

It’s now easier to manipulate stuff on the home screens. Whenever you create a shortcut it gives you a screen bounding box and you can also re-size some widgets, like the calendar widget for example. The launcher screen is nothing special, it does the job. It does feature some nice transitions though. One thing that could be improved is to have a screen selector at the bottom, if you’ve a lot of apps it could help you get to the screen your desired app is on a bit faster. You now have to go via the launcher to see your widgets and add them to the home screen – it’s a lot better that you can now see a preview of the widget, The switcher is now a little nicer too, you get the app icon as well as a screenshot which is handy. It’s possible to exit apps by swiping the thumbnail to the left/right.

One other thing worth mentioning is that I have noticed a reduced drain on my battery. I’d really have to work with it for a bit longer to know for sure, but I think that if you stay on top of the apps you have open (closing those no longer required) it seems to make a marked difference.

Overall a very welcome update!

HexDefense (Free) Review

Game Title: Hexdefense Free (Android Market link)

Phone Model (reviewed on): Samsung Nexus S

Maybe I’m wrong here but I think you should allow your players to beat unpaid versions of games, I mean, what’s the point in proving to the user that the game is so hard that they wouldn’t even stand a chance in the paid version? Where’s the incentive to buy it? I may be jumping the gun here and perhaps the paid version offers more variety, but my failure in the free version tells me I’m not cut out for it.

To be fair, I was hooked on this game from the beginning. The graphics are very easy on the eye, the music, while a little repetitive is good (besides you tend to tune out after a while anyway) and the explosions and other effects are really nice so kudos to the developer there. The addiction seems to be in trying out the different types of towers and playing with layouts.

However, it’s not balanced correctly – every time I got as far as wave 16 (of 20) I was annihilated. I went from comfortably killing all invaders in round 15, albeit getting rather close to my home hexagon, to every invader bar the front two reaching it, meaning in wave 17 I didn’t stand a chance. I also like to think I had a pretty impressive array and layout of defense towers! It would also be nice to have an undo feature because the tower placement can be a little unforgiving sometimes.

I’ve not played a lot of tower defense games, but given the audience of the Android Marketplace, I fear too many will find this too difficult for the same reasons I have.

Using XML and Blender to define XNA Game Objects

I’m quite new to the XNA game development scene, but ever since Sony’s Net Yaroze, the home-brew playstation, was launched in 1997, I’ve always been drawn in by the temptation of writing something to run on a console.

Soon after starting the development of a little game using XNA I quickly realised it would be great to somehow define the levels for my game in as much of a labour-free method as possible. The pragmatic man/woman always strives for re-use, so with this notion in mind I didn’t see the point of creating a tool that would allow me to create levels. In any project you should be making desicions that result in a faster development time – tacking a level editor task to my to-do list was just going to push the end point even further away.

I’ve always been a huge fan of Blender, the open-source 3d modelling package. I’m not an artist, foremost (although I used to endulge in that quite a lot), but I can manage a few vertices and straight lines. :) So I wrote a little Python script (which, by the way, is a joy to write) that exports the mesh to an XML format that XNA can very easily read and import directly into a managed C# object ready for use in my game.

The below image shows my rather primative test model in Blender which is the start of the terrain for a version of lunar lander that I’m creating.

Blender showing my example vector model

Blender showing my example vector model

I should stress, this is only really of any use if you’re defining objects made of straight lines and vertices, like for example a version of asteriods or similar.

So here’s the python script:

#!BPY

"""
Name: 'XNA XML Export (.xml)...'
Blender: 244
Group: 'Export'
Tooltip: 'XNA XML exporter'
"""

import Blender
import bpy

def mainExportProc(fileName):
    # obtain a reference to the mesh data
    scene = bpy.data.scenes.active
    obj = scene.objects.active
    mesh = obj.getData(mesh=1)

    # open a file for writing and output the XML header
    out = file(fileName, "w")
    out.write("\n")
    out.write("\n")
    out.write("\t\n")

    out.write ("\t\t")
    # output all of the vertices (their coordinates) to file as vertex elements
	# negate the Y axis as negative is up in XNA (2D)
    for vert in mesh.verts:
        out.write ("%f %f " % (vert.co.x, -vert.co.y))
    out.write ("\n")

    out.write ("\t\t\n")
    # output all the edges with their vertex indices to file as edge elements
    for edge in mesh.edges:
        out.write ("\t\t\t%d %d\n" % (edge.v1.index, edge.v2.index))
    out.write ("\t\t\n")

    out.write("\t\n")
    out.write("")

    # tidy up and close file
    out.close()

# entry point for the exporter
Blender.Window.FileSelector(mainExportProc, "Export")

In order to run this you have to have a version of python compatible with your installed version of Blender. Blender 2.49 seems to get along fine with Python 2.6.2. Copy the above, save it as a file named xnaxml_export.py in your blender scripts folder (which was C:\Documents and Settings\Andrew\Application Data\Blender Foundation\Blender\.blender\scripts on my system intuitively enough).

Please update/share the script as you see fit and feel free to share any improvements in the comments.

I’ll post the code to load this into a usable C# object in my next post.

Virus Scanner of Choice

As my family’s (and more recently, my girlfriend’s family’s) PC help desk lackey, I’m often asked what antivirus software I use or what I recommend and is free! Well I hate to disappoint, but my virus scanner of choice isn’t free. Although some free efforts do an alright job, its something I feel more comfortable paying for – is a £25 annual subscription worth loosing your online banking details over?

I used to use Norton Antivirus, 2006, 2007, etc… but it gradually became a resource hog to the point where I’d be disabling it just to copy some files. The interface was nice, but that was part of the problem – this lovely interface was eating my CPU cycles and RAM for breakfast. Obviously that isn’t good as this is one of the situations you DO want your “on-access” scanner running. I also became increasingly alienated by the hand-holding approach that Norton was taking – assuming I was too stupid to be able to look after my own computer by popping up a relentless stream of notification bubbles, update this, scanned that, quarantined blah, blah, blah.

My workplace uses McAffee Virus scanner enterprise. I’ve never known any other ligitimate program to be such a pain in the arse. Update dialogs pop up and grab focus while you’re merrily typing away forcing you to click on your original app to go back to it and then it will grab focus again to tell you its finished – stop pestering me! After the update the computer would act like it had just been hit by a tonne of bricks, the performance plummeted and was only corrected by a reboot.

I looked around for a while and tried various others in demo form or free scanners such as AVG Home (which, if you’re looking for a free alternative, I would recommend) but I eventually opted for Eset NOD32 Antivirus which I now run on all of my own computers, my girlfriend’s and my family.

It just does its job. It’s unobtrusive, it’s quick, the interface is nice, intuitive and it’s not a resource fiend! New virus signatures are released daily and install silently, only popping up a little bubble from the system tray to let you know its finished updating. You pay one subscription and when new versions are released you’re invited to download and install them. It hasn’t let a virus onto any of my machines and does a good job of telling you when it notices one approaching.

So, there you have it, for what its worth, NOD32 is the virus scanner I prefer.

XBox 360 Wireless Adapter? Psht… Tomato360!

I’ve recently aquired an XBox 360 (which is fantastic by the way) and, with all I hear about this online multiplayer malarkey, I wanted to setup an internet connection to it. However, we run wireless in our house everywhere except the study where the ADSL Modem/Wireless Router lives. So, the 360, with nothing but an ethernet socket, is an Internet-cripple, as is everything else under my livingroom TV with an ethernet port.

Anyway, with the cost of an XBox 360 Wireless adapter coming in at around a scandalous £50 I thought to myself, there must be a cheaper way to hook up my XBox to the internet, and there is!

For a while I’d heard about this special firmware you can put on the (supposedly famous) Linksys WRT54G (and its GL and GS variants) called Tomato. There are a few third party firmwares out there which are all made possible by the fact that Linksys built the original firmware using a Linux kernel and released the code as open source.

Tomato, and a host of other firmwares, allow you to put the router into a client status, effectively making the WRT54G/GS/GL a wireless bridge. Once that’s done, it’s simply a case of plugging in your XBox 360 via the provided ethernet cable and, shazam! Online access on your XBox and anything else you happen to plug into the four ports of the WRT54G. A nice setup I like to call Tomato360.

So, here’s a guide on getting a WRT54G/GS/GL and Tomato up and running.

    1. Firstly, get a hold of a Linksys WRT54G/GS/GL – I managed to snag one from eBay at £25 and, as a guide price, I wouldn’t be paying any more than this if I were you. That’s a 50% saving on the cost of a comparatively inflexible XBox 360 Wireless Adapter. One very important detail is that you have to pay attention to the hardware revision of the WRT54G/GS/GL that you’re going to buy. The necessary versions vary between models, for a full detailed list refer to Tomato FAQ: How do I find my Linksys WRT54G/WRT54GS/WRT54GL’s version?. Remember, only bid for it when you know the hardware revision is compatible – some auctions won’t specify – so ask the seller! Here is an example of a message you can send to them to give you an idea:

      Hi there, could you please tell me the hardware version of this router? This should be located on a white sticker on the underside of the router. Thanks.

    2. Once your WRT54G/GS/GL comes through the post, do yourself a favour and avoid any previous user’s configuration problems by plugging it into the mains and doing a total reset to knock everything back to factory settings:
      1. First, plug it into the mains – the lights on the front of the router should flash, wait until they are steady;
      2. Locate the little button at the back of the router – where the ethernet ports are – it should be labeled Reset (if the text hasn’t worn off)
      3. Press and hold the Reset button for 10 good long seconds, the front lights will turn off then back on again to indicate success.
    3. Figure out the IP address of your main wireless router. You can find this out by doing an ipconfig from the command line. The router’s IP address will be labeled as the ‘Default Gateway’ address – write this down for future reference.
    4. Download the latest version of the Tomato firmware onto your computer (from the Tomato website) then get an ethernet cable (just  a normal patch lead, not a cross over) and attach it to your computer via your ethernet port. If you’re connected to any other network, wireless or otherwise, disconnect from it (this is so there are no IP conflicts when connecting to the WRT54G/GS/GL).
    5. Ensure your computer is configured to have it’s IP address assigned automatically via DHCP.
    6. Extract the appropriate bin file from the tomato archive, e.g.: for a WRT54G router, extract the WRT54G_WRT54GL.bin file. Pay attention to all of the options here and make sure you’ve picked the right one!
    7. Open a browser and type in the IP address of the router, which, according to the manual, should be 192.168.1.1, provided your hardware reset worked ok in step 2. To login:

      Username: <blank>
      Password: admin

      Username is blank – as in – don’t enter anything for the username.

    8. Click Administration > Firmware Upgrade
    9. Be patient, the process will take up to 10 minutes, perhaps longer depending on the hardware revision/connection. If you interrupt this process you risk ‘bricking’ your new router, meaning you might as well use it as a doorstop for all the use it’ll be, so it’s important that you let this process finish in its own sweet time. Remember – I take no responsibility for any problems – its up to you – all I’m doing is telling you how I did it!
    10. Ok, when its all back up and running you should see a message stating that the ‘Upgrade is successful’.
    11. Click continue and login with the following:

Username: admin
Password: admin

Then click on the basic header on the navigation bar.

    1. Change the router IP address under the LAN section to a unique address on your network, as an example, my primary wireless router has IP address 192.168.1.1, so I set my WRT54G to 192.168.1.2 and set my machine’s IP addresses to be assigned addresses from 192.168.1.100 and upwards from the DHCP pool (on my primary router).
    2. Turn off the DHCP server, as this will be used as a client, essentially a conduit, you don’t want it assigning addresses to connected machines, thats the responsibility of your primary router.
    3. Leave the wireless enabled and set the wireless mode to Wireless Ethernet Bridge, set the SSID to the SSID (name) of your primary wireless router, this is needed so that your WRT54G/GS/GL knows which wireless router to connect to for its internet connection. The SSID is the name of your primary wireless router – its the name that you’ll see on your computer whenever you’re connecting to your wireless router.
    4. Set your security up to whatever it is your use on your primary router.
    5. Click the save button and the router will restart.
    6. Once the router is back up again, you should be able to open a command prompt on your computer and ping something, say, google:

ping www.google.com

That’s it! Next thing you’ll want to do is to plug your XBox into the WRT54G/GS/GL and go through the whole connection test process. You’ll be nailing noobs in no time!

If you decide to embark on the Tomato360 journey, please let me know how you get on in the comments.

(The new) Prince of Persia

Aaaaaaaarrrrrggghhhhh!

Sorry.

Not too long ago I acquired Prince of Persia on the XBox 306. I’m just over half the way through it so I thought I’d share my experience up till now. So, let me just start off by saying that I really wanted to love this game as much as I did Sands of Time on the Gamecube and, while it’s not a complete disappointment, I am left somewhat deflated by it.

It starts off well enough, fantastic graphics, large expansive vistas, fluid game play (except the combat) and overall, it’s very well polished. The music captures the atmosphere well and fits with the whole Arabic fantasy theme. I was initially dismayed though to discover that the prince is a wise-cracking American. I don’t have anything against American accents, I just didn’t expect it from a game set in Arabia. Anyway, I did get used to it and found that I was becoming more immune to it as time went on.

The whole running and jumping thing is something that takes some getting used to (and I’m a fan of the previous POP games), knowing exactly when to press certain buttons to chain the moves, allowing you to reach higher areas or just for travelling between areas. It can get a bit irritating when you’ve fallen for the umpteenth time. Usually though, it’s a combination of scoping ahead before you set off and/or falling when its not obvious what to do in that crucial split second, then going back and doing it again.

Prince of Persia

The prince and his light-loving sidekick Elika

Another huge part played is that of the princess, who follows you around wherever you go. She helps out by saving you when you fall, giving your longer jumps a bit of a boost and by being the main proponent in reclaiming the corrupted lands. Despite all of her usefulness, it’s the parts of the game where the princess helps out that you really start to wish didn’t exist.

In such a huge world, with such a massive scope for falling it’s definitely useful to have some sort of ability to quickly correct any slip-ups that lead to certain death at the bottom of a dark precipice. Sands of Time used a rewind capability which worked seamlessly and didn’t make you feel like you were cheating. The new game uses the princess to save the prince if he falls too far, by means of grabbing his hand and lobbing him back to the last flat platform that you were standing on. It’s a bit of a clumsy mechanic, better by far than merely ending the prince’s life and giving you a game over, but still. Perhaps there should have been more focus on, 1: how the environment could have eased this and 2: a more compelling risk-reward device.

The combat isn’t quite there either, it feels lethargic and a bit of a lottery at times. There are simple minions dotted about here and there who don’t prove too much trouble but its the boss fights that are the most irritating. They seem to have adopted God of War’s QTE events for parts of the fights – said boss enemy will manage to land a couple of hits, triggering tedious  sequences where you have to mash a button to avoid getting your head rammed into the ground. It really doesn’t take too much imagination and I guess that’s why many developers are using it more and more often. God of War’s implementation was fantastic, but POP just leaves you feeling cheated.

About a third of the way through the game, the monsters you fight become covered in ‘corruption’, which really just looks like an oil slick with tentacles. This ushers in what I think is the worst decision in the game – to render the sword useless in fighting corruption-covered foes, defaulting to the feeble efforts of the princess.

There’s never any consequence of making mistakes in fights – the princess saves you and the enemy’s health goes up a bit. You’re left feeling that the developers just made the fights deliberately frustrating to somehow balance this out. The result is that, despite your best efforts and research of the combo hierarchy, you never really feel like you won convincingly or deserved victory.

I think the best way to describe the new Prince of Persia is bitter-sweet: you’re glad the princess saves you when you fall, but you’re pissed off that the next move was so obtuse you couldn’t have guessed it on the fly, you’re happy you managed to land an acrobatically dazzling combo on an enemy but pissed off that every other attempt was thwarted by the enemy’s unhaltable QTE events.

I’m gonna stick with this one and play it through. If this is your genre then go for it but if you’re more of a jack of all genres, I’d suggest spending your valuable gaming time elsewhere.

Mario Kart Wheeeeee!

My experience with Mario Kart goes all the way back to the original SNES version, which was an awesome game, I must have been about 11 or 12 at the time, so for me it’s one of those old nostalgic games and playing through the SNES tracks on the Wii version brings it all back – the intricately taken corners, the desperation for a red shell, the feeling of cataclysmic disappointment as you’re pipped at the post – it’s all back!

There are 8 cups in all, with 4 tracks each, giving an impressive total of 32 tracks. The new tracks that have Mario Kart Wii - Toadbeen bought in for the Wii version are fantastic, each as original and attention-grabbing as the next. Then of course there is the mind-boggling Rainbow Road – a fixture in all mario kart games; Nintendo have really gone crazy with the Wii’s Rainbow Road!

Mario Kart has always been a challenging game, one that rewards skill and mastery. As with all Mario Kart games, there is a heavy degree of ‘computer interference’. You may start calling that ‘cheating’ after the 8th time Peach smashes you with a red shell just as you’re about to cross the line on the last lap! Although, naturally if you’re not an amazing player you’re not as prone to the Blue Spikey Shell (otherwise known as the ‘spikey bunnet’) and other various flukes, courtesy of the NPCs, such as three red shells in a row or pricision aimed bananna throws.

As always, theres the 50cc, 100cc and 150cc races which can be translated as the difficulty settings;

  • 50cc – pretty easy to come first (if you know what you’re doing);
  • 100cc – bit of a jump up the difficulty curve (aka ‘these guys are cheating b******s!’);
  • 150cc – I hope you’re already bald because you’ll be tearing your hair out (aka ‘crouching girlfriend, flying Wiimote’ mode).

As you progress through the difficulties and cups you’ll unlock new karts, bikes and characters, some of whome seem pretty useless, but the more masterful may find a use for them. There’s also the battle mode which originally featured in the N64 incarnation, which is alright with four people, but the fun really lies in the racing.

I’ve so far managed to finish the 50cc cups and I’ve started into the 100cc cups, there’s a marked difference in difficulty and I reckon the majority of players will be happy getting half way through the 100ccs and dabble in the more difficult ones.

The online mode is fantastic, it’s really seamless and easy to use. If you have friends registered already (see playing your Wii friends), you can join games with them and the remaining slots will be filled with other random players from around the globe. Provided you have a decent broadband connection the latency is pretty good and unnoticeable for the most part. The best part of the online mode is that it totally removes the NPC cheating element, meaning if someone beats you, they were the better racer. There remains the random element, of course, as you’re never sure what item you’re going to get and sometimes it all comes down to just that – a golden mushroom can be a lifesaver on the last lap!

Lets not forget the split-screen multiplayer mode which is where Mario Mart Wii really shines! There is nothing better than feeling the anguish from your buddy as you knock them off the track and down a dark. pit. Mario Kart will truly bring even the quietest of players out of their shell. You can also have a maximum of two players in split-screen mode playing online.

There’s a lot more besides and I could ramble on and tell you about it but I won’t, lest to say that this is the most pure gaming experience I’ve had for a while and is, without doubt, the best Mario Kart since the original appeared way back in 1992.