Category Archives: games - Page 2

Project: MyWorld announced

We finally announced our minature-version-of-real-world-as-a-platform-for-games project last week.  Image shamelessly nicked from Luke’s blog:

I’ve worked on this for over 2 and a half years (in test engineering and software engineering capacities) and learned a hell of a lot during that period.  It’s not finished yet, but head on over and check it out :D

Data oriented design links

I’ve been doing a little reading around data oriented design of late and thought it was worth sharing some interesting links. Here’s my distillation of the reading I’ve done so far (caveat: I may be talking balls).

Prelude: Battling Dogma

All too often, games programmers butt up against dogmatic catch-all declarations of “virtual functions are slow!”  For the general case, this can be proved as a nonsense as virtual function calls are blatantly not slow!  They’re very, very fast.  However, if someone said instead, “virtual functions are slow when iterating over large collections of heterogeneous types because of cache misses” then that’s another matter, entirely.  Unfortunately, we all too often hear the former declaration rather than the latter.  It’s neither compelling (as we can prove it is incorrect in the general case) nor edifying.  Most programmers like to learn things, so it’s nice to read some illuminating articles about a touchy subject.

The gist of it

Data oriented design is based on examining the access patterns and transformations performed on data.  The code is then structured to make it data-centric by using a combination of changes to the type of data stored, the way it’s laid out in memory and the ordering of the data, amongst other things.  An instructive example of this is given in the BitSquid article where animation data is ordered by time, as this best fits the common access pattern that a game would use.  Another particularly useful example is where data structures are broken up into multiple parts so that more of the data used by common operations fits into the cache.

The main benefit is reducing cache misses, but a nice side effect is the increased opportunities for parallelisation.  A lot of this stuff is well-known and as old as the hills, but in my experience it’s often been bundled with dubious practices, so it’s nice to see some practical, tangible examples of when and why you should apply such techniques.


Games from Within Article — A high level article; Noel works through some disadvantages of object oriented design and then cites some examples where data oriented design can be employed to speed things up.

Pitfalls of Object Oriented Programming — Tony Albrecht of Sony has some very interesting diagrams, slides, timings and statistics that lay out the costs of cache misses and branch prediction failures with very specific examples, then optimises via various means.

Practical Examples in Data Oriented Design — Bitsquid engine programmers dish out some examples of designing with data access in mind.  Higher level that the Sony presentation, but also very useful.

GameDev discussion thread — Generally useful discussion thread.  Has some code examples, too.

Typical C++ Bullshit — Code annotated by cranky post-it notes.  Not exactly an illuminating discussion or an article as such, but worth including for completeness.


Game Entity Systems — The T=Machine blog has a series of posts on designing game entity systems.  One part of the series deals with processing homogeneous data and why this makes it fast / more easily parallelisable.

Mouse Input in FPS Games

Am I the only PC gamer that is really, really fussy about mouse input?  I say this because it feels like every other PC game I play comes with default input settings that are beyond jarring, yet most reviews fail to mention it.

This typically involves inbuilt mouse acceleration and/or input smoothing.  Here’s a tip for budding FPS game designers: I have no mouse acceleration because I don’t like it; adding it a default non-configurable behaviour is nothing short of infuriating for someone who is fussy about these things.

This is only going to get worse as more and more games are developed across multiple platforms.  What goes for consoles does not necessarily go for PCs, particularly when it comes to input.

NB: These things are subjective, so I say ‘right’ and ‘wrong’ enclosed in hyphens quotes.  However, my opinion is better than yours — this is the Internet after all! — so I’m probably right (no hyphens quotes).

Doing it ‘Right’

Games that do it ‘right’ usually take the OS mouse settings and meddle with them very little.  No smoothing, no acceleration.  If options exist for the game, you can tweak til your heart’s content.  TF2 is a good example of this; it has several mouse smoothing and acceleration options, but doesn’t enable them by default.  As such, it ‘just works’ out of the box using your OS settings, but there is scope for customisation.

Doing it ‘Wrong’

Games that do it ‘wrong’ can commit any number of crimes, from smoothing or buffering the input over multiple frames (causing extra input lag), to using acceleration by default in their game input logic.  I.e. your preferences get clobbered by the game and there’s nothing you can do about it.  Maybe there’s some obscure editable .ini files with esoteric options to fix it, but should you really have to resort to such meddling to make it feel ‘right’?

Sometimes you don’t even realise how bad it is until you re-acquaint yourself with a game that does it ‘right’.

The Wall of Shame

Games that offend the input gods (in no particular order):

Battlefield 2

I love BF2 and have 1300+ hours logged, but god damn, it has some weird-ass floaty mouse input and acceleration going on — I had a game recently and had forgotten how bad the input was for infantry combat.  I’m a pretty good infantry player in BF2, but compared to something like CS, it’s like being drunk.  Being drunk can be fun, but I’d like the choice all the same.

