Tag: Incredipede

  • How to Make a Spider in Incredipede

    This is a quick tutorial on how to make a Spider in Incredipede. Spiders are my favorite thing to make in Incredipede.

    It took me a while how to figure out how they work, but like most things in nature they are surprisingly simple and elegent.

  • How to Beat a Level in Incredipede

    I had some requests for a more structured playthrough of Incredipede. I couldn’t just play the game since I know how to beat all the levels so I made a new level and beat it for the first time on video.

    This was risky, because you never know how long it’s going to take to beat a level. Here it is!

    I actually thought up this level on the bus. I also thought up a nice solution to it. Unfortunately the solution I thought would work didn’t work at all so I tried various things in this video until I got it. It’s not a great level and didn’t have the showiest solution but it gives you an idea of how to play.

  • An Ink-Bleed Fade

    I wanted to do something nice in Incredipede for transitioning between screens. Instead of just flipping boringly from the title screen to the game map, for example, I wanted it to look like the ink was being pulled off the paper and then reprinted with a map. Like you could see the press pushing the ink into the paper.

    You can see what I came up with by watching the begining of the video in my “How do You Play Incredipede” post.

    I asked my friend at Gaijin Games, Andrew Hynek, who wrote an amazing looking ink game called Drift Sumi-e for some suggestions. I ended up mangling his ideas into something more me. That is, something simpler and easier to implement.

    Incredipede is written in Flash using Stage3d. I use the Starling 2d API because it makes my code simpler and faster. One of the things I love about Stage3d is that I get to write shaders! In assembly! I find this really fun and I wrote a few posts on pixel shaders here.

    This fade effect is all with the shaders. The basic idea is simple: I just take the brightest pixels and don’t draw them, then I take the next brightest pixels and stop drawing them until I’ve stopped drawing even the darkest pixels. The problem with doing that is it ends up looking kind of shitty. Here is how it looks if I just take out half of the brightest pixels:

    Kind of awful. If you click to enlarge it you can see how individual pixels end up being pulled out of solid spots of colour. The fade ends up looking super pixely, like something from the 80s. Another problem is that all the black pixels just disappear all at once at the very end of the fade.

    This is pretty bad but it was a good enough idea to start with. Sarah and I happened to be in Nice with our friend Marc ten Bosch while I was working on this and while we were all walking along an old aqueduct we discussed how to make it better. We thought about using noise to make the effect more organic but eventually came up with the genius idea to use a blurred mask.

    The shader code to do the bad, pixely effect is something like:

    //get the pixel
    tex ft0, v0, fs1 <2d,repeat,linear,nomip>
    //save a copy of the pixel in ft3
    mov ft3, ft0

    //brightness of a pixel ~= (R+R+B+G+G+G)/6
    mov ft1 ft0.x
    add ft1 ft1 ft0.x
    add ft1 ft1 ft0.y
    add ft1 ft1 ft0.y
    add ft1 ft1 ft0.y
    add ft1 ft1 ft0.z
    div ft1 ft1 fc2
    //ft1 now holds the pixel brightness

    //if the brightness is less than our fade constant (which moves between 0 and 1)
    //then make ft1 = 0, otherwise make it = 1
    sge ft1, fc0, ft1

    //multiply the saved pixel by ft1, which will zero it out if it isn’t
    //darker than our fade constant
    mul oc, ft3, ft1

    Even if you don’t know agal assembly this shouldn’t be too hard to read. Most of the code is getting perceived brightness of the pixel with a formula from some friendly people over on Stack Overflow. All it does is take the brightness, check to see if it’s greater than our fade constant and doesn’t draw the pixel if it is.

    Now, here is the clever trick that makes it look good. Instead of looking at the pixel in the image I look at the pixel of a blurred version of the image. I still draw the pixel of the normal unblurry image but I use a blurred image to decide whether to draw it or not.

    Here’s what the image looks like not faded at all (wonder at the amazing art of Thomas Shahan!):

    And here’s what the blurred image looks like:

    Now, the player never sees this blurred image, only the graphics card does. We use the pixels from this blurred image to decide what pixels to draw from the unblurred image. Only one line of the shader code has to change. We used to do this:

    //get the pixel
    tex ft0, v0, fs1 <2d,repeat,linear,nomip>
    //save a copy of the pixel in ft3
    mov ft3, ft0

    Now we do this:

    //grab the pixel from the blurry image to check the brightness
    tex ft0, v0, fs1 <2d,repeat,linear,nomip>
    //grab the pixel from the unblurred image to actually draw
    tex ft3, v0, fs0 <2d,repeat,linear,nomip>

    We pass both images into the shader and use one as a mask to draw the other. This gives us beautiful unpixely fades that look like this:

    The Map Half Faded

    So that’s how the Incredipede ink fade is done. I admit that there is a little hand-waving magic here. You have to know how to render-to-texture and write custom shaders in Starling. Which is not terribly easy. And you have to be able to blur your image on the fly. The blurring is actually way harder than the ink-fade transition. I based my blurring on the work of Lars Gerckens.

    Mostly I hope this inspired you to try some cool shader tricks of your own! They are pretty fun and you can get some great effects.

    This example is taken from my game Incredipede, if you don’t already know what Incredipede is you can head over to Incredipede.com to check it out.

  • How Do You Play Incredipede?

    Have you been wondering exactly how you play Incredipede? How do you make limbs? How many muscles can you create? Here are some answers for you.

     

    You can get more information about Incredipede as well as pre-order it at Incredipede.com.

  • Rebuild’s on sale. Why? #BecauseWeMay

    Rebuild 99 cent saleThis weekend I and a host of other indie developers put our games on sale #BecauseWeMay. Last week Amazon had the same idea and put Rebuild on sale for 99 cents, and although I’m personally fine with whatever they do and it did make me money, I didn’t have the option to say no. Other platforms do the opposite: they set a price in stone and don’t let developers put their own games on sale. So #BecauseWeMay is an acknowledgement of those platforms (like the Apple App Store, Google Play, and Steam) that let developers choose their own prices. Super Office Stress took the message to heart and actually raised their price to 99 bucks.

    In other Rebuild news, I’ve done a few more interviews recently, and wrote a postmortem where I describe the ups and downs of writing Flash games. All this keeps getting me thinking about a sequel…

    But mostly I’ve been beavering away with Colin at Incredipede. I hope he’ll want to post something soon because it’s looking great!

    EDIT: Amazon’s decided to feature/discount Rebuild again this weekend, so you can go get Rebuild for your Kindle Fire. How much will it cost? Only Amazon knows!