Wednesday, February 14, 2007

A Cursory Glance

So this is just a brief post to resurrect my blog... ok ok i realise i haven't posted on it for the best part of a year. i also realise that i doubt anyone will read this. maybe when i've put something new and good on it i'll get one of my popular friends to link me - fame and fortune ahoy!

so in the last year i have moved from Anonymous Surrey Based Microsoft Subsidiary (ASBMS for short, it really rolls off the tongue) to Anonymous Central Guildford Startup Company (ACGSC from here on in). there's lots to be told but quite how i can tell it all without giving the game away (aha, ha) is another matter. i'll figure it out soon.

it's Happy Screw You Single People Day, so i hope everyone is having a good one. laters!

Monday, April 24, 2006

Movin' on up, nothing can stop me

Ah, nothing brightens up a dreary Monday morning quite like the dulcet mid-90's tones of Heather Small.

The news hot off the press is that i'm leaving Anonymous Surrey Based Microsoft Subsidiary (ASBMS from here on in). I got a great job offer from another company just down the road, and i leave at the end of this week.

It was a sad thing to do but made so much easier by the recent round of redundancies. I reckon about 80% of my friends went in that - i sure know how to pick them. However that still didn't make it particularly easy. Probably the hardest bit was breaking the news to my boss Gary. He had known about my potential plans a good month ago but things had gone quiet for one reason or another, and after that point as far as we were both concerned I was staying.

Things soon hotted up again, the deal was back on and things moved fairly quickly. I grabbed Gary for a "chat" and i think as soon as i said "can we go somewhere private" he pretty much knew what was going on. The conversation went something like this:

[We enter a room. Jonny looks sheepish. Gary twigs]
Gary: So, do i have to punch you?

Gary likes me a lot and i like him (Not like that, he's married and i don't think the age gap would work), but he's sad to see me go. I'm sad to go as well i guess. This was my first job in the games industry and i've learnt a lot, and more importantly made some great friends. However it began to dawn on me over the last few weeks that ASBMS isn't somewhere i really want to be any more. On the contrary, as soon as i saw what the new company was doing i fell in love it and the more i thought about it the more passionate i became. I suppose the end result was inevitable.

The upshot of all of this is that i have a week left at ASBMS and i start at the new place on Wednesday 3rd of May. Exciting stuff :)

Wednesday, April 19, 2006

Pointless Disruption Of Workflow

Well, it would be a disruption of workflow if i had any work to do. I suppose there are some people, somewhere, whose work was interrupted by us having to move to a new office for two weeks.

Ah, good times.

Essentially we move out to a now vacant office (made possible by the redundancy of 50 people, cheers guys) so our one can be gutted / renovated for another team to move in. And then we have to move again into their old office. I don't know what happens to old/new/current (depending on your point of view) which is then left empty once again.

Now we are owned by Microsoft we clearly have bags of money for this kind of tomfoolery. Where will it end? Hopefully stupid amounts of cash will continue to roll our way and we can have enough toilets, and other ridiculous frivolities like that.

Friday, April 07, 2006

The other side of the coin

Buy Buy Buy! Sell Sell Sell!

If you follow the video game press (or any press at all) you may have spotted, tucked away in a corner, that we (Anonymous Surrey Based Game Developer) got bought by Microsoft yesterday.

Yay i guess. To be honest i can't really see any negatives for us, as employees, at this stage at least. Obviously it was hugely positive for the directors as they got a decent bit of cash out of their shares in the company (and no, i don't know the sum we went for, but anything between $50m and $100m seems reasonable). For those at the coal face, life continues as normal.

We had a party last night (ironically it was a leaving party thrown by a bunch of (ex)staffers for the people who were leaving as a result of the consultation) and as such the numbers in the office are somewhat diminished - and for those who are in, it is many people's last day.

