Tuesday 4 August 2009

Right, where was I?

Lamenting the fact that my computer had died, that's where. Well, I finally bought the shiny new Dell desktop, and the rather-awesome Mark from Home IT Care rescued all of my data from the old PC's trolleyed hard-drive. Good man.

Oh, and I was probably procrastinating about which direction to take Project: Beaver from here on. Back in a bit...

Thursday 21 August 2008

What have the agilists ever done for us?

Cue a gratuitous link to Monty Python material, almost guaranteed to distract a geek:

Right, what I actually wanted to do was sing the praises of — or at least mention — the greatest benefit that agile development has brought me: a reduced tolerance of duplication. Not only that, but an improved ability to identify it, in all its forms.

Hmmmm... what do I mean by "in all its forms"? Obviously, there's the straight copy-and-pasted code duplication. And then there's code that's been copied and then very slightly changed, or had its variables renamed. But some of the trickiest problems I've tackled have come from different bits of code that have shared assumptions and knowledge that aren't immediately obvious. Being able to spot that early and isolate it and/or make it explicit can be immensely valuable.

I sometimes wonder whether I've become too fixated on duplication, to be honest. I find myself getting unnecessarily aggravated at work when I perceive others to not care as much about it as I do. Am I just being pompous in thinking that my colleagues don't care about it enough? Yes, almost certainly. Besides, we're judged by our actions more than our words and the evidence suggests I've done very little to tackle the issue in my day to day work. Well, very little beyond avoiding duplication in new code. I've barely scratched the surface of our legacy issues.

Getting back to the topic of this post — that of agile's influence — what first drew my attention to duplication as Evil #1? It's hard to say. I don't think it was test-driven development's emphasis on refactoring; I was aware of refactoring before that. However, I do suspect it played a part. Really, I think TDD just seeded a crystal. All the elements were already there, swilling around in my noggin, but TDD and refactoring brought them together for some kind of mini-epiphany. Reading Test-Driven Development By Example probably helped too. As much as I'd like to limit my praise of Kent Beck, that was a pretty good book.

What about your experiences? What's the biggest benefit agile brought to your development life? Assuming it brought any, that is... ;-)

Saturday 9 August 2008

Hardware prognosis

It's not looking good, folks. Despite repeated attempts, my hardware CPR seems to be failing. Dammit Jim, I'm a programmer, not an IT technician!

However! I don't want to let this blog die just yet, even if my computer has. I'm going to see if I can rattle off some more navel-gazing, agile development posts. And maybe take the time to look into AI routines a bit more. Heck, if programming's not an option, I might as well invest in a spot more BDUF as well.

Finally, if anyone's got any tips for a decent desktop PC that'll be good for development, I'd appreciate them. Doesn't have to be a super games machine; just something cheap and adequate (£300-400). I'm currently thinking Dell, but that's just me being attracted by out-of-the-box usability. Anyway, all suggestions welcome.

Tuesday 5 August 2008

More Beaver logging

At the end of my last development-related post, I said I should probably run more tests to confirm the apparent first-player advantage in Beaver. Well, I've done that now.

Without coding any of the minimax stuff, I've run each existing strategy against each other, going both first and second. While the cleverer strategy always has a higher win percentage, regardless of whether it plays first, tests in which both players use the same strategy continue to show a first player bias:

StrategyP1 winP2 winDraw
Adequate46.1%38.2%15.7%
Dumb47.4%38.0%14.6%
Dumber44.1%39.9%16.0%
Dumbest59.5%27.9%12.6%

So, the next step would be to create a few more strategies to test it with. :)

At least, that would be the next step if my computer hadn't just died, taking the source code with it (and god knows what else). Thankfully, I've still got a fairly recent copy of the EXE and the game logic assembly on a USB flash drive, so if all else fails, I'll be able to use Lutz Roeder's .NET Reflector to recover most of the source code. Albeit source with poorly named variables. Hey ho. Guess it's time to get a new PC...

Saturday 2 August 2008

Steve McConnell on Agile

I originally wrote loads of introductory waffle for this link, but to hell with that. Agile Software: Business Impact and Business Benefits. Enjoy. :)

Thursday 31 July 2008

Good, simple games... that I can rip off

All this game-related programming's got me reminiscing about good, simple games from years gone by; games that I might one day fancy plagiarising. Heck, maybe I could use them as practice for getting into WPF, XNA, or such like.

Anyway, here are a few games from the early 90's that've sprung to mind:

XQuest
Arguably the inspiration for Geometry Wars, this was an incredibly addictive little game in which you controlled a spaceship with your mouse, collecting crystals littered about the screen while avoiding mines and shooting the baddies that chased after you. The genius of XQuest, however, was that your ship's movement had inertia. The developer must've tuned it to hell and back, because it felt perfect.
Apocalypse Cow
Described as "a fast-paced action game in which two players drive catapults hurling cows at each other. Cows colliding in mid-air resolve their differences in Cow Boxing mode." Yes, it was a little surreal. It was also brilliant fun. And it featured cows. And sometimes glass ones.
Cheesy Invaders
An incredibly simple space invaders clone that was elevated to the status of cult classic by its sense of humour, graphics and sound effects.

Pity I can't find decent links for those last two. Hell, I'd still be playing them now, if I could. And that, to my ears, sounds like enough of an endorsement to make them worth copying. I just need the source material to reference... and graphics to copy... and sound effects to steal... ;-)

Do you know any other forgotten gems I can add to the list?

Wednesday 30 July 2008

Logging results from Beaver

At the end of my last little spurt on Beaver (careful...), I decided it was time I logged the results of more extended play-tests. Well, that didn't take very long. After 45 minutes or so, I'd played my top strategy off against itself a total of 3000 times — each time on a randomised board — and crunched the results in an Excel spreadsheet.

And the results at the end of this WarGames-esque madness...?

Player 1 wins:46.2%
Player 2 wins:39.7%
Draw:14.1%

Hmmmm. Looks like a fair indicator of first-player bias. :-/

However! It could just be a consequence of that particular strategy's characteristics. To be sure, I'll need to run the same test with more strategies. But... to be honest, I'm not sure I can be bothered. The chances of seeing a different result seem slim and there are other tempting directions I can take this prototype e.g. making it human-playable...

I suspect we're in for a period of hot procrastination action. Hey ho.