Latest Posts

Hardware, again

After years on a 60Hz CRT at 1600×1200, I decided to get a 20″ TFT. It’s a Samsung SyncMaster 204B which is one of the cheaper models on the market, but it turned out to be a real bargain and I am really satisfied with it.
Samsung SyncMaster 204B #1
I like the pivot function. Although it is unfamiliar for me, I always wanted to have a better overview over the code above and below the cursor, and I know that this is the only solution left if you use a relatively high resolution and relatively small fonts. So I’ll try to get used to that. When I tried out the pivot function, I recognized the only drawback of the hardware so far: I found it quite hard to rotate it 90 degrees, and I missed snap points.
Samsung SyncMaster 204B #2
This is our game, DVW, at 800×600.
Samsung SyncMaster 204B #3
Another view of my hacker cabinett with flash. To the left you can see my old tube which I now use for chat and debug windows. Although the CRT takes a lot of room on the table, I will keep it as a desktop extension for my debug and chat windows, or to watch a movie while coding or so.

All Good Things Must Come To An End

Today, I brought myself to a decision which was overdue.
I spent the last five years or so hanging around in a neat gamedev IRC channel, and the last four or so with founder access level (which is the highest privilege one can have in such a chatroom). The channel was a place of relaxation, chitchat, and sometimes even interesting ontopic gamedev discussion, and these guys really meant alot to me – all of them. I liked even those ones who sometimes were a real pain in the neck, and sometimes I really had to laugh in front of my tube when I had to admonish them at the same time.
I always joined this chat if my PC was running, regardless whether I was coding, playing, writing, learning, or, of course, chatting. I spent some 10000 hours online with my latest mIRC installation, always with these guys, in this one chatroom. Actually, these guys even “survived” several ex-girlfriends! Although there were some differences from time to time, all the 40 or so regulars stayed, all the years. We met several times in real life, had great fun together, and I considered many of them friends.
But, well, people change. Either in a positive, or in a negative manner, or simply just in a way they can’t deal with each other anymore. Interests change, too. And, unfortunately, spare time changes. It literally shrinks the older one gets. Since I started my professional work in 2003, I joined the chat less frequently, and I recognized that I lost participation and sympathy more and more. I suddenly saw people fight I had never expected to, in a way that I had never expected, and I watched peoples personalities change – from the distance that raised, these changes were more obvious and hence even more frightening.
Today, it finally became clear to me that I was no longer part of that process, but just a frequent visitor, a distant observer.
Thus I asked to vote for a new channel founder today. I will drop my founder status and watch the distance grow. I can’t do anything about it anyway – it’s just the way the things go.

Windows Genuine Advantage

Microsoft now requires its Windows users to prove their right to download updates by verifying the serial number and the activation status. Within 24 hours, this check was passed over, as BoingBoing reports. But it looks to me like this one is very easy to fix for MS, maybe it’s even a debug flag which was forgotten.

Friday the 13th

One might think this must be a unlucky day. It wasn’t for me, at least until I came home today 😉
Work is very satisfying right now. I have to dig into several technologies that were new to me, because I’m going to impose JMX on our application. This is a rather challenging task, because the application consists of several distributed components, and unfortunately it’s an “identity management and security administration” application, so I have to be really careful not to break our own security. So, although I knew some of the technologies/APIs already, I learned a lot of new things about PKI, SSL, JAAS, JNDI, JINI, RMI, J2EE, SOAP, JPSs, Struts, Servlets, Application Servers like JBoss or Websphere, and finally JMX itself. After about two weeks of reading, playing around, testing, and comparing JMX implementations, a somewhat concrete picture of the implementation evolved, and I’m quite happy with it so far. I don’t have a 100 percent clear picture yet, but the most issues that troubled me are solved. One thing I’m still thinking about is how I’m going to manage the lifetime of an MBean, because most parts of our software simply rely on garbage collection and don’t have clear, designated “cleanUp” methods where I would unregister the bean. Another thing is the naming scheme of the MBeans, because I plan to implement a client which displays them in their natural hierarchy, and not just as a flat list. But I heard that JSR-77 proposes a nice naming scheme, I will read through these 190 pages on Tuesday. For now, I’m looking forward to enjoying this long weekend.
The unlucky part of this Friday 13th was the electricity bill I received today. I really need to get my salary raised.

sechsta sinn weekend

