Coding genius
24 / 04 / 2008

I am, naturally. Ha. I've done something clever today though, thats really probably quite boring, but I like it, so will blab on about it regardless. I'm working on a mod at the moment that's multiplayer and involves critters as well as other players. Not a problem, except that its to be played on the default multiplayer maps, which lack nodegraphs. Nodegraphs are basically GPS for monsters; just as your car GPS doesn't navigate across open countryside, but only along little lines (roads) on its built-in map, computer game monsters really look a lot less scary and impressive when they're unable to get around such simple things as ... corners. Or a little box on the ground between them and you. In fact, its pathetic. So when making maps, mappers place little nodes all around the place, positioning them around corners and the like, and these are then built into a big network by the game, which remembers what other nodes each node can see, and how far away they all are.

So then, when the monster's chasing someone that hides around the corner, it works out what the nearest node to that player is, and then how to get there, by following the node graph. Voila, it makes its way around the corner, and eats / slashes / bites / punches / tickles / pokes / hugs you, or whatever the heck it does.

None of this is my doing, but the default multiplayer maps don't have the nodes built in, so the graph is never built. Hence, the corners become overwhelming obstacles for your average minion of nastiness. Today however, I've gotten around this problem. My solution goes something like this: first, the player turns on cheats, and types in a command, 'startnodes.' They then run around, pushing a particular button everywhere where a node should be, and a silly glowing ball appears to represent it. After 10 minutes or however long it takes to place all the required nodes, they type 'savenodes' and the positions of all the glowing balls are saved out in a text file. They then reload the map, and the clever bit happens.

The game spots the text file, and checks to see if its newer than the saved node graph or not. Annoyingly, the game saves a node graph even when there's no nodes, just to say 'bugger' or something to that effect. If the text file is newer, then we sneakily create a node at each point thats listed, while the map's still loading (so it thinks it loaded them itself, ha), and tell it that it needs to save the graph once its built it. The text file can then be discarded, as we now have a fully working node graph, huzzah.

Anyways, being such a generous (read: distracted from studying) sod, I've made a wee article where I describe it all, here:

http://developer.valvesoftware.com/wiki/Node_graphs_for_deathmatch_maps

There's just one problem with all this - I'm really meant to be revising quite intensely at this point. I think I'm gonna have to ban myself from coding or something! :-(

The great parking ticket debacle, part 2
08 / 04 / 2008

Apparently, I mispronounce the word 'debacle.' But anyway, I got him. Stopped and tied my shoelace as we got out the car, had to mess it up several times over before they finally stopped waiting for me and i could plant the damn ticket under his wiper. When we got out, I had to (discreetly) point it out to him, cue several "aw no"s (how exactly should I pluralise that anyway?), before he opened it up to read it, stared at it, reading, for about 30 seconds then burst out laughing. Score.

I filmed it on my phone. Apologies for the fact that I can't work out how to stop the video auto-playing, I'm just impressed that I managed to embed it in the first place! I've actually got flash, I'll jigger it some time soon, hopefully.

The great parking ticket debacle, part 1
08 / 04 / 2008

A few weeks ago, I got a parking ticket, and as I was completely convinced I was right, i wrote a lovely letter detailing exactly why I was wrongly ticketed. Alas, they wrote back informing me that despite what the sign says, about how tickets are only required between 9:30 and 16:00, there's meant to be a second sign, saying that you can't park at all in these marked bays, inset from the road, between 16:00 and 18:00. This second sign was, however, blantantly not there, but I should have still realised its message because the small print on the ticket machine said so. Well, la de da!

Anyway, my only way of getting any satisfaction from all this was to fake a parking ticket and book Hassan with it while he's up for the week. Its quite a nice forgery, considering it only took 90 mins or so, but much of the effect is lost due to it being printed from an inkjet. Still, he won't be comparing it side-by-side with a real one, so it should have the desired effect. Of, presumably, getting me thumped.