There are many tangible benefits from now being a tiny cog in the proverbial clockface of Microsoft productivity (you like that? I just made it up. Bet you couldn't tell, could you?). We get free xbox 360s (woo!) and now we are a first party developer, free copies of all first party games. Also we can get massive discounts at the microsoft store (as one designer put it, in front of many senior MS honchos, he was eager to replace his "questionable" copy of Office), and access to the Microsoft libraries. If you don't know, MS has their own printing company, Microsoft Press, which produces a lot of stuff which isn't seen by the outside world - so this is a definite plus.

Microsoft were firm that they wanted to retain "the culture" of our place of work, which can only be a good thing. However, how much this will remain true a year or so down the line is of course yet to be seen. Somebody asked "will their be permanent Microsoft people on site" and my friend remarked quietly, "Yeah, us".

I suppose it hasn't quite sunk in yet in that respect.

Photo diary of skiing trip part 3:


Took this from the balcony of my apartment, i thought it came out nicely.

Wednesday, April 05, 2006

A Mile And A Half Up

Here is a photo i took last week in the Alpes - it's from near the top of a mountain called Les Perrons (2620 metres):


The resort i was in is called La Toussuire and is totally ace - The town itself is quite small but the ski area itself is huge (310km). That's not an area though is it. Interesting.

One of the most interesting things about the place is that the French have kept it almost exclusively French. The upshot of this is that we were about the only English people in town (seriously) and everything was decidedly less Anglicised - which was rather refreshing after the occasional excesses of the almost ex-pat outpost nature of places like Val d'Isere, Les Arc and Val Thorens. Posted by Picasa

Tuesday, April 04, 2006

Home Again Home Again Jiggety Jig

I have just got back to Anonymous Surrey Based Game Developer Towers from a lovely holiday in the snow:


I return to work feeling wonderfully refreshed and actually able to get out of bed in the morning, which is a lovely change.

Of course i return to a slightly different work to that which i left - many of the people who were on the cusp of leaving before have now gone, which leaves something of a void in the office. I feel like i've missed out on some monumental exodus.

However, all is not lost. I have spoken to a couple of now sadly ex-colleagues and it seems the mood is now one of cautious optimism. ASBGD have been very supportive throughout the process, organising meetings with recruitment agencies, who in turn have organised presentations by a number of major game developers. Already people are getting interviews; some have already got jobs, which is just fantastic.

Whatever the feeling about ASBGD is in the game playing community (it seems to vary wildly depending on the quality / integrity of the hype surrounding our latest title), within the game development community it seems that having experience here is certainly advantageous; it's almost like we are respected as developers!

In fact, being slightly less cautiously optimistic (more optimistic?) a forced move may even be advantageous to people. Within one company there is a limited choice of career paths, and these may be blocked by default due to senior, long standing, key members of the company holding positions that one would otherwise be interested in. Moving out of that company of course demolishes this so-called glass ceiling, and (i hope) will enable people to get positions they deserve in companies that treat them well.

Friday, March 24, 2006

You know what they say, no noose is good noose

So after the uncertainties of yesterday, i discovered that i get to keep my job (or rather, i get to keep a job, quite what it will be is still uncertain - largely because no-one quite knows what the project will be). I'm not totally sure which programmers didn't make it, although i know of one guy, Phil. Like many others, i heard he hadn't got a position, and when i turned around to see how he was he just wasn't at his desk. Of course, there's no reason for him to remain, but it's sad when, like so many others, he just slips away.

I think other people are going to leave, even those who weren't in danger of losing their jobs, merely through the destructive nature of the current situation. If all of one's friends have been suddenly made redundant in one mighty fall of the proverbial restructuring axe, it would be perfectly rational to decide that there is no reason for one to remain either. It's something i have certainly considered; Most of my good friends have gone or are going, and when i spend 5 out of 7 days of the week in this place, i want to keep the best company i can. I for one, however, am staying for now.

One slightly happier, albeit poignant, situation arose today. One of the online guys, Pete, had discovered a few days ago that he would be out of a job at the end of the month. However it seems that this was decided without consulting some of the key people involved in his particular area of the online stuff - and when they put their heads together they decided that actually there was masses to do and he was most definitely required. So he got his job back, which was lovely, but it must have been an awful emotional strain to be put through the process of potentially losing your job, then actually losing it and having to come to terms with it, and then being given it back. I joked that it would have been great if he had officially accepted his redundancy, he could then have sued them for rehiring someone within the obligatory six month buffer (even though it was him). As i mentioned yesterday, people are sending out their leaving emails all the time. What was lovely about this situation was that Pete was the first person to send out an "I'm not leaving" email. The email was not condescending or derogatory to those who had been "set free" as Pete put it, but full of sympathy and pathos.

But what of the future?

Well i think the next few months will almost certainly leave a slightly bitter taste in the mouth; Anonymous Surrey Based Game Developer probably won't be the happiest place to work. We are shuffling offices soon, familiar faces who up until recently were part of the furniture are absent, morale is across the board exceedingly low - strange days indeed.

However once the new game gets up and running i think things will gradually sort themselves out in the wash. Although it may seem slightly morbid, those who remain will constitute an undeniably great team. A large number of those in my new team are people who i know from prior work on Anonymous Hollywood Based Simulation Game and i know they will be great. It looks like it will be at least another month though before the project, in whatever shape or form it takes, kicks off.

Anyway i have some lazing about to do.

Thursday, March 23, 2006

Ah, Good Times

So my friend Ed berated me last night for not updating this blog enough; mainly because i think he is curious as to the machinations of the mighty Anonymous Surrey Based Game Developer.

Times are, shall we say, tense. Most of my best friends have been made redundant - Jim and Tom to name but two. Jim still has work to do so has to come in, Tom doesn't, so isn't coming in anymore. He got made redundant while i was away too, so i didn't even get to say goodbye. *sob*

The mood is weird at the moment - people are basically fading into the background and quietly disappearing. Every half an hour it seems, there is another email from somebody announcing they are leaving. It's somewhat destructive for morale, to say the least.

I had my one and only interview last night and alledgedly we (coders) shall find out today our fates. it's difficult to be optimistic or even care that much, especially when i know that even if i keep my job some of my mates won't. And even then i won't have anything to do straight off, probably for at least another month at least.

Still, i'm going snowboarding next week, so it's not all bad.

Friday, March 10, 2006

So... Bored...

Well i woke up at 5.30 this morning for absolutely no reason, which wasn't a good start.

All is not well at Anonymous Surrey Based Game Developer (ASBGD). Essentially they have discovered that they have too many people and not enough jobs. So about 100 of us have gone into a "consultation" process whereby we get to reinterview for jobs - there are, of course, less jobs than people. Ah, good times.

Given that my project got canned a good month ago, i have basically had nothing to do for a month. It seems like blessed freedom to start with - after all i am still getting paid but having to do nothing at all. However it does begin to grate after a time; it may seem backwards but i really want to come to work to work. It is hard to motivate myself to even do my own stuff now, but i think that it is quite psychological.

The rationale is this: If i am at home then i can choose to do my own projects / whatever and use my time as i see fit. Coming into work, strange as it may sound, I actually want to do work. Instead my hand is forced and the only thing i can really do to keep myself busy is my own stuff - but because in a way i lose the ability to freely determine when i work on my spare time projects, i become less motivated to do them. Make sense? Didn't think so.

The upshot of all this is that i feel like i am slowly losing my mind. I have applied for a couple of positions here but i don't, as yet, know when the interviews will be. And so i sit and stew... is it too much to ask to know my own future?!

Ok perhaps a little, and i understand the problem ASBGD is facing. However for me and my team we have already been kicking our heels for a good amount of time. There is no reason for us to be here, yet we are told that the only way we can miss days is to take it out of our holiday time. Bonkers!

oh yes i realise that the xml didn't display properly last time, but i don't care :)