Tomorrow another sechsta sinn weekend is going to start, and right now I feel sick. This sucks. But not just physically, but mentally as well … mattin told me that he has to leave early on Sunday noon, Julius is thinking about attending a birthday party on Saturday, I have to work tomorrow before I can take off, and Christopher, Jochen, Jan and Sebastian won’t join us at all due to several reasons. Melancholic I remember the days when we managed to get the whole team AND visitors into our little cellar for the whole weekend. Anyway, I’m looking forward to being as productive as possible this weekend. I’ll take my webcam with me again, so don’t forget to catch a glimpse.

Privacy and Copyright on ICQ/AIM

I’m sure it’s an old hat for the most of you, but I read about this for the first time and found it unacceptable (and I can’t believe I really overlooked this when I agreed to the terms of service).

From the ICQ Terms Of Service:
You agree that by posting any material or information anywhere on the ICQ Services and Information you surrender your copyright and any other proprietary right in the posted material or information. You further agree that ICQ Inc. is entitled to use at its own discretion any of the posted material or information in any manner it deems fit, including, but not limited to, publishing the material or distributing it.

From the AIM Terms Of Service:
You or the owner of the Content retain ownership of all right, title and interest in Content that you post to public areas of any AIM Product. However, by submitting or posting Content to public areas of AIM Products (for example, posting a message on a message board or submitting your picture for the “Rate-A-Buddy” feature), you grant AOL, its parent, affiliates, subsidiaries, assigns, agents and licensees the irrevocable, perpetual, worldwide right to reproduce, display, perform, distribute, adapt and promote this Content in any medium. Once you submit or post Content to any public area on an AIM Product, AOL does not need to give you any further right to inspect or approve uses of such Content or to compensate you for any such uses. AOL owns all right, title and interest in any compilation, collective work or other derivative work created by AOL using or incorporating Content posted to public areas of AIM Products.

I heard that Jabber is an interesting alternative, and it also supports PGP. You don’t need to search for their terms of service; it’s completely free, open, public.

Weekend Gamedev

I’ve done a huge refactoring of our game project, DVW, over the weekend. One reason was that I could not see the GUI code anymore. It was a mess! Most of the stuff was about four years old, and it looked like 40 years old or so. So I was spending the whole Friday night to rearrange things, move attributes and methods up to the parent class, remove some redundant stuff, and I even killed about 1000 lines of code by simply removing some GUI controls which were not used any longer and which were buggy as hell.
The main reason was that I am currently writing the main menu code which is completely controlled from a Lua script. I didn’t want it to be hardcoded, because I don’t want to be the one who needs to do all the fine tuning with all the visual effects we’re going to have. We have people who are much more talented with this detail work.
I wrote a state machine which supports multiple states at once, so that a single effect in the menu is represented by a state. For example, we have very short background videos playing between every menu dialog (a quick camera move which shows the Earth from different points in space, really cool), so this transistion is a state which shows the video, waits until it’s finished, and terminates, or triggers other states to start. In the meantime, another state is responsible to clean up the old GUI controls (i.e., they’re flying out of the screen, fading out, or whatever), while a third one moves the new controls in. And a fourth “randomizer” is responsible to create some effects from time to time (which are states, as well), e.g. some explosions on the Earth in the background, or some static (read: noise) in the background image, or a little falling star, and so on and so on. I’m sure it will become pretty cool if my poor programmers art is replaced with real artwork from our fantastic artists.
All this is done with our Lua API, a set of 100+ commands which interfere with the C++ part of the game logic. It isn’t just about GUI stuff; you can control roughly everything one could control with the mouse, and even more. You can move units, assign groups, move groups, evaluate influence maps, make factories produce a unit, search resources, play sound effects, crossfade music, select the next map to play, move the camera over the map, and so on and so on. Although the way I wrote the API isn’t the best one, I’m quite happy with the result.
Our lead tester is using it to tweak DVW to the maximum – he does things that I had never dreamed about! He has become our lead scripter in the meantime, and I am doing my best to support his efforts, as the outcome in turn is well worth my effort. So well, that’s it about my satisfying weekend.

Why patents suck

I found a great example why (software) patents suck on the IGDA homepage, and an oppressive feeling arises when I imagine what lawsuits like this mean for game developers and software engineers in general if the claim is admitted. A short excerpt:

There is an ongoing patent litigation case in the Eastern District of Texas of interest to all developers because of how broadly the Plaintiff appears to want to apply the claims of the patent. In this case, American Video Graphics, L.P. (“Plaintiff”) has sued sixteen game publishers, alleging that these defendants infringe AVG’s [patent], “Method and Apparatus for Spherical Panning.” […] Plaintiff has identified over 1000 accused games, which Plaintiff alleges infringe their [patent].