Having missed the stated time & location due to him having a paint-induced headache, I am now forced to go to Rev (which I've evaded for what must be a couple of years now) to plant it, the headache seemingly gone.

Will I succeed? Will he instantly see that its a blantant fake, or assault the nearest parking attendant? Or me? We'll see soon enough.

This is the voice of the Winstron
06 / 04 / 2008

...We know that you can hear us, Earth men! But what I want to know is, why on Earth did I think it was a good idea to name this project (any project) "The Winstron" ??? As with any "temporary placeholder" name, its stuck. At least its slightly giggle-inducing. It's probably the most complex project I've started completely from scratch, and is at least in part an attempt to repopulate my java class library, which was recently mysteriously depleted of all its java.

The Winstron is, in essence, a really poor speech synthesiser, written entirely by yours truly, but it uses sound samples of all the varous phonemes (noises) recorded from my voice. The sort of situation where I sit and say "a" 50 times, try to decide which is the most "a" like of them all, trim, normalise and save it, then start again with 50 "e" noises. Believe me, after you listen to it more than a few times, they all start to sound much the same.

In fact, I have come to the (probably crazy) conclusion that english is only actually made up of 4 distinct sounds: "iiih," "nnng," "ffff" & "t". Listening to any of the 40+ phonemes I recorded, they all sound like one of these 4. An 'interesting' (but rubbish) experiment to try would be to actually replace all the sounds with just these 4, and see if it sounds any worse.

Indeed, how does it sound in the first place? Well, it can be downloaded here (it needs the java runtime installed, or you could just read more here), and if I said its better than Steven Hawking, but not quite as good as Microsoft Sam, you'd get the drift. I have ambitions to make it do clever things like vary the pitch and speed of words as it says a sentence, but frankly thats all a waste of time until I've completed the very tedious job of trimming all the sounds in exactly the right places. Currently, some words sound really good, and others are so bad you'd think its trying to spell them out. Most are in between.

At this point, I know what you're thinking...
"Hi I'm Winston and I like men. Grr!"
"Winston sucks"
"I am a big poo bum gay brain"
"Hello, telephone banking? I'd like to transfer some money..."

Yes indeed, the possibilities are endless. I'll continue to work on how it blends its phonemes when I get the chance (and can be bothered), so it should continue to improve with time. If I've learned one thing through this project, its just how inconsistant English pronounciation actually is. I knew it was bad, but really! As the epitome of this, consider the vowel sound at the end of the word "the". "ih," "eh," "e" - however you'd write it, you won't find it in any other word, at least in my pronounciation. Its seemingly a mix of both "eh" and "uh," with a little "i" thrown in. Imagine the audacity of a word that has its own phoneme!

Knock knock knockin' on Winston's braaaiin
06 / 04 / 2008

Knock, and the door shall be opened unto you. Thats fair enough. But if you answer one knock, be prepared to be answering a whole lot more! From the outset, let me say that I don't feel ungrateful or anything. I learned how to program through the half-life coding community, and probably annoyed the hell out of folk myself, back in my more ignorant days. As such, I felt and still feel that I should give back to the Half-Life 2 coding community what I took from its predecessor. But it seems I have to hold myself back from answering all the questions that appear on the Source Coding forums, lest it turn into the Ask Winston forum & eat up all my time, and make everyone there quite sick of me.

Another problem with the community is that few experienced coders actually use the programming wiki. As such, there's few people with the confidence (and/or competance) to edit or write articles. So if you do write one, there's a lot of people that immediately ask you a whole bunch of questions and point out the things that don't work, but few will do any editing of your articles, except maybe a little grammar. As such, it really does become your article in the eyes of a lot of the readers, along with all responsibility for fixing problems & whatnot.

Fair enough. What I don't understand is how it can get several instances of "yep, works 100%, really great tutorial" feedback, & then someone else can come along and discover that actually about a quarter of what I'd written is just mince. Did the others fix it for themselves & not share their improvements, or just read it and not actually try it, or are they worried that its them who have done something wrong, but too embarassed to admit it? Either way, it seems odd.

Back in Bla...og
05 / 04 / 2008

It's been a while since I blogged anything. This is, however, a habit I'd like to get back into, if for no other reason than it makes me sit down & think about stuff that has been, rather than constantly planning stuff for (programming) tomorrow. It also provides for a particularly useful tool for weaning (or peeling?) Avril off of her more extreme Bebo stalking habits.

So here's a return to a concerted effort to post stuff here, and to maintain my web presence generally. I find it far too easy to finish a project and file it away, ignoring it because my attention is already captivated by the next idea. If instead I put such 'projects' online, or even just mention them, then I'm less likely to forget about their existance altogether. And if they're out there, for the small fraction of the world (and prospective employers) that might stumble upon them to see, it might even make me think that I'm wasting my time doing useful and/or productive things, rather than just wasting my time doing ... stuff!

New Blog
27 / 10 / 2007

Yeah, so I have a blog. Felt I ought to. Doesn't mean you can make me write in it though!
Valid XHTML 1.1 Valid CSS
Boo!
...because I've got plenty of other things to do