Monday, February 27, 2006

XMHell... Aha! A pun!

i decided that i recently wanted to have a nice,simple, readable data format for my projects to make inputting data simple and as generic as possible. I thought it would be quite nice, just for kicks you understand, to write an XML parser, of sorts, to contain the input data.

It worked out quite nicely. I fear i have somewhat raped the language but i use only a very limited subset of the syntax, and a few homebrew things, but the documents look nice at least. Another advantage is that one ends up with a very useful tree in memory once you have loaded up the xml file. I have made it so you can access your data through a kind of dot (".") operator. For example, we may have a piece of pseudo-xml that looks like this:
[cookies]
[chocolate yumminess=1/]
[ginger yumminess=2/]
...
[/cookies]

And then you can access the data just through a cookies.chocolate syntax.

So that is nice. I have rather lost my train of thought though. Bye!

Monday, February 20, 2006

Update At Last

Ok so i didn't write anything on here for a while, largely due to a) total lack of inspiration and b) a decided lack of motivation at work. Slightly dangerous for me to write, perhaps, especially if someone from work happens to read this.

Anyway it has all be resolved in one way or another. I am at a slightly loose end at work now, and decided that today would be a good time to install some new development tools and some developer kits for Xbox 360 and the like.

Cue copious "I'm sorry, software X cannot be installed due to spurious reason X, please fix it and start again". The thing that really got to me was that the software i was installing knew exactly what the problem was... so why couldn't it fix it itself? That and Microsoft's seemingly bottomless desire to have a different installer for every revision of their software, so that you are perpetually confused as to which one is correct. Bonkers.