Mirror’s Edge

The input is generally fine for movement and fast paced bits, but when you have to aim a gun you realise how awful it is (I guess this was partly down to the game’s combat having a melee focus, but still).  I had to grip my mouse like I was squashing a potato or something.   My mouse is set up with low sensitivity, but it felt like there was no fine control due to the acceleration, plus they varied the horizontal sensitivity based on your view angle.

Left 4 Dead 2

L4D2 is basically the same as L4D1 which had perfect mouse input, but it has an option named “Enable Multicore Rendering”.  Enabling this option increases my framerate a little, but it also adds a strange, unwieldy “floaty” feeling to the mouse input.  I’m guessing it causes extra input lag because I cannot aim worth a toss with it enabled, but disabling it returns my input to L4D1 standards (i.e. good!)

Thief 3

I am not exaggerating in the slightest when I say that the mouse input in Thief 3 was so utterly horrendous that the game was rendered unplayable.  I went poking around in configs and changed various settings according to internet guides, but it was all to no avail.  It was so very very choppy, unresponsive and uncontrollable that I gave up after a few hours of play.  Horrible.

L4D – Pleasure and Pain

Left4Dead is ridiculously good.  I can’t quite get over how tremendously visceral, tense, hilarious and fun it is.  I’m one of those people who tries games, but only latches onto one in a big way every couple of years; I haven’t loved a game like this since TFC or BF2.  I’ve already played over 200 hours of it; I can’t stop playing it.  It’s multi-faceted; it has different ways of playing to suit my moods.

I love the camaraderie and the shared experience.  Many of my friends have bought it and can’t stop playing it. We jabber away about last night’s games like a bunch of dullards.  “Haha, that tank that smashed a car through the front door and incapped us all”.  “Oh, did you see that pounce I did off the crane that knocked the other two survivors off the edge?”.  “haha, when we were all waiting to go up the ladder and a boomer dropped down right in the middle, then we all played pass the boomer”.

It’s a riot.  There’s just one problem: we absolutely hate it.

So near and yet so, so far

The premise, art, mood, gameplay and everything about it smacks of quality.  However, there’s nothing quite so galling as a flawed genius, and L4D is utter genius and utterly flawed.  “What’s the problem?” you ask?  Well, the problem is in the multiplayer matchmaking, or the total lack of it. If you’re playing campaign mode (4 players versus the AI) it’s perfectly acceptable.  If you’re playing versus mode (the mainstay of the multiplayer), it is utterly inadequate.

The game operates using lobbies.  Someone starts a lobby and is designated the “lobby leader”, then other players join the lobby.  Once 8 players have been shepherded into the lobby, the game is started.

It all sounds grand so far.  Unfortunately, Valve’s lobby system basically pulls in a bunch of random players. Now I’m sure it’s more complicated than that (region, skill, ping and some other things possibly come into it), but for all intents and purposes, it might as well be random.  This is because if you have mates — and let’s face it, why would you play a multiplayer game without your mates? — you can join a common lobby and take on allcomers.

However, it still sounds reasonable though, right?

Wrong.  The problem is that teams of friends versus teams of randoms has one inevitable outcome.  One team is likely to rack up the points while the other team gets utterly ruined.  Due to the fact that it’s 4 v 4, if even one of the players on the other team is markedly inferior, a skilled group of players will always win.  There is no padding as there would be when playing in games with larger player numbers.  I’ve played games of BF2 in an unstoppable squad and still lost because there were too many passengers amonst our remaining 26 players (32 v 32!)  By consequence of design, this doesn’t happen in L4D.

This wouldn’t be such an issue, but there is seemingly no mechanism for skill matching, nor is there a mechanism for teams of friends to play other teams of friends.

L4D Versus Terminology

This has resulted in two terms entering the vernacular of any L4D player who has even had a cursory go at Versus mode:

