The idea behind the Global Game Jam is that people all around the world gather in small groups to create video games on a given theme over the course of 48 hours. Last year, 370 games were produced by 1600 participants in 37 countries.
Right now I am in Antwerpen, attending the only Belgium GGJ site. We still have a bit over 4 hours left to finish the game my small team is working on, but it’s coming along nicely and it’s mostly done. I will post more info about it when I am back home.
January 2010
15 posts
Counting elements in a static array with sizeof is convenient, but arrays are second class citizens in C/C++ and they silently decay to pointers at the first chance. So, code like this won’t work as intended:
#include <stdio.h>
void func(int * foo)
{
printf("func : %d\n", sizeof(foo));
}
int main()
{
int foo[20];
printf("main : %d\n", sizeof(foo));
func(foo);
}
Because inside the function we get the size of a pointer, not the size of the array it points to, the result will be:
main : 80 func : 4
Okay, but is there a way to go around this? Let’s try to change the function. Unfortunately, all of the following attempts are equivalent and will still display the size of a pointer.
void func(int * foo) void func(int foo[]) void func(int foo[20]) void func(int foo[40]))
Which is not only inconvenient but downright dangerous in the last case, because the compiler doesn’t care about the complete array definition and won’t issue a warning if you are calling the function with an array of the wrong size, and reading the code can be misleading.
So what? Here comes the trick…
void func(int (&foo)[20])
Meet the static array reference, this improbable syntax will carry the original array type around, and sizeof will return the desired value of 20 times the size of an integer. And it won’t compile if the array has the wrong size, sweet.
Sources:

Walt Disney Animations Studios has recently open-sourced their texture mapping system named Ptex. It basically allows artists to directly paint on 3D models with insanely detailed texture maps that require no explicit UV (no manual unwrap) by applying a separate texture to… each face. Ouch.
Ptex was used on virtually every surface in the feature film Bolt, and is now the primary texture mapping method for all productions at Walt Disney Animation Studios.
I got to watch that movie!
Source: Morgan McGuire via Twitter (link)
I am currently reading “The Race for a New Game Machine”, a book that tells the story of the Sony/Toshiba/IBM cooperation in creating a new processor to power the PlayStation 3. I already blogged about it here (link).
So far it’s an interesting read, but there are some weird omissions. In the fourth chapter of the book, the authors go though the history of home game consoles, starting with the Magnavox Odyssey (link), then the Fairchild Channel F (link) (kudos for mentioning it) and the Atari 2600 (link)… Then they basically say the rise of the PC caused disinterest in video game consoles, and they jump right to the Sony PlayStation (link), ten years later.
I was a bit surprised, to say the least, that he completely skips the rise of Nintendo and Sega. And I am not the only one, Mike Schiller from PopMatters apparently shares my opinion (link).
As far as he’s concerned, the ten years of the NES, the SNES, the Sega Genesis, the rise of portable gaming in the form of the Game Boy…they never happened. 1984-1994 was a black hole for the industry as far as he was concerned. While I don’t expect a full, detailed recount of every system that was ever released, the NES, at least, seems to be a bit of an omission, yes? Shippy actually seems to have a decided aversion to Nintendo in general—the only reference to Nintendo that I recall is a passing mention of the GameCube, and only because a colleague worked on its chip.
If you are looking for another good book to fill the game, you might want to have a look at “Game Over: How Nintendo Conquered The World” (link).
Dennis Hotson was very kind to link my post about the book “Coders at Work” and the interview with Jamie Zawinsky on Reddit, and some very interesting comments arose from the discussion. You can check those links for a bit of context:
First, the reason why smart people feel dumb while dumb people feel smart is indeed named the “Dunning–Kruger effect” (link). The basic reasoning is that the more you know about something, the better you understand the limits of your knowledge and that mastery is still a long path ahead.
Now, about the design patterns, let me quote some of the reddit comments.
I think the point behind the anti-patterns sentiment is that design patterns often form the basis of a type of cargo cult programming, where people reason about their problem in terms of which GoF patterns to use and end up writing code which fits the design patterns more than it fits the problem they begun with. (link)
The problem is that the language became more important than the ideas. There are way too many people out there who can name which design pattern they’re supposed to use in a given situation, but lack the understanding of why the underlying idea was important enough to deserve a name.
My problem with the design patterns community is that it seems to have decided that bad programmers can be led into writing good code by teaching them a pre-existing set of solutions that they can use. It doesn’t work that way. It’s not that the patterns are bad — on the contrary, most good developers would have come up with something like them in some form or another as needed. (link)
I strongly agree with the views expressed above, and I recommend you read the whole reddit thread, especially the part spawning from that last comment, that boils down to the notion of patterns as a descriptive vs prescriptive technique.
Thanks again for all the feedback!
Thanks to Dennis Hotson (link), I discovered the blog of Matt Swoboda (link). But who is Matt Swoboda? First, he is a coder on the demoscene (link), going by the nickname of smash (link) and part of the Fairlight group (link). He is accountable for the code behind some of the most impressive demos of the last few years. But he also works for SCEE R&D on the amazing PhyreEngine (link) since 2006. If these credentials are not enough to induce massive respect I don’t know what it takes.
He recently worked on a demo everybody should watch, “Frameranger”, his blog contains several articles going into great detail on the technologies involved.
source: dhotson
That stupid input form destroyed all the < and > from my previous post. As a result, the template example was totally wrong, now it’s fixed. Sorry about that.
Beware Microsoft extensions to C and C++! The following code will happily compile under Visual C++ but is not standard compliant, can you spot the error?
template<typename T> struct Foo {};
template<typename T> struct Bar : Foo<T>
{
Bar() : Foo() {}
};
Bar<int> b;
Ladies and gentlemen, the comments are at your disposal.
Switch the current view (content, title, details, icons): CTRL + mouse wheel.
An interesting presentation from Tim Sweeney, given at the Symposium on Principles of Programming Languages in 2006. He explains the shortcomings of current mainstream languages when it comes to large-scale video games development, and gives a lot of pointers to potential improvements.
The Next Mainstream Programming Language: (link)
I don’t think we will massively move away from C++ for core game development any time soon, but reasoned criticism is insightful, so go read it. Tim Sweeney also provides some interesting facts about Unreal and Gears of War, like this one:
90% of integer variables in Unreal exist to index into arrays
int main()
{
Foo f;
f.Bar();
}
And the MSVC2008 compiler throws this:
"warning C4101: 'f' : unreferenced local variable".
Now, try to explain why in the comments below.
Hint: this has a perfectly logical explanation.
My cool discovery of the day is an image produced by the first commercial fax system. How long ago do you think it was? Try to guess.

It was in 1865 (yep, 19th century), the service was first established between Paris and Lyon then extended to other cities and used a device known as a “pantelegraph”, created by the Italian physicist Giovanni Caselli.