IGDA is now desperately searching for prior art to invalidate the patent. Read the full story here.

Exceptions and Stacktrace in C++

Today I was discussing about how one could implement a stacktrace in C++, where one has not the luxury of Thread.dumpStack() or Throwable.printStackTrace(...) of Java.
The general C++ approach one finds often is to create a dummy object on the stack at the beginning of each method which receives the current file and function as constructor parameters (using the __FILE__, __FUNCTION__ and __LINE__ macros) and stores them, i.e. increases a list pointer and saves the const char* at the resulting position. As soon as the object gets destructed at the end of the function, the list header pointer is decreased again.
So, my first implementation looked like this:

#ifndef FINAL
#define CALLSTACK CallStack dummy(__FILE__, __FUNCTION__)
#else
#define CALLSTACK
#endif
class CallStack
{
public:
    CallStack( const char* _file, const char* _function )
    {
        file[ current ] = _file;
        function[ current ] = _function;
        current++;
    }
    ~CallStack()
    {
        current--;
    }
    static void dump()
    {
        for( int i = current - 1; i >= 0; --i )
        {
            std::cout < < file[ i ] << ": " << function[ i ] << std::endl;
        }
    }
private:
    static int current;
    static const int MAX_STACK_DEPTH = 1024;
    static const char* file[ MAX_STACK_DEPTH ];
    static const char* function[ MAX_STACK_DEPTH ];
};
int CallStack::current = 0;

The first test with an exception I threw somewhere deep in the call hierarchy of my program revealed what one has to remember about exceptions: objects that exist on the stack at the time the exception is thrown are ordinary destructed. So, the d’tor of my CallStack object was called, too, and current was not pointing to where I had expected. So I had to mark the last element of my list in order to recognize it as the tail.
I decided to set the following element after current to 0 so that I would iterate through the elements until I reached 0 in order to dump the stack trace:

CallStack( const char* _file, const char* _function )
{
    file[ current ] = _file;
    function[ current ] = _function;
    current++;
    file[ current ] = 0;
    function[ current ] = 0;
}

I thought this would work fine, but a friend of mine pointed out this case:

void someMethod()
{
    CALLSTACK;
    foo(); // foo was called, end of list is still behind foo
    throw; // exception is thrown and the resulting stacktrace is misleading
}

So, it turned out that I had to move the tail-pointer back, too, but only in case no exception was thrown. Someone on flipcode had a solution which required all exceptions to descend from one base class which handled this situation, but I wanted to be able to throw anything. bool std::uncaught_exception() satisfied my needs. So, if we’re in the CallStack d’tor, and std::uncaught_exception() returns true, we know that the current method just caused an exception, so we don’t need to move the tail marker anymore. It’s just that simple. I used a static bool flag bool CallStack::exc = false; to remember this situation for the following d’tors. Of course, after one handled an exception one should reset the flag so that the following d’tors set the tail marker correctly again. One should also check whether MAX_STACK_DEPTH is reached (or use std::vector), but you’ll figure this out yourself.
Well, it’s late. If someone is interested, I can provide a full example, just let me know. I also appreciate c&c, indeed. I’m sorry if the source code is messed up, WordPress seems to do this. Night.

GTK Font Size

Although I’m not a Linux geek, I play around with it from time to time. I have a Gentoo installation on my notebook. One might argue about the different distributions, but I found this one to be the most intuitive among the ones I tried.
Today, I updated to the current Eclipse 3.1 M5a milestone, which I use at work, too. I had no trouble with this version yet, and if it’s good enough for work, it’s fine for using it at home, isn’t it? I did not use portage, but downloaded the GTK 2 binary instead.
One thing I disliked was the huge font size. I was able to customize most font sizes in the Eclipse options, but the main menu remained in its original way-too-large size. I found out that this was some kind of GTK default font, so I searched for a way to change it, and found a little handy tool called gtk-chtheme. I downloaded it using emerge gtk-chtheme and was then able to change this main font easily. Now everything suits my needs, and I surely will use Linux for development more often.
Short rant: for a long time, Visual Studio was my favourite IDE; then, I got to know Visual Assist and thought that VS alone was quite limited; then, I started to write Java code for a living and thought that Eclipse was an even more powerful IDE (a big plus are the great refactoring possibilities of Java, so this is not a real IDE argument); now, I got to know IntellJ IDEA and I’m looking forward to having the $499 bucks to spare. But I guess until then Eclipse ripped off all the great features 😉