However, i am happy sitting about, safe in the knowledge that my computer is doing something vaguely worthwhile and not requiring my intervention. And then i feel comforted by the fact that it's ok for me to cancel the install process half way through to play Battlefield 2 at lunch time, as no-one is particularly concerned by my productivity at the moment.

Yes, i am in limbo. But it is a happy void filled with cups of tea, reading interesting articles and deleting spam mail with such titles as "The safe way to drown your girlfriend in semen!". Quite apart from the fact that i cannot think of a safe way to drown anyone, i am not sure why this is supposed to be an attractive proposition at all. Even if it will make my "ejaculation remind me of a bubbling fountain".

Wednesday, February 01, 2006

Warp Coil Overload

Or something, i don't really watch Star Trek.

Anyway i haven't updated this in a while, but i think i have genuine medical reasons! I think. CRT monitors emit copious amounts of potentially harmful electromagnetic radiation, from which the user is shielded to the front by the design of the monitors. However, there is no shielding to the back and sides.

And i am sitting about a foot away from the back Rohan's 21" Iiyama CRT. No wonder i have felt lacklustre and unmotivated! (Well, it's part way to an explanation). We are packed so tight in here that not only have i been constantly irradiated for the last few weeks but the air around my desk has been noticeably warmer than elsewhere in the office. Either that or my noodle is being slowly stir fried.

I have a two part solution:
1) Install a fan. This I have done and it is keeping me cool but is only a temporary solution as my brain is still being melted
2) Move me or Rohan. This is a better solution but also sad as Roh and i get on well. But Hallelujah Salvation and Glory it shall come to pass, as Roh has graciously agreed to move once another artist leaves, which works well for him as he is at quite a crappy desk and moving would bring him closer to the other artists.

So, the moral is: CRTs MELT YOUR BRAIN.

This isn't science fiction people, it's Science Fact.

Tuesday, January 24, 2006

It's depth of field cap'n, but not as we know it

Recently graphics cards have got enough grunt to do nice special effects in real time, like depth of field - this simulates a camera having a focal point; stuff drawn at different depths from the focal point can be blurred out a bit to give us what looks like a camera being in-focus and out of focus.

So far, so good.

This effect is pretty expensive though and if you are doing a 2.5d scene or game (full of billboarded polygons), there is a neat little trick that is super quick and looks ace. This is for DirectX by the way, i'm sure you can do a similar thing in OpenGL but i'm not particularly familiar with the API.

If we have a texture of size 256 x 256 say, then we can get 9 mip map levels. At its simplest level, one can just set D3DSAMP_MIPMAPLODBIAS to be bigger than zero according to the distance of the billboard from the focal point, and voila!

Incidentally if you do do this then this particualar sampler state expects a float value so you have to do *((DWORD*)(&value_f)) to get passed properly, as the argument type is a DWORD.

So, we have our blur. The box filter that D3D uses is a bit bobbins though, so you can make this a bit better by setting D3DSAMP_MIPFILTER to be something other than D3DTEXF_LINEAR (maybe D3DTEXF_GAUSSIAN).

If the objects are going to stay a fixed distance from the camera then we can probably fiddle with these and get nice enough results. Even so, we can make it look better than this.

Here we get a bit shady and pretend like we don't care about how much memory we are going to use. Let's say that instead of having 1 texture we have a whole bunch, maybe 20, maybe 50. Then, offline, we do a gaussian blur on these textures, each one being a little blurrier than the last. The result is a nice list of textures which get blurrier as we got, and we can just set the texture for the object depending on its distance from the focal point.

Once you have generated the textures (which takes a while) this is nice and fast, and looks ace. Hurrah!

Wednesday, January 18, 2006

Ummm.... I forget

