About

About

This is the website for my Allefant project which for many years was hosted on SourceForge. It is a collection of various games I wrote over the years for short game programming competitions, such competitions usually taking about 2 days to create the complete game (code as well as art). The first such game I made was Allefant back in the year 2000. Some of the games also were worked on afterwards and polished a bit, so they are actually playable. Most are little more than a tech demo though. They are all open source.

My SantaHack entry

My SantaHack entry

Just made a playthrough video of my SantaHack 2012 entry called Sleigh Race.

Posted in News | Leave a comment
my ABC of compo entries

my ABC of compo entries

Hm, it’s my birthday today and I got the day off work. So looking at my website. According to the sidebar to the left it looks like during my lifetime I wrote over 50 compo entries. And also, there’s at least one for each letter of the alphabet. Just for fun, picking 26 entries, one for each letter and reminiscing about it…

A Allefant. My first ever compo entry (Sizehack 2000) and the one which made me love coding game compo entries. Also my favorite of all of my own games. There’s also 6 sequels (well, random other compo entries I simply gave the same name because I couldn’t think of anything).

B Battery. Ludumdare #9. Back when LD48 still was really small. Also one of the games with a surprising amount of gameplay, compared to my typical entries.

C Command Code. TINS 2010. Surprisingly complete game. Also the one with the most positive feedback I ever got.

D Doomed. Teamhack 2001. Now, over 10 years later, I still notice how in the back of my head I plan to finish it some day. Oh well.

E Evil. Speedhack 2007. A 3D FPS. And a somewhat weird game.

F Fruitworm. Pixelate contest 2001. Nice little Digger clone. And I think the only game where I had an actual musician making music for me.

G Gnome Guard. One of the real early LD48s, in 2002.

H Hare. Made this for some weekend compo in 2005. I forgot the name, but both X-Out and MarkR also were in it.

I Insanity. LD#4 in 2004. As so often, it wasn’t really finished.

J Jetfighters. Made this together with IronBob from #allegro in 2004.

K Kaos. Well, K turned out to be the very last letter I ended up making a game with. I named my Pyweek 2012 game Kaos and was actually naming it with something K on purpose to complete my 26 letter games.

L Lawn. Pyweek 2010. I like the art I made.

M MarsFight. TINS 2003.

N Nefertem. Done for Prettyhack 2006. Hm, completely unfinished.

O Owl. LD48 #12. I quite like the round level idea I came up with.

P Photon. LD #6. I learned a lot about spending too much time on math algorithms when there’s a tight time constraints.

Q Quest of the Prime Dragons. TINS 2012. Q was the second to last letter before K. I’m quite proud of this game. Wrote a raytracer from scratch again (I did that several times).

R Red, White & You. Speedhack 2011.

S Swarm. LD48 #8 in 2006. Probably my biggest achievement – I wrote a full 3D engine, with octree and collision and all, completely from scratch, on a single weekend.

T Tom. Back2Hack 2002. A complete platformer, with 12 levels.

U Ultimatum. TINS 2008. Sort of a The Settlers clone. Also tried myself at low-res pixel art.

V Velocity the Bee. SHMUP 2006. My most polished entry for sure.

W Wave Rider. Ludumdare 2009. My most innovative game I think. Also has a quite unique gameplay principle.

X X-Mas. Santahack 2011. A platformer with massive parallax scrolling. I’m somewhat disappointed that despite managing to finally do another platformer – it feels like a lot is missing.

Y Yellow and Dangerous. Pyweek #14. I really like this one, a complete puzzle game with 10 levels.

Z Zombie Master. LD#18, 2010. Quite interesting gameplay idea I think and well balanced. I played through it several times and always found it fun – maybe I should try and finish it.

 

Posted in News | 6 Comments
Kaos

Kaos

Just submitted my pyweek game called Kaos. I also made a game for Ludumdare two weeks or so ago but instead of finishing that decided to do the pyweek first. I really wanted to try my hands at HTML5 – but I refuse to use Javascript. So I took this pyweek as a chance to play with pyjs.

The game’s page on the pyweek site is here: pyweek.org

The game can be played here (only in Firefox/Chrome and only with a fast CPU):

kaos.allefant.com

While it is really slow and quite restricted for now, I like what I’m seeing from pyjs regardless. A 100% Python3 game, running in my web browser.

A screenshot:

Posted in News | 2 Comments
TINS 2012

TINS 2012

I took part in TINS 2012 over the weekend. There was five different rules to implement (genre requirement anachronism, artistic requirement dragons, and technical requirements saving, parallax scrolling, prime numbers). All while using the Allegro library. My interpretation of it is here:

 

Posted in News | Leave a comment
Pyweek #14

Pyweek #14

Yay, finally finished a compo entry again! I made a little puzzle game called Yellow and Dangerous for PyWeek 14.

This one was a lot of fun. I used Python 3, which just is so nice to use. Very high level, very clean syntax and my code just works as intended :) Which allowed me to do quite a lot in the limited time. Basically a complete isometric engine which uses masking to solve the old (impossible) 3d sorting problem.

(Here’s a picture demonstrating the problem, no matter in which order you draw the blocks x, y and z it always will be wrong:
)

It probably would have been easier to do full 3d and use a regular z buffer. But I’ve basically been waiting for 20 years or so to do a 2d isometric engine like this – ever since I played Cadaver on the Amiga. And now I finally managed to do a 100% clone of the engine they used back then. My life is complete now. And I managed to do it in (the free time of) a week no less (well, the implementation, there’s years of research in it…) :)

The game itself is rather simple. During the competition someone made a mockup of a Portal like game (he never actually made the game though, unfortunately). But it prompted me to create a Companion Cube like cube as placeholder for my initial testing. And I liked it so much I kept it as the main game mechanic. The goal in each level is to place cubes on pressure plates to unlock the exit. However to do so, you need to push, pull and stack other objects. Either to move them, or to create structures which help you move. For example to create a bridge over a gap or to create some kind of stairway to climb up to a high place. I also tried using the 3D aspect in some of the levels, for example one level has a block hidden behind a bush. And another arranges platforms in a way so the isometric view makes it hard to see where they actually are. Similar to those M. C. Escher drawings.

Posted in News | 2 Comments

FOSDEM 2012 in Brussels

Really need to add a blog entry about this – I was there a few weeks ago. Was coding some Wesnoth related stuff: units.wesnoth.org Also not directly related, I made a Pacman clone while bored:

It uses no external datafiles, just plain Allegro 5 primitives:

#include <allegro5/allegro.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_color.h>
#include <math.h>
 
ALLEGRO_DISPLAY *d;
ALLEGRO_EVENT_QUEUE *q;
ALLEGRO_EVENT e;
ALLEGRO_TIMER *t;
ALLEGRO_COLOR c;
bool k[ALLEGRO_KEY_MAX];
int w = 30;
int h = 38;
int s = 16;
int a, b, g;
double p = ALLEGRO_PI, f;
bool r;
int x, y, px, py, kx, ky, sx, sy;
int gx[4], gy[4], dx[4], dy[4];
char n[] =
"                              "
"                              "
"                              "
"                              "
" ############################ "
" #............##............# "
" #.####.#####.##.#####.####.# "
" #.#  #.#   #.##.#   #.#  #.# "
" #.####.#####.##.#####.####.# "
" #..........................# "
" #.####.##.########.##.####.# "
" #.####.##.########.##.####.# "
" #......##....##....##......# "
" ######.##### ## #####.###### "
"      #.##### ## #####.#      "
"      #.##    []    ##.#      "
"      #.## ###  ### ##.#      "
" ######.## #~~~~~~# ##.###### "
"       .   #[][][]#   .       "
" ######.## #~~~~~~# ##.###### "
"      #.## ######## ##.#      "
"      #.##          ##.#      "
"      #.## ######## ##.#      "
" ######.## ######## ##.###### "
" #............##............# "
" #.####.#####.##.#####.####.# "
" #.####.#####.##.#####.####.# "
" #...##.......().......##...# "
" ###.##.##.########.##.##.### "
" ###.##.##.########.##.##.### "
" #......##....##....##......# "
" #.##########.##.##########.# "
" #.##########.##.##########.# "
" #..........................# "
" ############################ "
"                              "
"                              "
"                              ";
char *m;
#define P(x) (((x) - 1) * s)
#define Q(x) (1 + (x) / s)
#define M(x, y) m[(y) * w + (x)]
 
