Something ends...

OK, it seems like the initial supply of GDC papers has dried out. I’ll keep updating the original post with new links and create “fake” entries about bigger updates to activate RSS readers. In the meantime – there are big changes ahead. Soon, I’ll be leaving CD Projekt Red. I’ve spent over 5 amazing years here, so it wasn’t an easy decision. I decided it’s high time to try something else, though.

GDC 2009 proceedings

Let’s start, shall we? I’ll update this post with publications, as they become available: Jeremy Shopf (ATI): “Mixed Resolution Rendering”, Nocturnal - GDC 09 Release (Insomniac), Intel’s GDC materials +Project Offset new videos, Glenn Fiedler (Sony Santa Monica) - Networking for Physics Programmers (slides… sadly, kinda hard to figure them out without audio), Summary of Jeff Kaplan’s (aka Tigole) WOW panel - not your typical GDC stuff, but pretty interesting nonetheless (especially for all of us, (ex)WOW addicts),

DocOrganizer

GDC2009 has started, first publications should be available soon. Preparing for them, I wanted to organize my documents collection. “Standard”, filesystem organization isn’t perfect here. I usually try to categorize papers by conference or author, but it quickly gets messy. Say, I’ve paper from Siggraph2k8 by Bungie programmer. Should it go to Siggraph or Bungie directory? End result is that it always takes me too much time to find the publication I need.

Breakpoints in system libraries