As i mentioned before, memory on a console is a precious commodity. it is up to the programmer to ensure that any memory they have allocated "dynamically" is cleaned up - the computer doesn't know when you are finished with it. Failure to do so results in a memory leak.

Today i updated Steve's PS2 memory leak tracking code to work on the PC build of the game, hopefully to make finding memory leaks a bit more painless. Essentially what Steve's code does is store the return address of the new call, a pointer to the allocated memory and a bunch of other data (amount allocated etc) in a list. Then, whenever the memory is deallocated it is removed from the list.

So, to find a memory leak we just dump the contents on the list - anything left on it is, at the point of the dump, a leak. Of course it's not 100% accurate as you may have allocated memory during the time of tracking the allocations which isn't supposed to have been deallocated. But usually it's pretty easy to tell which one is which.

So here's some technical bits. The key to the whole technique is knowing where the new call is made (new is the function used to get a chunk of memory, if you don't know). So we need to get the point at which function x calls new, and we can do this by looking at the stack. To cut a long story short you need two incredibly complex lines of assembler:
mov eax, [ebp+4]
mov ReturnAddr, eax
you need ebp+4 because at this point ebp points to the calling function's base pointer. This all works according to the __cdecl calling convention. This is a good reference for calling conventions and what they mean and what they do.

I intended this blog to be reasonably non-technical / jargony and to require little previous knowledge about the subject, but this was just quite interesting so i thought i'd share it.

Monday, January 16, 2006

Render Where?

That is the question.

Since we are developing a game for 3 separate consoles simultaneously it makes sense to try and write code that will work on all 3 in one go, if we can. In order to lighten the workload for us we use a "bought in" graphics engine called Renderware (hence the hilarious pun in the title). This has different versions for different consoles but at the top level looks very similar. Which is nice as one can write code which uses Renderware and it should, hopefully, fingers crossed, look pretty similar on consoles across the board.

Quite whether Renderware or Sony are to blame for the extreme state of stress i have experienced today is open to debate. I want to blame Sony for making the PS2 a nightmare to work with. However, i also want to blame Renderware for being thoroughly shady in some of its functionality. Perhaps i shall blame Sony and Renderware. Yes, i think that does well.

The problem arises when one attempts to examine the pixel data contained in a texture. For the uninitiated, in computer terms a texture is a collection of data (typically square, for our purposes) which when viewed on the screen is a picture. Within the texture is the colour data, organised, according to the texture format, into pixels. So, each block of memory which makes up a pixel can contain Red, Green, Blue and Alpha (transparency) information. Renderware gives us a "pointer" to the start of the texture, and reading can commence. However the playstation in particular doesn't store its data linearly, preferring to "swizzle" it in order to make it faster to access. This means essentially that certain values get swapped about, in a confusing manner. This is all well and good as Renderware is supposed to sort it out for the programmer, to make life easier and less error prone.

I am discovering that life is rarely less error prone.

The particular situation which i am dealing with (i won't go into massive depth, but it's a palettised texture if you are interested, and i want to write directly to the palette) is probably the point where the Renderware programmers got bored of making things sensible and decided to really shaft you.

Suffice to say that combined with the enormous compile times for the PS2, i am not the happiest of bunnies with Renderware at the moment.

Friday, January 13, 2006

Ich Heisse Super Fantastiche

So i just finished profiling my new font system and it's over twice as fast as the old one - hurrah!

When i first profiled it it was a bit slower than the old one and i was slightly confused - how could code that demonstrably did less actually be slower?

Well i found the answer hidden away in a clear() function for our vector class. A vector in this case is a list of items (an array) which dynamically grows as more items are added. A specification called the Standard Template Library (STL) exists which implements a std::vector class but this is not particularly console friendly so we avoid using it and have our own (CVector, funnily enough). STL specifies that when one clear()s an stl vector, the data contained should be scrapped but the allocated memory retained. Handily, however, the Microsoft implementation of std::vector (as i have been testing on a PC thus far) doesn't conform to this, and does de-allocate the memory. And oddly, our CVector class does too. Bizarre. I would have thought that for a piece of code which to all intents and purposes attempts to duplicate STL functionality (at least, from the outside) this would be a reasonably salient point to adhere to.

