Rebuild: iPhone, iPod touch & 99 cent sale

I just released the version 2.0 update to Rebuild iOS, which adds support for iPhone 3GS/4/4S and iPod Touch 3&4. To celebrate, Rebuild is also on sale for 99 cents through the end of this weekend!

I just got new business cards made up for GDC. This one is my favorite. :)

I hope this update also addresses some of the stability issues that Rebuild has been having on the iPad 1. Did you realize an iPhone 4 has twice as much memory as the iPad 1? So it was easier than I’d expected to accommodate iPhones, and obviously I should have done this earlier. I can’t get enough of how nice the cartoony map graphics look on that double-density display.

Embrace the Chaos with Pineapple Smash Crew

Today Richard Edwards’ game  Pineapple Smash Crew was launched on Steam and Desura and it’s totaly awesome! I was lucky enough to play it before its release and I’d like to review what I think makes it such a great game.

At its heart Pineapple Smash Crew is about managing Chaos. It is a whirling, exploding, ballet where you are constantly trying to bring order in the face of total bedlam. I think as a species we value simplicity and order so it’s a strong theme.

Bring Order to the Chaos!

Managing chaos is also a powerful game mechanic because:

  1. pummeling it into order is fun
  2. while living in the chaos we are constantly being presented with new situations and small puzzles to solve

Games are about making decisions. Every moment you play there are good moves to make and bad moves to make. You succeed by choosing the good moves. In this way every game is a puzzle game. Pineapple Smash Crew is a puzzle game with very quick turns.

In all games the fun comes from improving. From learning to play the game better. We do this by recognising situations we’ve been in before and growing a catalog of good moves which fit that situation. In some games (especially old arcade games) we play the same level over and over. This makes it easy to recognise situations because we see them in the same order every time. Every enemy or jump is a small puzzle that it’s up to us to solve. Then we have to remember the solution and apply each one in order to beat the level. This is how you play a hard Mario or Mega Man level.

These games have very little chaos in them. Because you can predict what’s coming you rarely have to improvise on the fly. Pineapple Smash Crew is different, it’s all about improvisation. In Pineapple you still have to build a catalog of situations, puzzles, and possible solutions to them. But in Pineapple you have to be more fluid in matching puzzles to solutions because you will never see exactly the same puzzle twice. Luckily our brains are really good at this. Just like we can recognise the letter “A” in many fonts we can recognise fundamentally simmilar gameplay situations.

The more we play the more situations we can recognise and the more chaos we can endure. This is essentially what a difficulty curve is. It’s an attempt to present you with slight variations on puzzles you’ve already solved and require you to solve them more precisely and efficiently.

Rich has done a great job of orchestrating this dance between order and chaos. You wont be thinking about cataloguing situations or slight variations, that all goes on in the subconscious. You’ll just be thinking “Oh god where is the next health pickup” and “Fuck Yeah!” when you blow the hell out of six guys with one well aimed rocket.

2011 Was A Good Year for Zombies

It was also a great year for us! Colin and I hopped around the world again with nothing but our laptops, meeting new friends and working on our respective games. I released Rebuild 1 in February from Costa Rica, Rebuild 2 in October from Japan, and Rebuild Mobile in November from the Philippines. The games have done well enough that we can afford to keep this travel thing up for another year.

Best of 2011 AwardRebuild recently won the Best of 2011 award for Simulation/Strategy from JayIsGames, my favorite casual games review site. Between that, placing in the Kongregate top ten all year, and being called “unputdownable” by Touch Arcade, Rebuild has totally exceeded any expectations I had when I wrote the first version one weekend at my in-law’s house. Thanks to everyone who’s encouraged me to keep improving the series!

Soon I’ll be releasing Rebuild for iPhone/iPod touch, to complete my domination of the iOS market. Then it’s finally time to take a break from the brain nomming cretins (god love ’em) and work on Incredipede with Colin. Which BTW is going to look amazing!

Debugging Shaders in Flash with PIX

** Update: It’s hard to tell but I think PIX is no longer a free app and is now part of Visual Studio :/ I have started using Intel’s profiler/debugger which is quite good but requires you to have an intel card you can use **

What the Fuck!

What the Fuck is it DOING!?

Why in the name of hell isn’t it working?

These are just a few of the fun phrases you can apply in the fun field of Shader programming with Flash’s new Stage3d API.

Shaders are cool as hell. In my last post I wrote up an example of a pixel shader that makes grass wave in the wind. It was a pretty simple 7 line shader and I managed to write it without a debugger of any kind. The real problem comes when you want to write something more complicated. Then the lack of any solid feedback will start to drive you crazy. You will begin to fantasize about introducing axes to graphics cards with great force. Fortunately Microsoft, in a rare show of magnanimity, has given us a way out.

There is a tool in DirectX Utilities called PIX which can be used to examine shader variables as well as step through their operation! In a perfect world that would be all the instruction required: use PIX. Unfortunately PIX has a bit of a learning curve and there are a few bends to the curve that are far from obvious so I’m going to tediously document every little step.

I’m going assume you have the standalone flash player. But you will need that if you don’t have it. This example is going to use my simple Shader Testbed which you can download from this post.

First go download DirectX and install it. *I don’t think this link will get you PIX anymore* Now run PIX which is one of the DirectX Utilities in your start menu. Inside PIX select file->New Experiment You will be presented with a window that looks like this:

Provide the path to your flash stand alone player in the Program path field. Select the “a single-frame capture of Direct3D whenever F12 is pressed” radio button. Now click the “more options” button and then the “Target Program” tab.

In the “Command-line arguments” field fill in the path to your swf. Now hit “Start Experiment”. If your swf doesn’t start running then you’ve got a filename wrong or something.

Ideally now your swf is running. Do whatever you have to do to get your shader running and the results on the screen. For my Shader Testbed example I’m going to paste in the wavy grass shader.

The moment has come. Now hit F-12. This will capture the state of the program on that frame. Close your swf. This will bring up PIX’s analysis window which is chock-a-block with stuff. You want to debug a pixel and look at watch the shader modify its value. To do that:

To get there:

  1. Select the frame you captured
  2. Select the render tab, this will bring up a screenshot of the frame in question
  3. Right click on the pixel you’re interested in and select “Debug This Pixel”

Now you’ll get a list of draw calls pertaining to that pixel. Unfortunately for some reason it won’t include the draw call you care about. Or it will, but it won’t include your shader… or something. For whatever reason you can’t debug your shader from here. You can debug some shader here but you can’t debug your shader here.

To debug your shader you have to select the specific draw call that displays your texture. You can find that by expanding the Frame and finding the draw call manually.

After expanding the Frame press the “Next Draw Call” button. It’s a capital D with an arrow next to it. Then make sure you have the “render” tab open on the right.

Watch the screenshot on the right and go from draw call to draw call until your texture shows up. Now stop hitting the “Next Draw Call” button or you’ll get back to the useless state. Ok, now go back to the Render window and right-click a pixel on your texture and select “Debug This Pixel”.

This time it will actually work! Hit the “Debug Pixel” link and you will get to step through your shader code and inspect the registers!

It’s not in AGAL, it’s in some other shader assembly but, you know, seen one shader assembly language you seen ’em all really.

So, yeah, that did take a fair amount of work and yes, the turn around time between debug sessions isn’t great. But damn it shaders are super cool and if you want to do much with them then you’re going to have to be able to do some debugging.

Hope you found this useful. It took me a while to figure out. Also, if you have trouble finding the right draw call you can always use the “Objects” window to find the memory address of your particular shader, search the Frame for that address, and then you know the next draw call is the one you want.

Woo! Shaders!

Simple AGAL Shader Testbed

This is a very quick testbed designed to help write Flash AGAL shaders.

If you don’t know what a shader is you should read my Shader Post.

You must have Flash 11 for this to work

You can test it out by pasting in my “swaying grass” pixel shader:

sub ft3, v1.y, fc1.y //offset = 1-y
pow ft3, ft3, fc2 //offset = offset^3
mul ft3, ft3.y, fc3 //offset = sin(count)*offset
mul ft3, ft3, fc4 //offset *= .3
add ft2, v1, ft3 //texturePos.x += offset
tex ft1, ft2, fs0 <2d,linear,repeat,mipnearest> //pixel = texture(texturePos)
mov oc, ft1 //return(pixel)

If you replace the Pixel/Fragment shader with the above code and hit the “Render” button you’ll see the grass sway. See my Pixel Shader Example post for a full description of this AGAL code.

The (hastily written) source is here: ShaderTestBed.

And you can download the .swf Here.