Friday, March 02, 2007


The central midfielder picks the ball up just inside his own half. He rolls a simple ball out to the wing where it's picked up and dribbled, unchallenged, towards the corner flag. Cutting onto his left foot, the winger lays the ball off to the unmarked and now arriving central midfielder who meets the ball beautifully and deftly slots it home through the obvious gap. All so simple.

It's not fucking simple! It's fucking terrifying! There's nothing fucking simple about getting any of that to work, not without tearing huge chunks of your own brain out and devouring them in the process in the hope that you might get taken away and never have to do any of this cunting shite ever again!

As you can tell, I'm not particularly happy at the moment. The little things that, when you're out on the pitch playing with even the more clueless folk out there, are so easy to do, become cunting tough whenever you actually need to put it into code. Let's take an example - there's a ball rolling in a direction, and you want it. So what do you do? You take note of where it's going and you get in the way of it. Easy.

I spent the best part of a week trying to come up with the quickest possible way of getting my tiny little blobs to do that. I have pages and pages of worthless trigonometry, now. Worthless because those theories never panned out. Maybe I never coded them correctly, maybe they were wrong in the first place, none of that matters because it's a heck of a lot of wasted time - in thirty minutes I coded in what was initially a temporary fix that actually does a better job than any of my mathematical tricknickery.

With that done, I turned my head to the rest of the physics. Balls should bounce off players, right? This would be easy if it wasn't for two things - first, I can't rely on the actual graphics engine for collision detection because I want the game to be able to process more than just the match you're viewing. The second irritance is that I never know what the hell a player is doing. Is he running? Where are his arms?

"Where are my arms" is a question I may well have found myself asking random people if this had frustrated me any more, as I can think of little more immediately satisfying than blowing away the object of your anger whilst cackling like a 1920's Chicago mob boss. I would even have bought a cigar for the occasion, it would be that important.

But it never came to that. I decided that as much fun as playing with little circles is, there's no real match for getting proper visual feedback. Instead of working with an abstract engine and Football Manager style blobs on a single-screen, overhead pitch before introducing the snazzier display, I've decided to go the other way. A pitch, a ball, a man (although I'm not fussy, so as long as it's bipedal I couldn't give a shit), and they'll fucking stay there until they've worked out how they're supposed to interact. Actually, I did get the ball interacting with the pitch correctly, but with an overhead view it's harder to see the bounce.

So, over the last two days I've created a basic tiling system for the game. Tiling, if you don't already know, is simply the way the background graphics of the game get built - the pitch consists of several tiles which are laid together, and that's about it. In order to do this I knocked together a half-decent TileMap editor, and I made sure the drawing code could cope with flipping the tiles on the horizontal and vertical axes, to save me having to have four versions of similar tiles. It all seems to be working well, and about a half hour ago I managed to have a scrolling football pitch. Couldn't even get jumpers for goalposts though, I'm very poor.

I've set myself a little personal goal for the end of March. If I can get something that resembles a playable football match done, I'm going to treat myself. As I have no money, it will have to be something small.

And with Sensible World of Soccer on the way for the Xbox 360, I think I also need to have a major goal for around June 2007, get that done, and treat myself to one of those.

No comments: