Name: Mauro Persano
Member since: 2005-03-31 16:27:10
Last Login: 2008-07-06 21:41:22
Homepage: http://www.fzort.org/mpr/
Notes: Mostly self-taught programmer living in São Paulo, Brazil. Corporate code monkey by day, wannabe free software hacker by night. By the way, English is not my first language (such a convenient excuse). Contact: m (at) fzort (dot) org
30 Jun 2008 (updated 30 Jun 2008 at 12:41 UTC) »
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) »
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) »
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) »
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) »
I'm pretty excited. Needless to say, I've been following the tech news with utmost interest.
fzort certified others as follows:
Others have certified fzort as follows:
[ Certification disabled because you're not logged in. ]
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!