Development Web

Chrome CSS3 Transform Crash

This crash only seems to occur on some graphics cards, and as far as I know, only on Windows, so I believe it has something to do with Chrome’s implementation of graphics acceleration.

Here’s a test page:

You should see a zooming, fading effect there. If you don’t see zooming, but you do see fading, then your browser doesn’t support CSS3 transform, transitions or both.

Safari doesn’t seem to have this problem.

If you experience a crash, it might be helpful for development folks to know which graphics card you’re using.


Portal 2 Blobulator Fix

It’s been in trailers, so it’s no spoiler to say that Portal 2 has some pretty cool new mechanics; a lot of them are related to various gels that can be spread across surfaces in order to convey a number of interesting properties.

While I thought all the gel effects looked great, I had a weird hitching performance issue whenever there was a lot of the stuff flying around. To be clear, the rest of the game was running smooth as butter, the hitching only occurred when the gel presence was thick.


I heard a developer commentary on the gels and the challenges faced when trying to optimize the code to work on the Xbox 360, and how it was easier on the PS3, because the blobulator threads could be passed off onto the SPU. This had me thinking that maybe my ageing Core 2 duo just didn’t have the cores required to process the calculations effectively. I also read from others experiencing this issue that dropping effects to medium fixed the hitching, and while this was true for me, that also reduces other areas of detail I was having no trouble with. I needed to just optimize the Blobulator, so off to the developer console I went.

The two most important commands I discovered were

“r_paintblob_max_number_of_threads” = “4” ( def. “4” ) client                    – Indicates the maximum number of threads that will be spawn [sic] for the blob.

“r_paintblob_highres_cube” = “0.800000” ( def. “0.8” ) client                    – Set cubewidth (coarseness of the mesh)

It’s worth noting that there were a ton of Blobulator related errors filling up the console as I stood in front of a glorious gel stream.

Threads and Meshes

I thought dropping the threads to 2 would be sensible, given that’s the number of cores I have, but no dice. The way threads are handled must be more complex than that, or it simply expects to be able to use 4 threads if it’s going to do any threading. Anyway, dropping the max number of threads to 1 totally worked! Yay! No more hitching! Except now the framerate was bad when looking at gel. Boo!

Because I had taken out threading, the calculations were simply too much for the CPU to bare, so by increasing the highres_cube value, I was able to achieve 60FPS no matter what. In fact, I only had to increase this value to 0.9 in order to get a stable framerate at all times, and the impact on blob quality was negligible (as a side note, the medium effects setting increases this value to 1.4, which is much more noticeable).


So there you have it. I’ll list my PC spec and the commands used here for reference.

  • E6750 Core2 Duo 2.66GHz
  • 8GB 1066MHz OCZ RAM
  • Radeon HD5870 1GB
  • Seagate 7200.12 1TB HDD

That’s all the important stuff, right? Now the commands.

r_paintblob_max_number_of_threads 1

r_paintblob_highres_cube 0.9

It seems as though the config file used is packaged into the Portal 2 executable, and I haven’t seen a way to get the game to boot with an alternate configuration, so it looks as though you would have to enter these commands every time you start the game. I find it’s a pretty good tradeoff for the ultra smooth and optimized experience. Also, just have a play with the commands in the console while you’re there and experiment with the other crazy hidden-away features.

Development Web

Support IE6 With the Back of Your Hand

I’ve been doing a bunch of development work with CakePHP lately and have gotten to the point where I’m in a position to submit a few bug fixes and improvements back to the project. One small improvement has already been accepted, so that’s a great start! Working with Oracle, PHP, CentOS, and CakePHP has been an… interesting experience, so I’m hoping to get some information together about that process and make it a little easier for others in the future.

In other areas, I’ve been trying out Sass, Compass, and blueprint, with exciting results. If you wish for CSS to be more pragmatic and structured, these tools are for you. I’m particularly interested in the potential of very experimental CSS3 implementations, like transform and transition. Makes the web feel modern all over again.

When asked to support IE6, I would do it, but I’d do it like this. I actually rather like the idea behind the Universal IE6 CSS project, in that it still aims to provide a usable and clearly presented version of your site, substituting only CSS, but lets those users know they’re getting a much reduced experience. If they’re on the Internet, why haven’t they hopped on the future train yet? Come on people, get with the program. The fact that projects like this have to exist is pretty crazy, but now that we’re in this mess, I’m glad it does.


Not a Review: God of War III

On the back of hearing that God of War III is one of the best PS3 games of 2010, plus having played the previous two games, I felt I should finally give this game a go.