Rage Quitter – Someone who leaves a game due to frustration and a build-up of hot salty tears.  A rage quit commonly occurs due to:

  1. Their team getting destroyed
  2. Someone else on their team leaving (see #1) resulting in a domino rage
  3. Incompetence on their team (see #1)
  4. Deciding that they don’t like French/Italian/English/Scottish/<insert nationality here> people all of a sudden (usually coincides with #1)
  5. Some kind of alleged cheating bulllshit that is going on with the other team (usually imagined; see #1)
  6. Other people on their team being dicks

I suppose calling all quitters “ragers” is harsh.  Let’s face it: Most of us play games to have fun.  If our team is riduclously bad or there is a huge skill chasm, it’s not fun to be dismantled for the best part of an hour.

Pub Stomper – One person who plays as part of a group of friends/acquaintances.

Again, pub stomper is an unfortunate tag because it doesn’t accurately describe why (most) people play in a group.  In my case, I don’t like playing online games alone.  I’ve got single player for lone gaming; humans are more challenging to play against and half of the fun in online games is the interactions and replayability that come out of it.

I’m not hugely interested in winning, so I don’t “stomp” pubs for that reason.  The stomping just tends to fall out of the fact that I play the game a lot.

I will happily play the game with any of my friends.  It doesn’t matter if they’re terrible or a 2 day newbie who thinks the Witch just needs a hug, it’s still fun.  However, most of the friends I play with (both real life friends and from the Internets)  are playing most nights.  If you play, say, 4 nights of the week and those same friends also play a lot, it is only natural that the heaviest gamers will stick together.

If I were to suddenly stop typing this blog post and fancy a game of L4D, it’s more than likely that 2 of my best L4D buddies would be available to play.  The fairweather L4D friends would not.  They’d be off doing something else, like running through a meadow, doing charity work or cooing at kittens.


I’m sure you can see the problem with the clash of the two groups.  The problem is exacerbated because it’s a form of mutally assured destruction.  Just as it’s no fun having your random team systematically decimated by a bunch of autonomous friend-bots who second guess your every move, neither is it fun to get 5 minutes into a game, only for the other team to all rage because it’s a total mismatch.

To give you an idea of just how bad it can be, in one campaign, my friends and I went through 50+ players on the opposite side.  The campaign lasts much less than an hour in a one sided game, and yet we still had 50+ folk who joined and left.  That’s the team filled and re-filled about 12 times over (look at the steam friends “recent games” player list if you want to see this).

I thought L4D had reached its nadir with the No Mercy 1 ragers (NM1 is like Counter-Strike’s “de_dust” in that it’s probably the only map a lot of people ever see…), but I was mistaken.  In the last week, my friends and I have started countless games on the new maps (mainly Dead Air).  We’ve completed about two of them.  In every single other instance, the whole team quits after maybe 2 rounds.  It usually goes like this:

Dead Air 1: They play infected; we make it as survivor.  They play survivor and die at the first plank.  One or two of them leave.  Maybe the spots are filled, maybe not.

Dead Air 2: They play infected; we make it as survivor.  They all leave.

This is not an exaggeration.  Sometimes they all leave after a single round. We then go back and start a new lobby and the process repeats itself.  We play the same maps time and time again, rarely even getting to play infected twice, let alone see the third map.

So, what can Valve do?

Firstly, and this should’ve been in from the start: introduce a better matchmaking system!  This should be cater to two main groups:

1. Randoms.  Some people have no L4D friends and no time to make ’em (or they have a few friends or acquaintances, but don’t spend a lot of time playing with them).  If 4 random players can be matched up against 4 other random players and the game isn’t a total mismatch, then that’s good enough.  Whether this is done by win/loss percentage, average score per round or some combination of multiple things, I don’t care.

2. Friends.  If you have two or three mates and want to have a fair / challenging game, then this would allow you to create a lobby with four people, then look for a matching group to play against.  This is a very simple idea, but it doesn’t yet exist.  Somebody made a good post about it on the Steam forums and it received widespread support, so let’s hope it happens.

Regardless of who is playing, Valve really needs to encourage people both to stay in games and to be nice to one another.  I don’t care how good someone is; if they are abusive then it is no fun playing with them.  Case in point: Last week, a random joined my friends and me for a game.  This guy was an OK player, but he spent a good 10 minutes berating a friend of mine.  Now, the person he was spouting abuse at doesn’t play too much, but at least he doesn’t act like a moron on the Internet.  We votekicked the abuser which was a decent fix, but some other unfortunate team were no doubt landed with him shortly thereafter.

If someone is repeatedly kicked from games or constantly leaves after a single map, it’s usually a sign that they’re not worth playing with.  I’ve been friends with a few people like this in the past and their outlook is that they’re right, everyone is against them and they must gob off at every opportunity.  Instead of speaking to people in a respectful manner, they just resort to abuse.  It has become their default setting.  A lucky shot or acquired skill becomes an instant cheat accusation.  Any kind of misunderstanding turns to flames.  It’s no fun to be around and, given a choice, nobody wants to play with these people.

Valve already delists servers that offer a bad player experience so I’d be very interested to see how they’re tackling the problem.  Could they apply many of the same principles to players?  Could they delist or at least categorise players that offer a bad player experience?  I think they could.

Valve can change your access levels to games when you cheat, but what about when you’re a twat?  Will they actually do it?  It’s debatable.  I’d love to see it happen, but the system would have to be robust, else folk would just game it.

The bottom line is that whatever happens, things have got to improve because it’s getting harder and harder to have fun.  It’s taking the shine off a remarkable game.