More levels…

posted in: Flash | 0

Level design continues.  I just finished the 37th out of 40!  Some of you might note some familiarity in this one…

As has been the norm lately, this level doesn’t have any detail objects yet, so the final version will also have various nubbins and doodads decorating the scene.

Ben’s illustrated comic panels are coming along really well–there are now 10 out of 15 completed.  David is also still hard at work on the music (sound comes soon), but it’s tougher to gauge his progress with numbers.

Suddenly, it feels like we’re getting close to the end of the project.

Numbers are fun, so here are a few:  I just checked and the game currently has around seven hundred lines of dialogue.  For comparison, the original had about fifty lines of monologue.  Hooray!  Some might think that “more words” isn’t necessarily “more better,” and those people are exactly right.  However, the tone of this game is much more conversational (since it’s not all about a hermit this time around), and it’s much longer, too, so I think the extra text is appropriate.

Oh, also, the original game was under 2,000 lines of code in total, and the prequel is already past 6,000.  2,000 of those are just level data, though, and half of that 2,000 is just the tile maps.  Here’s the above screenshot’s tile map because…I dunno, it looks kinda neat.

maps[36]=[[1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1]]

This is just the map of the terrain–each level also needs data for game objects like switches, characters, and doors, plus scenario data like hotspots, dialogue, triggers for dialogue, etc…but those don’t look particularly interesting.  If you’re curious about the hotspots, dialogue triggering, and NPC behavior, you can check out this earlier post that covers those topics .

Note that the data is a 1:1 representation of the level where each number is one 20×20 pixel tile, but it’s mirrored across an imaginary diagonal line that extends from the top left to the bottom right.

Pop quiz for programmers who are interested in tile-based games:  What’s the purpose of that mirroring?

0 Responses

  1. Getting more and more excited for this!

    Also I’m no programmer so I’ll let someone else figure that last bit out :(

  2. Cool post. I’ve read about game programming, but I only got as far as making a clone of Pong. I wonder about the mirroring thing. No idea on the answer, maybe something about how arrays are stored in memory, maybe they’re faster to read that way? Just a wild guess, I’m curious…

  3. Nicolasoob

    programmer there, :-)

    in C++ we use 2 dimensional arrays for small tables like those so tab[i][j] or tab [j][i] won’t change a thing.

    If i was, however, doing this with one dimensional array one at a time, i’ll go with your solution to easily check previous content for the grass printing
    like
    for(Columns:=0;Columns<20;Columns++){
    Previous:=1;
    CurColumn=TabOfColumn[Columns];
    for(Lines:=0;Lines<20;Lines++){
    WhaToDraw:=CurColumn[Lines];
    if Previous==0 // we've drawn air before
    && WhatToDraw==1 // we're going to draw earth
    then DrawGrass();
    elsif WhatToDraw==0
    then DrawAir();
    else DrawEarth();
    endif;
    Previous:=WhatToDraw;
    }
    }

    Appart from that go for text! I certainly won't have enjoyed your Games like COM or YFYIAR without those texts.

    Guess they've realy missed me playing limbo, when you trow the kid's body in te pit or break the last spider leg (don't know if you've played limbo though! They're searching people you should apply for scenery!)

Leave a Reply to SBRedFlag

Click here to cancel reply.