First of all, God of War III is clearly a game about spectacle. The sense of scale imposed in so many of the game’s scenes is really something to behold. It feels pretty satisfying to see Kratos climbing over giant Titans, literally messing them up inside and out, but this kind of thing brings its greatest strengths and weaknesses into stark relief. It’s kind of the same with every God of War game; the best things it has to show you require very little interaction from the player, and any player interaction feels pretty disconnected from what’s happening on screen.

I think enough has been said about the exceptional polish on God  of War III, so I’ll just jump into some of the glaring oversights I noticed during my time with the game.


You know how it is. When you’re sitting down to continue your game, you just want to boot right up and get in there as fast as possible. I’m a busy guy, OK? Sure I hammer on the go button during those logo builds, because I just want to get into the game. How annoying is it, then, when the game disregards any saves you may have on your console and always makes “New Game” the default option? It’s especially bad when that launches you into an unstoppable, unescapable opening cutscene, which was pretty cool first time around, but now only makes more apparent the need for better UI design on the front end.

Always check if the player has saves, and make Resume or Load the default menu option. If you can’t check for saves, make it the default option anyway; the only people you’re going to piss off otherwise are those wanting to quickly jump in and continue a game, which will happen more often than the guy jumping in for the first time and accidentally hitting Load.

I admit it’s a weird thing to notice, but it became a problem enough for it to really stick out. Just bad UI.

Combat and Control

It’s hard not to let my experiences with other character action games like Bayonetta inform some opinions about the combat in God of War III. So rather than fight it, I’ll just run with it.

I feel like the combat in God of War III is starting to show its age. Maybe I was never that into it in the first place, but when compared to Bayonetta, I just don’t feel like I have as much control in God of War. Having spent a crazy amount of time thinking about it, I believe a lot of it comes down to evasive maneuvers and blocking. Too many times in God of War did I feel like I got hit because I couldn’t break the animation of some protracted attack, while I don’t remember having that problem at all in Bayonetta. Sure Bayonetta’s evasive flip is a little fudged in the way it can be used to avoid damage from any earth-shattering attack, but at least I felt in control. When I hit that evade button, I got the expected result and it felt super satisfying; sadly the same can’t be said for blocking in God of War. There I just felt like some of the attacks would take longer to complete than some enemy’s attack animations, meaning I had no way of hitting block in time. Am I supposed to avoid using half the repertoire of attacks because they’re too slow? I think it’s better to give the player a greater sense of control and balance around that, rather than punish the player for using anything but quick light attacks.

I felt like Bayonetta was weighted more toward rewarding the player, with an evasive move that avoids damage by itself, but also grants additional bonuses if timed well.


An enemy that can perform an attack that, if it hits under certain frequently occurring conditions, will kill you instantly. Yeah, that’s pretty messed up. The game has a lot of places in which you can instantly die (and I’ll talk about that later), but none are more infuriating than this, because this one always means having to start an entire encounter again. I hated them in the last games, and was sure that Sony’s Santa Monica Studio would balance them appropriately in this game, maybe making you take a few hits before crumbling to pieces (you know, like the other guys when they’re turned to stone), but sadly no. Fortunately there is not a litany of them in this game, but I wouldn’t have been sad to see them gone completely.

Puzzling Traversal

The single greatest cause of death among Gods, it would seem, is stepping off the edge of a cliff. There’s a terrible inconsistency with invisible walls that prevent you falling to your death in God of War III. Sometimes you’ll be trying to jump down off a platform, only to be foiled by the God stopping power of an invisible barrier, then you’ll be sauntering off the edge of a cliff because the same courtesy was not afforded at this particular spot. It’s an inconsistency that really stood out.

The second greatest cause of death is probably the Icarus wings choosing to take a day off at the most inconvenient of times. I could seriously be holding that jump button for dear life and have absolutely nothing happen. I tested the button for responsiveness and even used a different pad – same problem, sometimes they just wouldn’t go.

The most hilarious thing about all these traversal related deaths is the message asking if you’d like to switch to easy, adding that this only affects combat. Thanks, game, but I just want jumping to work, cool?

You Should Still Check it Out

Despite my grievances on the oversights, I still think God of War III is at least a 3 star game and worth checking out. I’ve probably been too affected by Bayonetta at this point when it comes to the combat, but nothing quite compares to the sheer epic scale on offer here.


Starcraft II Region Locks