I’ll just put it here, because I’m fed up with forgetting it and experimenting with syntax every time I need it. There are times when you need to put breakpoint in system function, like malloc or OutputDebugString. For example, I use the latter one sometimes, in order to intercept DirectX warnings (couldn’t find a way to make it break on warning, not only on error). Syntax for breakpoint window is (function): {,,kernel32.

Go with the flow

If you’re interested in lock-free/multicore programming, make sure to visit Charles Bloom blog and read his Low Level Threading series. Table of contents is a good start. You’ll find plenty of valuable links there, always good to have them gathered in one place (if you’re not familiar with the topic, reserve two weeks, reading all this stuff may take some time). On top of that, some Relacy-tested code (I tend to agree that code that has not been extensively tested with some automatic suite, cannot be considered safe) and many good insights.

Aligning arrays

When developing stack-based containers for RDESTL I’ve encountered the following problem - how to get block of uninitialized memory that’s aligned properly for type T. Consider fixed_vector class: template class fixed_array { ... char m_data[N * sizeof(T)]; Size is OK (we need N elements of type T), sadly alignment is invalid here. It may not be a problem for majority of cases, but try storing _m128s… Even when using 32-bit variables, they should be aligned on natural boundary (4 bytess) in order to rely on writes/reads being atomic.

Random links, 19/02/09

Some interesting stuff I’ve found recently: Intelligent Brawling - I’ve read it some months ago in Game Developer and it finally is online. Very interesting article about combat in action games. Tom basically analyzes several games, researching enemy behaviors - attack timing, combos, AI, tells and so on. Must read for every gameplay coder/designer. Gustavo Duarte blog - system/hardware articles on this blog are pure gold.

The Law of Demeter

I’ve been refactoring big pieces of legacy code recently and my work would be much easier if authors would have followed the Law of Demeter. It’s not even LoD per-se, it’s mutated version, because I’m not talking about calling methods, rather accessing fields. The general guideline is – where possible, function should only operate on a minimal required subset of data. Consider the following code snippet: float GetDistanceFromCamera(const Object& obj, const Camera& camera) { return (obj.

Single producer/single consumer bounded queue

Another little snippet. I’m a big fan of bounded containers for multithreaded environment. Sure, they’re not as flexible, but at least you don’t have to worry so much about memory allocation. Most of unbounded containers rely on some kind of list, so nodes have to be managed separately, which complicates the code and actually introduces hidden locks (unless you use your own multithreaded allocator). For specific types of applications (like games) you usually know roughly what’s maximum capacity is needed, so why shouldn’t we take advantage of this knowledge.

Demoscene tribute: the discreet charm of oldschool

A little bit late to the party, but maybe someone haven’t seen it yet and it’s definitelly something worth witnessing. Folks creating demos on “smaller” platforms (mainly C64 & Atari) just seem to refuse to acknowledge that golden years are gone. What’s cool, in many cases they manage to “bend” the reality and create stuff that simply shouldn’t be possible. Poster example is relatively fresh demo - Edge of Disgrace by Booze Design (winner of X 2008).

Rise and fall of software company

If you’re following news from gamedev/IT portals, you know that 2008 has been one tough year for the industry. Many good companies have been forced to either fire big part of their staff or even shut down completely. Reasons were probably different in every case. Sometimes it was recession, sometimes, recession could be used as an excuse to get rid of dead wood, in many situations hard times simply made internal problems more visible.

Crash handler/reporter (Win32)

Usually, I try to write about less common programming issues here, this time it may be something less “flashy”, but very useful nonetheless. To be honest, if I had to choose single most crucial feature I coded for The Witcher it would be this crash reporter/handler. It took me few hours of home-coding, but has proven invaluable in later years of development process. If you don’t have similar system in place yet and you develop for Win32 – just stop doing whatever you’re doing and implement it now, you’ll thank me later.

Launchy

Just a quick note – recently I’ve finally completed my quest for perfect desktop. I’ve found small launcher utility that lets me to execute applications that are not on my quickbar, so I don’t have to use desktop icons or “Start” menu. Instead, I just tap Alt+Space and have all my programs just few keystrokes away. Meet Launchy. It let me to remove all icons and hide taskbar, leaving my desktop totally clean.

Lock-free double ended queue (bounded)

Just a small snippet – as a title says - lock-free double ended, bounded queue in C++. Original version can be be found in Herlihy’s book, but it’s in Java. It’s not very general, it has been created specifically to be used in my work-stealing thread pool. Basically, each thread adds tasks to the bottom of it’s own pool and tries to steal from top of other threads’ pools when low on tasks.

Catching up

Few words about what I’ve been up to profesionally for past months. As you may have heard - Geralt is coming to the consoles. There’s PS3/X360 adaptation of ‘The Witcher’ in the works. It’s being developed in close cooperation with French company - Widescreen Games. They’re cool guys, basically mix of best oldschool French sceners (like Patapom/Bomb) and game developers (including Outkast programmers). Before diving head first we had to deal with re-designing many elements of the game like combat and UI.

Know your assembly, part 3

I’ve been playing with radix sort for RDESTL recently and MSVC optimizer surprised me one more time. First of all, it seems to generate much better code if my histogram array is local to function and not member (in the first case it makes better use of registers and keep less stuff in temporary variables). It costs us 4k of stack, but I can live with that. Other than that, generated code is pretty smart, sometimes almost too smart.

Shameless plug

I normally try to put here stuff that’s interesting to all kinds of readers (for carefully chosen definition of reader…) but today I’ll make an exception and post a link to Polish article. To add insult to injury, it’s an interview with myself. It has been conducted by an old demoscene mate of mine - Hollowone, known as Daniel Biesiada IRL, who runs a fairly popular IT/programming/.NET/game blog. Appearently, some of the readers of his site have been interested in finding out more about gamedev, some tales from the trenches and such.

Google interview process

What’s the best way to drive traffic to your blog these days? … Write an entry about your Google job interview. Recently I’ve found yet another one of those. This one is actually well written and quite interesting, so go read it first. Today, I wanted to focus on another issue, though – if you read comments for this article on Reddit, 90% of them seem to be from people complaining about the number of interviews he had to take.

Chromed editor

As you probably have heard - some months ago Google released its own browser - Chrome. One of it’s distinguishing features is that every tab is a separate process, so if one tab crashes, it won’t bring whole application down. I’ve read in different places about tries of applying this scheme for game editors. Imagine game (renderer) and editor being two separate processes. Should one of them crash, the other is still running, so that we can at least save our work.

Poor man’s Thread Profiler

There’s an interesting observation in Eric Steven Raymond’s essay - ‘The Cathedral and the Bazaar’ (I’ve heard about it thanks to the reference in ‘Dreaming in Code’). Eric notices: “Every good work of software starts by scratching a developer’s personal itch’. It seems to me like my problem is I’ve too many itches. When I was a young bedroom coder I’ve been basically scratching constantly. Every time I’ve learned about some new technique, I couldn’t resist and just had to try it in my code.