int main() {
    srand(time(NULL));
    al_init();
    al_install_keyboard();
    al_init_primitives_addon();
    al_set_new_display_option(ALLEGRO_SAMPLE_BUFFERS, 1, ALLEGRO_SUGGEST);
    al_set_new_display_option(ALLEGRO_SAMPLES, 8, ALLEGRO_SUGGEST);
    d = al_create_display((w - 2) * s, (h - 2) * s);
    al_set_window_title(d, "Bambam and the Globals");
    q = al_create_event_queue();
    t = al_create_timer(1.0 / 60);
    al_register_event_source(q, al_get_keyboard_event_source());
    al_register_event_source(q, al_get_timer_event_source(t));
    al_register_event_source(q, al_get_display_event_source(d));
    al_start_timer(t);
    m = malloc(strlen(n) + 1);
    restart:
    strcpy(m, n);
    b = 0;
    y = 1;
    starty:
    x = 1;
    startx:
    if (M(x, y) != '(') goto noparenthesis;
    px = P(x) + s;
    py = P(y) + s / 2;
    noparenthesis:
    if (M(x, y) != '[') goto nobracket;
    gx[b] = P(x) + s;
    gy[b] = P(y) + s / 2;
    if (b == 0) goto notfirst;
    sx = gx[0];
    sy = gy[0];
    notfirst:
    b++;
    nobracket:
    x++;
    if (x < w - 1) goto startx;
    y++;
    if (y < h - 1) goto starty;
    mainloop:
    if (!r || !al_is_event_queue_empty(q)) goto dontdraw;
    al_clear_to_color(al_color_name("black"));
    b = 7;
    loopdrawhighlight:
    c = al_color_name("blue");
    if (b == 1) c = al_color_name("wheat");
    y = 1;
    loopdrawy:
    x = 1;
    loopdrawx:
    if (M(x, y) != '.') goto nodot;
    al_draw_filled_rectangle(
        P(x) + s * 0.4,
        P(y) + s * 0.4,
        P(x) + s * 0.6,
        P(y) + s * 0.6,
        al_color_name("peachpuff"));
    nodot:
    if (M(x, y) != '#') goto nohash;
    a =   1 * (M(x + 0, y - 1) == '#') +
          2 * (M(x + 1, y - 1) == '#') +
          4 * (M(x + 1, y + 0) == '#') +
          8 * (M(x + 1, y + 1) == '#') +
         16 * (M(x + 0, y + 1) == '#') +
         32 * (M(x - 1, y + 1) == '#') +
         64 * (M(x - 1, y + 0) == '#') +
        128 * (M(x - 1, y - 1) == '#');
 
    if (a == 64)
        al_draw_line(P(x), P(y) + s / 2, P(x) + s,
            P(y) + s / 2, c, b);
    else if (a == 4)
        al_draw_line(P(x), P(y) + s / 2, P(x) + s,
            P(y) + s / 2, c, b);    
 
    else if ((a & 85) == 5)
        al_draw_arc(P(x) + s, P(y),
            s / 2, p / 2, p / 2, c, b);
    else if ((a & 85) == 20)
        al_draw_arc(P(x) + s, P(y) + s,
            s / 2, p, p / 2, c, b);
    else if ((a & 85) == 65)
        al_draw_arc(P(x), P(y),
            s / 2, 0, p / 2, c, b);
    else if ((a & 85) == 80)
        al_draw_arc(P(x), P(y) + s,
            s / 2, p * 1.5, p / 2, c, b);
 
    else if ((a & 7) == 5)
        al_draw_arc(P(x) + s, P(y),
            s / 2, p / 2, p / 2, c, b);
    else if ((a & 28) == 20)
        al_draw_arc(P(x) + s, P(y) + s,
            s / 2, p, p / 2, c, b);
    else if ((a & 193) == 65)
        al_draw_arc(P(x), P(y),
            s / 2, 0, p / 2, c, b);
    else if ((a & 112) == 80)
        al_draw_arc(P(x), P(y) + s,
            s / 2, p * 1.5, p / 2, c, b);
 
    else if ((a & 17) == 17)
        al_draw_line(P(x) + s / 2, P(y), P(x) + s / 2,
            P(y) + s, c, b);
 
    else if ((a & 68) == 68)
        al_draw_line(P(x), P(y) + s / 2, P(x) + s,
            P(y) + s / 2, c, b);
    nohash:
    x++;
    if (x < w - 1) goto loopdrawx;
    y++;
    if (y < h - 1) goto loopdrawy;
    b -= 6;
    if (b > 0) goto loopdrawhighlight;
 
    b = 0;
    looptwice:
    al_draw_filled_pieslice(px + b * (w - 2) * s, py, s,
        f + p * 0.25 * fabs(sin(2 * p * (g % 60) / 60.0)),
        p * 2 - p * 0.5 * fabs(sin(2 * p * (g % 60) / 60.0)),
        al_color_name("yellow"));
    b++;
    if (b < 2) goto looptwice;
    b = 0;
    loopdrawghosts:
 
    if (b == 0) c = al_color_name("red");
    if (b == 1) c = al_color_name("cyan");
    if (b == 2) c = al_color_name("pink");
    if (b == 3) c = al_color_name("orange");
    x = gx[b];
    y = gy[b];
    al_draw_filled_pieslice(x, y, s, p * 0.6, p * 1.8, c);
    al_draw_filled_triangle(x, y, x - s, y, x - s, y + s, c);
    al_draw_filled_triangle(x, y, x + s, y, x + s, y + s, c);
    al_draw_filled_rectangle(x - s * 0.5, y,
        x + s * 0.5, y + s * 0.5, c);
    al_draw_filled_circle(x - s * 0.5, y, s * 0.25,
        al_color_name("white"));
    al_draw_filled_circle(x + s * 0.5, y, s * 0.25,
        al_color_name("white"));
 
    b++;
    if (b < 4) goto loopdrawghosts;
 
    al_flip_display();
    g++;
    r = false;
 
    dontdraw:
    al_wait_for_event(q, &e);
    if (e.type == ALLEGRO_EVENT_DISPLAY_CLOSE) goto done;
    if (e.type != ALLEGRO_EVENT_TIMER) goto nottimer;
    if (k[ALLEGRO_KEY_ESCAPE]) goto done;
    if (k[ALLEGRO_KEY_LEFT]) {kx = -1; ky = 0; f = p;}
    if (k[ALLEGRO_KEY_RIGHT]) {kx = 1; ky = 0; f = 0;}
    if (k[ALLEGRO_KEY_UP]) {kx = 0; ky = -1; f = p * 1.5;}
    if (k[ALLEGRO_KEY_DOWN]) {kx = 0; ky = 1; f = p * 0.5;}
 
    if (M(Q(px + kx * s / 2), Q(py + ky * s / 2)) == '#') goto cango;
    px += kx;
    py += ky;
    if (px < -s) px += (w - 2) * s;
    if (px > (w - 3) * s) px -= (w - 2) * s;
    if (M(Q(px + kx * s), Q(py + ky * s)) == '.')
        M(Q(px + kx * s), Q(py + ky * s)) = ' ';
    cango:
 
    b = 0;
    loopghosts:
    x = gx[b] - px;
    y = gy[b] - py;
    if (x * x + y * y < s * s * 2 * 2) goto restart;
    if (dx[b] == 0 && dy[b] == 0) dx[b] = (rand() % 2) * 2 - 1;
 
    if (M(Q(gx[b]), Q(gy[b])) != '~') goto noteleport;
    gx[b] = sx;
    gy[b] = sy;
    dy[b] = 0;
    noteleport:
 
    if (M(Q(gx[b] + dx[b] * s / 2), Q(gy[b] + dy[b] * s / 2)) == '#')
        goto ghostwall;
    gx[b] += dx[b];
    gy[b] += dy[b];
    goto ghostmoved;
    ghostwall:
    if (dx[b] == 0) goto nodx;
    dx[b] = 0;
    dy[b] = (rand() % 2) * 2 - 1;
    goto ghostmoved;
    nodx:
    dy[b] = 0;
    dx[b] = (rand() % 2) * 2 - 1;
    ghostmoved:
    b++;
    if (b < 4) goto loopghosts;
 
    r = true;
    goto mainloop;
    nottimer:
    if (e.type == ALLEGRO_EVENT_KEY_DOWN) k[e.keyboard.keycode] = true;
    if (e.type == ALLEGRO_EVENT_KEY_UP) k[e.keyboard.keycode] = false;
 
    goto mainloop;
    done:
    free(m);
    al_uninstall_system();
}
Posted in News | Leave a comment