Let me start by saying I’ve been really enjoying the single player campaign in Starcraft II. It’s deeper, more varied, and better thought out than that of any other RTS I can think of. The character interactions in between missions give a lot more life to the story than you would normally expect from a genre in which the most personality you usually encounter is the voice that comes out of a unit when you click on it. Blizzard did a great job on the campaign, but the entire package costs as much as a console game. The only reason I can think of for this is, and this is where my complaints lie.

Region restrictions, especially the way Blizzard has implemented them, are extremely arbitrary. The only argument being given for using a region lock has been that “we cannot guarantee a positive gaming experience for users connecting to servers outside the supported region,” but lets investigate what a positive experience really means.

The first thought most will have is that of latency, but consider the region of space the North American version covers. From Anchorage to Miami, it’s about 4000 miles, while from New York to London, there’s about 3400 miles. Even within the contiguous states, New York to San Francisco is about 2600 miles. Keep in mind that between the UK and the US, there are transatlantic pipes of incredible bandwidth, meaning that there is but a single hop between the two. Between New York and San Francisco there are likely to be several hops, each one adding a little more  chance for packet collisions, drops, and latency. Couple this with the generally poor performance of home broadband in North America, and it’s hard to see why Blizzard would not at least let the rest of the English speaking world play together.

That brings me conveniently to my next point. What is meant by “a positive gaming experience?” Much has been made of the importance of community on the Blizzard side, but communities are built on communication, and the UK is region locked with other countries that do not speak English as a first language. This is not to say that players from those other countries never speak English, but language is an important factor in community building. Indeed, if you observe gaming communities online, they are universally split by language more than region. It is therefore not out of the realms of possibility to consider that European and NA gamers have always played together, and by separating them, Blizzard actually discourages worldwide communities, rather than allowing them to flourish. The answer here from Blizzard has been that players should buy multiple versions of the game, thereby creating financial barriers to “positive gaming experience.” Though that’s really not the message we should be sending: that it’s OK to regionally lock out the Internet – the first universally accessible means of worldwide communication and interaction.

If there’s a significant number of players out there that really care about their ladders, rankings and latency so much that they’re willing to forego worldwide liberties for the experience, then I think at the very least there should be the ability to create worldwide player matches. Then they would at least be separate from the ranked matches, but that still doesn’t really help worldwide friends who want to see how well they can compete in 2v2 or 3v3 matches. Ideally, there should always be an option: “Match with players in my region.” Done. It is technically possible, there’s precedent for it – Microsoft have done it with Live – and it solves all these problems.

It’ll be interesting to see what Blizzard decide to do as a result of community feedback on this issue.


Dialogue Audio Cut Off Issue

After a few months of having a weird issue with dialogue audio in Mass Effect 2 on the PC, I may have finally found the solution.

The problem reared its head when I switched to Windows 7. While this switch allowed me to finally use digital 5.1 through the on board audio device again – after it had been taken out of Windows XP – it introduced another problem which was particularly noticeable in games with dialogue audio. The issue caused all single audio samples to be cut short by a certain percentage. What this equates to is that when characters had a long line of dialogue, the last few words would often be missing, and the game would go straight to the next line. This wasn’t so noticeable with very short lines, leading me to believe it was some kind of timing issue, like maybe the sound was going marginally too slow. Needless to say, this is kind of annoying in a game with so much d…

I noticed this problem again in Starcraft II, so I had to get to the bottom of it. Fortunately, the latest few responses on the Mass Effect 2 technical support forum – which had not been present when I had this issue before – gave me a clue as to how I could fix my specific issue. My motherboard is an Asus P5K, featuring a bevy of overclocking features, one of which is the N. O. S. setting apparently geared to automatically overclock components according to load. This has a separate PCI setting, which I thought might solve the problem if I scaled it back to default, but no dice there. The solution came when changing the overclock type from N. O. S. to auto. At last! The audio no longer cuts short!

You lose some control over the overclocking this way, but I had only set the N. O. S. to 3% overclock anyway. Perhaps a BIOS update could fix this in the future.


CakePHP, Rolling Session IDs, and Concurrent Ajax Calls

Picture a set of buttons in a list that allow users to quickly cancel listed bookings. These buttons make an Ajax call to a controller action with the relevant ID passed as a parameter. I already have a jQuery method turning these buttons – generated with Cake’s HtmlHelper->Link() – into Ajax calls using the anchor’s href as the URL.

By itself, each button works perfectly. The problem shows itself when a user tries to cancel multiple bookings concurrently. The controller action will process the first request, but choke on all the rest and return a blank response.