Now, i don't dare change it as the code base is quite large and it may result in a lot of extra memory being used up! However, at some juncture i shall probably test it.

Any road up, as they say, the problem was that i was calling clear() on the CVector. It should be noted that the old version of the font stuff was using a STL vector, and here we can use erase(begin(), end()) to get the required functionality. However, like i said, CVector is a better choice here.

Rather than rewrite the clear() functionality of CVector i decided to add another data structure, CStaticVector. It gives us vector like functionality (seemingly dynamic allocation) on a fixed size array. The other advantage of this is that it allows us to do bounds checking too, to ensure we don't attempt to read or write to memory outside of the array. C and C++, unlike Java, don't do this for us, which is one of the reasons that they are faster.

Tempting... But No

So today i got offered a job at the local Anonymous Baby Killing Fuel Conglomerate petrol station. I was flattered but had to sadly decline. Of course, in times like these one's rapier wit always fails, so i stammered the incredibly humorous "Sorry i've already got one".

The other lady (not the coffee lady who asked me if i was looking for employment) proceeded to say that you needed to be an octopus to do the job, clearly referring to the manic nature of the morning. However this only served to confuse me further as there seemed to be only two things to do - serve coffee and press the beeping button which exists in every petrol station - while needing an octopus would imply 8 different activities.

In conclusion, one needs only two, albeit very long, arms, to do the job. An orangutan perhaps.

Thursday, January 12, 2006

What The Font?!

Another day begins at Anonymous Surrey Based Game Development Company. I'm a tech programmer here, and at the moment I'm rewriting the font rendering system for the game I'm working on.

The existing system was not amazing in a number of ways; it was confusing, pretty slow and didn't look great. The latter factor especially is not a plus point for a text renderer. The one redeeming feature I could see was that it had an intriguing compression system.

The Playstation 2 is not as powerful or as good as most people think. The games that come out on it look amazing largely because of incredible amounts of hard work by the programmers to squeeze every last drop of performance out of it. The game we are working on is being developed simultaneously for Playstation, XBox and Gamecube and the Playstation is "the lowest common denominator" of the three - if it works well on that it is expected to work well on the other two platforms.

However, back to fonts. The main limitation of working on a console (when compared to a PC) is the lack of memory. The PC gives us virtually unlimited memory (called, coincidentally enough "Virtual Memory") as the operating system manages the memory for us and "pages" it on and off the hard disc. This is slow but it means that using more memory than is physically available is not a disaster. Programs like Word and Adobe Acrobat use clever vector methods of drawing text, but this is too slow for real-time games, and so we basically store what the individual letters look like in a texture, and then sample that to get words. So far, so obvious. However, textures take up a fair bit of memory, and when you have lots of letters that means a fair bit of memory.

So, how to make the impact as minimal as possible? The idea behind the previous system was to use as little memory as possible by ignoring any anti-aliasing information. Aliasing is an effect that causes continuous signals (such as what we see) to become indistinguishable when placed in a discrete space (such as a computer screen). In our discrete space we have only an approximation to the continuous space, and this is when we get aliasing; detail from the original continuous space is lost via the approximation. For instance, when you see a car on telly and it looks like the wheels are spinning backwards, this is aliasing. The tv captures motion at 24 frames a second or whatever, but this isn't enough to actually capture the true motion of the wheel spinning really fast, so we get aliasing - the signals become indistinguishable and detail is lost. Anti-aliasing is the name given to methods used to counteract this.

What this means for fonts is essentially smoothing:You can see that when we zoom into the letter its edges are smoothed out, so the line doesn't look so "jaggy" when viewed at normal size. If we ignore the smoothing the text looks very blocky. The advantage is that every pixel can be just "on" or "off" (1 bit per pixel) whereas the smoothed version needs values inbetween on or off, which logically takes more space to store on the computer. However! the old version was still storing at as a full colour value (32 bits per pixel) anyway for some reason, either pure white or pure black, so what i've done is store it as 4 bits per pixel so we have 16 possible smoothing values.

There are other caveats to both systems but i've written quite a long first post (during the excessively long compile times) so i'll finish there.

And oh yes, i am aware that "what the font" is a website, and yes, i am aware that it is great: www.whatthefont.com

Tuesday, January 10, 2006

Uhuh This My Ship

All the girls stomp your feet like this