Recent blog entries for fzort

19 Jul 2008 (updated 21 Jul 2008 at 12:44 UTC) »

Work

PHP sucks.

The Game

Intel graphics hardware sucks.

Advogato

Certified by ncm and redi! Truly an honor (I mean it - no irony here).

30 Jun 2008 (updated 30 Jun 2008 at 12:41 UTC) »

We have pew-pew

New gameplay video, with audio this time.

Creating this one was a bit*h. Basically, I can capture whatever is going out the speakers with arecord (comes with Alsa). I also have a way to capture video (see my previous post). The problem is that capturing video the way I'm doing (dumping raw frames to the disk) is a CPU killer, so capturing audio while doing that is a no-no. What I ended up doing is adding an option to the code to dump the joypad state to standard output at every frame, and another option to play it back from standard input. So, after playing the game once while recording the joypad, I played it back while capturing the video, and played it back again while capturing the audio. I multiplexed both tracks with ffmpeg (I also changed the frame dumping code to dump frames as yuv420p instead of PPM, so I could encode the video with ffmpeg directly).

Sounds get a bit out of sync near the end but it's hard to notice.

Retro sound effects were generated with DrPetter's very nice sfxr and filtered in Audacity. Music by "Oz" (real identity as of yet unknown).

27 Jun 2008 (updated 27 Jun 2008 at 17:18 UTC) »

Mind is the fear killer

Uploaded a new gameplay video to YouTube. It looks kind of... boring (maybe needs more colors?), but with less than four days to the deadline I'd better work on the music and sound effects now.

I'm developing it on (GNU/)Linux, of course. To create that video, I made the game retrieve the contents of the framebuffer every other frame and (after averaging 2x2 pixel blocks to reduce the resolution) write it as a PPM to standard output. I can then encode the result to MPEG with some command-line tools in the mjpegtools package.

In fact, I can even encode it on-the-fly, with something like this:

game | ppmtoy4m | y4mscaler -O chromass=420mpeg2 | mpeg2enc
-F 5 -q 4 -V 230k -b 7500 -o capture.mpg

Unfortunately, it's a CPU killer. Nice pipeline though. Got to love *nix.

(thanks to "spectre" for this post's title)

26 Jun 2008 (updated 27 Jun 2008 at 13:04 UTC) »

ncm : I realize that my last post looks like flame bait. Sorry for that. I should have hastened to add that the problem is with me, not C++. Years of "design patterns" indoctrination while working as a Java code monkey in the "enterprise" have done that to me. I'm in dire need of detox.

I'm using a sort of "class hierarchy" in the game, though. For instance, different types of enemies behave and are drawn in different ways, but share common traits, so "virtual functions" become useful there. In those situations, I'm using run-of-the-mill "object-oriented C":

typedef union foe foe;
 
/* the "abstract superclass" */
struct foe_common {
    vector2 position;
    void (*update)(foe *);
    void (*draw)(const foe *);
    /* ... */
};
 
/* a "concrete subclass" */
struct foe_sitting_duck {
    struct foe_common common;
    vector2 direction;
    /* ... */
};
 
union foe {
    struct foe_common common;
    struct foe_sitting_duck sitting_duck;
    struct foe_ninja ninja;
    /* ... and so on */
};

23 Jun 2008 (updated 24 Jun 2008 at 00:30 UTC) »

Haven't been getting much sleep lately. I'm working on an entry for the Intel Game Demo Contest. Here's a link to a gameplay video at YouTube (YouTube really crapped out the quality). If you want, you can vote for the demo here (outdated screenshots over there!).

When I started the project, I decided to use C++, and wasted a lot of time with false starts and rewrites on the grounds of design considerations ("like, I'll have an AbstractFoeFactory class that inherits from class Singleton, and it will hand me concrete instances of AbstractFoe, the superclass representing foes in the game, with operators new and delete overloaded so that instances will actually come from an object pool, hmmmyeah"). Then I said "screw it", and decided to just get the damn thing done. I'm now happily and productively using plain C. If I want the benefits of virtual methods I just stick a function pointer in a struct.

2 May 2008 (updated 3 May 2008 at 01:43 UTC) »

Today is my last day here. Lured by the prospect of working without a tie, with Linux on my workstation, at an actual tech company, and arguably against common sense, I'm starting at Yahoo! next Monday.

I'm pretty excited. Needless to say, I've been following the tech news with utmost interest.

29 Apr 2008 »

shlomif: did you actually read the Nichomachean Ethics? The thing is repulsive. If it really is, as some say, one of the central works of western civilization, it's no wonder we're in such bad shape. Bertrand Russell said it better:

There is in Aristotle an almost complete absence of what may be called benevolence or philanthropy. The sufferings of mankind, in so far as he is aware of them, do not move him emotionally; he holds them intellectually to be an evil, but there is no evidence that they cause him unhappiness except when the sufferers happen to be his friends.

22 Apr 2008 (updated 22 Apr 2008 at 11:09 UTC) »

Implementation of logical operations on a domino substrate

Abstract. This paper presents some simple ideas about domino gates. Domino gates are implementations of logical operations using toppling dominos to represent the movement of information (bits). (...) The domino model can be used as a representation of single-shot wave gates in unconstrained media, such as sub-excitable Belousov-Zhabotinsky reactors. On a practical note, they are slightly easier to set up and use than collision models using 'billiard balls'.

More at the International Center of Unconventional Computing.

18 Apr 2008 (updated 18 Apr 2008 at 22:52 UTC) »

It's been a hectic day in production support land. My head hurts. And I still have stuff to do - will probably leave at around 21:30 PM, making this a 14 hours day.

Anyway, I skipped lunch and instead worked a bit on this problem. After much head scratching, came up with a O (N^2*M) dynamic programming solution (with N the length of the sequence and M the size of the alphabet). Was really proud of myself for about 3 minutes, until I noticed that N can be as large as 100000. Boom. Anyway, my worthless non- solution is here (sorry, in Java - as I said, I did it at work). Space can be reduced to just O(N*M), but that doesn't help with time.

laburu: I'll get around to answering your e-mail eventually, I swear.

17 Apr 2008 (updated 17 Apr 2008 at 16:31 UTC) »

Dang. I can't get any hacking time during the week.

Ah well. Lunch break, and I've just solved this problem. It requires more insight than code, so I could work on it for the past couple of days while in the train, in the bathroom, etc. The resulting program is small and simple, but I had to deploy some hardcore permutation group theory to arrive at the solution. I wonder if there's a simple "Aha!" insight that I'm missing. If you think there is, I'd really love to hear.

111 older entries...

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!