Global Game Jam 2012

On Friday I travelled to Vienna to attend my sister’s “Sponsionsfeier” (ceremony where she was awarded her Master’s degree in biomedicine). I had heard of the GGJ earlier from Oncer in #Moosader so looked up the address and went there. And decided to register and take part.

I teamed up with someone who wanted to make a 3D snake clone. The result turned out quite interesting I think:

Posted in News | Leave a comment
SantaHack 2011

SantaHack 2011

I took part in SantaHack 2011 and made a game called xmas. Download (.exe plus sources) is here.

Posted in News | Leave a comment

The Coke diet

How Coke helped me lose weight!

I love Coca Cola. I was drinking 2 liters of it per day. Every day for about 10 years. And despite what people claim I never had any health problems. About half a year ago I bought a scale and then, just as some kind of experiment initially, tried watching what would happen if I’d reduce my Coke intake to 1 liter per day. And in the following weeks actually reduced it further to no Coke anymore. This is the somewhat interesting result:

I started losing weight really fast by just leaving out one liter of coke at first. And then constantly kept losing weight. After about three months I was losing much less weight even though I was eating/drinking the exact same things, not sure why. Still, by simply replacing those 2 liters of coke with 2 liters of carbonated water I keep losing weight. The three days at the end without data points is when I wasn’t home (and also got sick which explains the somewhat abrupt weight loss there). But that means I’m now down 10 kg, from about 80 kg to about 70 kg, which means my experiment is now done I guess.

Maybe next I’ll see how fast I can get the weight back if I start drinking Coke again :)

Posted in News | Leave a comment
Speedhack 2011

Speedhack 2011

Took part in Speedhack 2011. The game I made is called Red, White & You. The speedhack rules this timere were ESRB-E rating, random, color, propaganda and lazyness. Not much to get a specific game idea so I just started coding, using pymunk. In hindsight pymunk was a bad choice as I had a hard time getting it to work on Windows. It uses some Python 2.x constructs (I’m using Python 3) and its setup.py script couldn’t compile a new chipmunk.dll which does not depend on msvcr71.dll. Also I know the chipmunk C API so the extra cruft pymunk adds wasn’t so useful, especially as it’s very incomplete. Next time I’ll just use ctypes and chipmunk (mingw compiled dll for windows) directly. Will solve all problems :)

Coding the game itself was a lot of fun though, so I’m happy :)

Posted in News | Leave a comment