This is a very specific problem I had encountered with CakePHP, but I think with Ajax becoming the norm for web application interaction, it’s worth mentioning this fix. The problem lies in the way session IDs are regenerated between requests in Cake’s highest security setting. An easy fix would be to set Cake’s core security level to medium, but we care too much about security, right? So we’ll make a reusable fix that allows us to overcome this issue without affecting security across the board.

In the controller:

function beforeFilter() {
    // Fix for concurrent Ajax requests
    // If it's an Ajax request and the session id has been passed, retain it
    if ($this->RequestHandler->isAjax() && !empty($this->params['url']['s'])) {

This is a modification of a solution given by Adam Royle, changing the process to be more reusable with an optional querystring variable that indicates we want to keep the session ID during an Ajax call. This means if you don’t expect concurrent requests, you can forego the querystring and your action will perform as normal without it, regenerated session IDs included.

The link can then be generated like this:

echo $html->link(__('Cancel', true), array('controller' => 'bookings', 'action' => 'cancelBooking', '?' => array('s' => $session->id()), $booking['id']), array('id' => 'cancelLink'.$booking['id']));

Thanks be to Adam Royle for discovering the root of the issue.


This is still not a perfect solution.

  • It effectively exposes the temporary session ID to the user.
  • It will also still fall over if the session ID is regenerated by another Ajax call on the same page, meaning all Ajax buttons in a single view must have this logic.
  • If the user navigates away and performs other actions, then returns to this page using the browser’s back button – and therefore, the local cache – the session ID will be wrong again and cause a logout.

Other possible solutions:

  • Queueing Ajax requests in jQuery so the session ID can regenerate as needed.
  • Session handler in Cake is modified to not regenerate session IDs when request is from an XML/HTTP Request Object.

If there are any other ways of preventing newly generated session IDs from messing with concurrent Ajax requests, I’d love to hear them!


World Power

I recently bought a Hitachi 1TB external hard drive for all the backing up I should probably be doing, and was surprised to find it comes with not only an AC adapter that will accept 100-240v, but also an array of international power socket attachments. Having lived abroad, I’ve dealt with the consequences of devices that don’t even have AC adapters that deal with the full range of voltages, and let me tell you, it’s a pain. Either you’d have to buy a transformer (not the awesome kind), which is expensive and can usually only deal with one device, or you buy a whole new one of whatever device it is.

I imagine the thinking behind making this hard drive internationally usable lies in the already existing international power supplies that come with notebook PCs, rather than a drive to bring us all closer together. It’s true that some things probably aren’t going with you to another country if you emigrate, but when portable devices like the Nintendo DS don’t even come with a power adapter that will accept other voltages, you have to wonder if Nintendo ever conceived of someone travelling with it.

As far as I’m concerned, the more devices that support around-the-world usage the better, even if it’s just an external hard drive.


Demo Transition

At what point do you think you’ve played a demo of a game enough times that you should just transition to buying the full product?

I’ve played the demo of Just Cause 2 at least 3 times now, which is really saying a lot for the quality of this slice of open-world pie that’s on offer here. The fact that the same area of the world keeps me coming back for more speaks to just how much fun it is to simply mess around and answer questions like “what would happen if I attach this thing to that thing and then shoot?” While many of these questions end in me laughing out loud to myself, I can’t help wondering whether this kind of open-world physics-based fun will endure the length of the game. Of course, I hope it does, and some reviewers seem to have had a lot of fun with it.

I appreciate the freedom given to make a mockery of physics, and tethering stuff to other stuff in varying situations never ceases to amuse. It’s a physics playground even more so than most other similar open-world games, though more grounded than something like Gary’s Mod; you can’t make a gun that shoots bikes, after all.

I haven’t heard of any good rental systems here, otherwise I’d likely do that. I should probably start researching the ones that are available, but I might just end up buying the game instead.


Punkbuster: Still a Thing

So yeah, Punkbuster is still a thing. I had this weird issue while playing Battlefield: Bad Company 2 where suddenly every server would instantly reject connection with the message “you need to have punkbuster installed and running…”

Fortunately, an observant user by the name of NeOn over at the Steam forums noticed the fix

This fix is for those who have tried everything, updating PB manually, starting service etc, but still ending up with the message: “You need to have Punkbuster installed and running”.

The fix:
– Start BF BC2, go to Options>Settings and under “Gameplay”, tick the “ALLOW PUNKBUSTER”.
– Join a server and play!

What’s odd, is that I’ve never unticked that option after installing BC2, still it was unticked.

Neither had I! Glad someone is keeping their eyes open.