Author: Colin Northway

  • Criticising the Critics

    Yesterday I started to read Tevis Thompson’s piece on Bioshock Infinite and Game Criticism Generally. And, like Tevis’ writing has done before, it made me angry so I tweeted some tweets:

    twitterCritics

    Most of which I stand by. But that middle tweet “Don’t listen to critics, they are trying to make you love what they love” reeks of bullshit to me now. What should we fellow human beings be doing about art if it is not bringing eachother an experience that we will love? Of course everyone should be evangelistic about things they love. That’s a wonderful thing to do.

    I do think that the world of painting and sculpture has been stolen from us by critics though, and here is why:

    fountainI love contemporary art, part of the joy of traveling is that we get to explore contemporary art galleries from Tokyo to Istanbul to Paris to Vancouver but this love of contemporary art has come despite the established art world. For generations and generations painting and sculture was seperated into high art and low art. Low art was pictures of puppy dogs and sunsets, mickey mouse and advertising. High art was often oils, eventually abstract, basically whatever hangs in a museum. The divide was boolean and at the extremes the gulf was great: The Mona Lisa is a masterwork of great value, mickey mouse is common and not very interesting. Duchamp tried to smash down this wall. Pop art took a fire-ax to it. But both ended up being terribly horribly co-opted. Replicas of Duchamp’s Fountain (the original is lost) are displayed in galleries and have value whereas the average toilet urinal is not and does not. So while people have smashed at the divide between high art and low art it still stands, solid and unwavering. Staring any common-man who walks into an art gallery straight in the eyeballs.

    monaLisaAnd this is the damage that the critical divide between “good” and “bad” art does, it stares you in the eyes whenever you walk into a gallery and tells you what you “should” like. What you can admit to liking without having someone more knowlegable than you chuckle at you. You can say you like the Mona Lisa for instance, and Mondrian and 17th century portraiture. Saying you like these will make the people around you nod their heads in a greement. No one will laugh at you, those are some acceptably high-art tastes. But does anyone who hasn’t studied art actually like those things? No. That’s why going to the art gallery is a chore and not a joy. Because the things that you are expected to like are only exciting to people who have poured their entire lives into art. Mondrian was incredibly exciting at the time but now his work has been co-opted and reshaped so much and so many times his original works are boring and stale. It is only if you are educated in what came before and after does the work become interesting so it is only interesting to people who have dedicated themselves to studying painting. Those are the people who decide what is good, who can defend their decisions, and the rest of the world looks to them to decide what to look at when they go to a gallery.

    So people don’t go to the third floor of the Vancouver art gallery where the contemporary art is. They stay on the first floor where the Picassos hang. Never mind that you’ve seen those paintings a million times already, reproduced in ads and movies and magazines and online. Those are the high-status paintings and high-status in the art world is everything.

    whaleBut the stuff on the third floor is amazing! It’s got no history, you’ve never heard of the artist and you’re not sure if it’s even “art” or not but god damn, hanging from the ceiling is a whole whale skeleton made of lawn-chairs! How cool is that!? Lets be honest, anyone can appreciate a giant whale made of lawn-chairs. If that’s too shallow for you then over in the corner there’s work that talks about modern local issues in a way that you can understand without an art education (as long as you’re from BC). It’s a minor miracle this stuff is even here, the Vancouver gallery is particularly good at exhibiting local artists who do work that’s interesting to a crowd with no art-education. On the other hand the MOMA and the SFMOMA are particularly bad at it. They play to what you are supposed to like, artists that critics have all agreed are good and important. But these artists are talking straight over our heads because critics are bored by the stuff we like. That’s not surprising, they’ve spent their whole lives looking at paintings. I don’t think your average art historian would get The Stanley Parable just like I don’t get the Mona Lisa. Insisting that we have the same taste as someone who has spent their whole life engaged with a medium isn’t productive and it’s what keeps people out of art galleries.

    When I read pretty much anything Tevis writes I get mad because his writing oozes a certainty and an authority that I think is slowly building a wall between the Mona Lisa and Lawn-Chair Whales. But I was so wrong to call out all criticism as bad. Critics probably had something to do with getting Brian Jungen’s work into the gallery to begin with. Many games right now have a frightening relationship with race and gender and it’s incredibly valuable to have people pointing that out.

    Realistically games aren’t going to go the way of paintings and sculptures anyway, they are of too much populist interest. More likely we will fall into the casual snobbery of films and music where the wall exists but is more permeable. I just love that right now, among my friends, Angry Birds is a “good” game and so is The Stanley Parable. No one feels the need to call one inherintly “better” than the other. That discussion, along with “is it even a game” and “what is art” isn’t useful and doesn’t need to happen.

     

    p.s. I also think I have some insight into why players are horrible assholes to people who criticise games they like. In a disagreement between the casual enthusiast and the studied critic the enthusiast has almost no way to argue his point. Art is very hard to talk about. Why do I love the whale? I really have no idea, I can not express it in words. I think this helps explain why well written pieces that sharply criticise a popular game are met with angry invectives instead of anything constructive. These players want to express how much and why they love this piece of art but have no idea how to do that so they collapse into hurtful personal attacks in a horrible attempt to defend the thing they love. I studied film a little bit in university so I can express to you very clearly why the structural problems in Game of Thrones make it infuriating for me to watch. But what’s your comeback going to be if you haven’t? “Oh… I like it”. Being able to justify your position has an odd importance in our world, that’s why some art galleries have those rediculous little writeups filled with art-speak and high-minded ideas, because, “Holy shit, that looks cool!” is, for some reason, not enough for us.

    If you do need a greater reason to like the whale: “Brian Jungen’s sculpture ‘Shapeshifter’ makes a statement about cultural hybridity and institutional displays of marine life in aquariums and natural history museums. Jungen, who investigates the intersections and fluid boundaries between Aboriginal and Western cultures, asks us to consider the skeleton of a whale, not an anatomically accurate whale, but a composite influenced by the forms of chairs and by actual whale species. With his choice of material – the ubiquitous monoblock plastic chairs found in discount stores around the world – the artist explores the potential for communication inherent in mass-produced objects in the context of a global economy. Many societies are fascinated by whales and have endowed them with special significance. Aboriginal groups consider the whale to be an animal of great spiritual power, while whales in captivity are popular tourist attractions. The title “Shapeshifter” refers to the spiritual process of transformation from human to animal or vice versa.”

  • Aztez Improvisation

    AztezLogo

    Asset2-200x300I am very interested in Improvisation in games. One of my favorite things in games is knowing its systems inside out and then being able to play with them in unique ways. To be presented with novel problems I have never solved before and using the tools the game gives me to overcome them, preferably under time pressure.

    It’s no surprise that a lot of my favorite games strongly rely on improvisation; being able to quickly digest new situations and devise a novel solution to it. A list of my favorite improvisation-forward games might include Starcraft, Spelunky and Panel de Pon. These are games I love deeply. Games I have dropped hour upon hour into and never felt guilty about. Games that I am proud to be good at and still have room to grow.

    But today I want to talk about Improvisation specifically in the light of  Ben Ruiz and Matthew Wegner’s upcomming brawler Aztez. Aztez is still a ways away from release but Ben and Matthew stayed with us for a few months in Mexico so I have had the joy of playing early versions. Before Aztez I had never really played brawlers before (I don’t count River City Ransom, fun but shallow) and dropping into Aztez has been like discovering a new unspoiled continent for me. It’s very good at improvisation and I want to discuss why.

    Screen2-1024x576

    Broad Tools

    First Aztez offers you a lot of inputs, a lot of tools. I’m not going to enumerate every move in Aztez but in terms of variables to work with it has: damage, reach, knock-back, knock-to-ground, knock-to-air, stun, grab, parry, lead-up-time, cool-down-time, combos, foward movement, move to air, move to ground, etc… etc… Ben takes these variables and crafts moves out of them which in turn make up your complete tool set. These tools are varied and balanced, they each play a different role in solving the problems the game will present you with.

    Combinatoric Problems

    Asset1-300x298This is the beating heart of an improvisation game. What use are tools without problems to solve? Games that use randomness or unpredictable complexity are great at giving players a vast set of unique-but-simmilar puzzles. Aztez has different types of enemies but lets take a case where you are fighting four guys of the same type. Now how many problems do these enemies present you? Very many. The case of on being to your right and three to your left is different from all on the left, the enemies may or may not be attacking, they have different spacing, they have different amounts of health, they may be stunned, they may be on the ground, they may be in the air. The number and state of the four guys defines your current puzzle. Now you decide which tools to use.

    I call these problems combinatoric because they are a combination of many simple states. Each single state is easy to understand and the correct response to it is known. But it is their ability to be combined that is their strength. Not only does this generate many new problems for the player but, and this is important, they are all simmilar states. On the face of it this might seem like a disadvantage. You might think you want as much breadth as possible but if you were generating very different states then players wouldn’t get to use the things they have already learned. You want to present them constantly with puzzles that are simmilar to problems they have solved before, so that they have some idea of how to solve them, but problems that are still different, so that they are forced to improvise a slightly new solution.

    Many Possible Answers

    Asset3-257x300Think of improvising in music, there is no correct jazz solo, although some solos are better than others. This is part of the joy of improvisation games. By allowing a large number of possible solutions you maximise the player’s chance of finding one. Obviously this has to be balanced with challenge. In Aztez there are always many actions that solve the puzzle but there are many more actions that lead to death. This also leaves room for style. Different players will tend towards different types of solutions. In Aztez you might focus on controling the enemies or on being hard to hit or just brute-force dealing brutal amounts of damage. Players will naturaly develop different skills depending on what tactics work for them early on.

    Time Pressure

    You could have all of the above without time pressure, but time pressure adds a beautiful flow to the game. Without time pressure there is a temptation to spend forever maximising your solution, to sit and stare and calculate. With time pressure you are forced to focus on the bigger picture and to rely on trial and error to figure out the details. This is more fun, why? Who knows, that’s  the way the human brain is built. Time pressure frees your frontal cortex from the minutea.

     

    Incredipede, Fantastic Contraption, and the game I’m working on now don’t really use these principles, many great games don’t. But I want to start making games that embrace improvisation. Games that allow players to be artful. I’m even learning to play the flute so I can have a better understanding of improvisation. I hope in the future to make games that let you be a virtuoso every bit as much as Aztez does.

    Screen12-1024x576

  • Drawing a Trapezoid with Stage3d

    brokenGround

    The game I’m working on now has nice round corners that we surround with fuzzy grass or hard crystals or any number of pleasently tactile textures. Unfortunately until yesterday they were being drawn with horrible jaggy distortion (click on the image for a better view).

    This happens because I draw the circles out of trapezoids and the trapezoids out of triangles, and then the graphics card gets confused when it stretches the texture across the triangles. Here is a clear example of what it does look like vs. what it should look like:


    trapezoidBoth

     

    Obviously the one on the left is bad. It looks ridiculous at this scale and when you put it into the game it gives that jaggy broken look. It does show you clearly where the two triangles are, one on the top with a width of 400 pixels and one on the bottom with a width of 100 pixels. That width disparity is what drives the problem. I pass in UV texture coordinates for each point in each triangle but because the top triangle doesn’t know anything about the bottom right point it can’t know it’s being streched onto a trapedzoid so it just always assumes its being stretched onto a square.

    Important! If you are using OpenGL or a graphics library that uses 4d texture coordiantes then you have an easy fix for this as described here.

    Unfortunately Stage3d only has 2d texture coordinates so we have to fix it in the shader. Here is what a normal, shader might look like, one that results in a broken trapezoid:

    Vertex Shader:
    m44 vt0, va0, vc0
    mov v1, va2 
    mov op, vt0
    Pixel Shader:
    tex ft1, v1, fs0 <2d,linear,repeat,mipnearest>
    mov oc, ft1

    If you don’t know what this is then you can go read my posts on writing shaders for Stage3d.

    Here is an image with some important information about our trapezoid. On right right is the texture coordiantes. It’s important to know that 0,0 is the top left and not the bottom left.

    trapezoidDetails

    The colourful image on the left is showing what shapes the graphics card is trying to texture. The bizarre slanting of the textures makes more sense if you think about what shape the triangle thinks it’s a part of. You can see the top triangle is trying to draw a big rhombus and the bottom triangle is trying to draw a much smaller one.

    If you think of it like this it becomes pretty clear that we just want to divide the x coordinate by 1-y coordinate. The top pixels are correct, and they get more wrong as they approach the bottom. Dividing them by 1-y will divide them by the range 1-0 which isn’t strictly correct unless the bottom trapezoid is zero length, but it’s much closer than what it’s doing now. Instead of the range 1-0 we really we want to divide by the range 1-.25 because the bottom is 100 pixels and top is 400 pixels. 100/400 = .25 and since it’s trying to draw a bottom that is 400 pixels wide multiplying by .25 will result in a 100 pixel bottom. (remember, since we’re working in UV coords bigger numbers result in the texture being squeezed more so if you want to decrease the  size you divide by .25 instead of multiply).

    Now we could do that with this pixel shader:

    mov ft2 v1 //v1 contains our UV coords
    mov ft3 v1 //ft3 will contain our modified y coord
    mul ft3 ft3 fc4 //multiply by 1-ratio of bottom to top. In this case fc4 contains .75
    sub ft3 fc1 ft3 //y = 1-y Now ft3.y contains values from 1 to .25 (fc1 contains 1)
    rcp ft3 ft3 //y = 1/y there is no divide operator so we multiply by the reciprocal
    mul ft2.x ft2.x ft3.y //do the real work
    tex ft1, ft2, fs0 <2d,linear,repeat,mipnearest> //sample the texture
    mov oc, ft1 //output

    inShaderWhich results in the image on the right. Pretty cool eh? The top triangle is now correct! Unfortunately the bottom one is fucked. Plus we got here by passing the bottom/top ratio through a shader constant which isn’t going to work with variable shaped trapezoids unless we draw them one triangle at a time. Which is not going to fly.

    So we need to generalise this to the bottom triangle as well as figure out a way to pass the shader the needed information. Obviously it’s time to fire up the VertexBuffers!

    First lets take a quick peek at how we’re passing in the points and the UV coordinates. Here is some code:

    triangles.push(new point(0, 0), new point(150, 300), new point(400, 0));
    triangles.push(new point(150, 300), new point(400, 0), new point(250, 300));
    for (var i:int = 0; i < triangles.length; i += 6) {
      mVertexData.setTexCoords(i, 0, 0);
      mVertexData.setTexCoords(i+1, 0, 1);
      mVertexData.setTexCoords(i+2, 1, 0);
      mVertexData.setTexCoords(i+3, 0, 1);
      mVertexData.setTexCoords(i+4, 1, 0);
      mVertexData.setTexCoords(i+5, 1, 1);
    }

    pointNum

    On the right I’ve numbered our  points as well as reminded us all what the UV coords for those points are. The biggest thing we need to do now is to start passing the Bottom/Top ratio to the shader. We’re going to do that by passing them into the shader through a vertex buffer. I’m using Starling so I modified the starling VertexData class to hold my data but however you usually pass in your vertex buffer is cool. The important thing is that somewhere you have a line that looks kind of like this:

    context.setVertexBufferAt(1, mVertexBuffer, VertexData.PERSPECTIVE_OFFSET,    Context3DVertexBufferFormat.FLOAT_3);

    Note that I named the collection of variables I’m about to pass in Perspective variables. Because it’s kind of a perspective transform we’re doing.

    We could, at this point, just pass in Bottom/Top which would look something like this (remember, your mVertexData has no .setPerpectiveCoords, I added that):

    var w1:Number = mTriangles[i + 2].x - mTriangles[i].x
    var w2:Number = mTriangles[i + 5].x - mTriangles[i+3].x
    mVertexData.setPerpectiveCoords(i, w2/w1);

    But we can actually do better than that. We can do some of the math for the shader, which will be way faster than doing it for every pixel. Lets see what that looks like:

    //Set the UV coords
    mVertexData.setTexCoords(i, 0, 0);
    mVertexData.setTexCoords(i+1, 0, 1);
    mVertexData.setTexCoords(i+2, 1, 0);
    
    //prep our perspective vals. We want this to go from 1->.25
    var val0:Number = 0;
    var val1:Number = 1;
    val0 *= (w2/w1)-1; //0
    val1 *= (w2/w1)-1; //-.75
    
    val0 = val0 + 1; //1
    val1 = val1 + 1; //.25
    mVertexData.setPerpectiveCoords(i, 1, val0, 0);
    mVertexData.setPerpectiveCoords(i+1, 1, val1, 0);
    mVertexData.setPerpectiveCoords(i+2, 1, val0, 0);

    This is actually pretty clever. Remember that anything passed from the vertex shader to the pixel shader is linearly interpolated. We use that by passing in 1 to the top points and .25 to the bottom point and let the video card do the work for us. Unfortunately we can’t also do the divide because the graph of 1/x is not a linear graph and so the transformation gets effed. That means our shaders now look like this:

    Vertex:
    m44 vt0, va0, vc0
    mov v0, va1 //pass in our perpective data
    mov v1, va2 //pass in the UV Coords
    mov op, vt0
    Pixel:
    rcp ft3 v0 //y = 1/y
    mul ft2.xyzw v1.xyzw ft3.yxzw //multiply TexCoords.x by 1/y
    add ft2.x ft2.x v0.z //translate by some amount (we haven't discussed this yet)
    tex ft1, ft2, fs0 <2d,linear,repeat,mipnearest> //grab the pixel
    mov oc, ft1 //out

    Magic! Our top triangle is now tops! Time to move on to the bottom one. The only tricky think about the bottom one is that its x and y coords are the reverse of what we want. The top one was easy because 0,0 was always correct but for the bottom triangle 1,1 is always correct and 0,0 is the most wrong. The solution? Pass in the UV coords upsidedown! Do the math on the upsidedown coords and then flip them back.

    Here is what that looks like:

    //Old UV coords
    //mVertexData.setTexCoords(i+3, 0, 1);
    //mVertexData.setTexCoords(i+4, 1, 0);
    //mVertexData.setTexCoords(i+5, 1, 1);*/
    //fliped Coords
    mVertexData.setTexCoords(i+3, 1, 0);
    mVertexData.setTexCoords(i+4, 0, 1);
    mVertexData.setTexCoords(i + 5, 0, 0);
    
    
    val0 = 0;
    val1 = 1;
    val0 *= (w1/w2)-1; // w1/w2 instead of w2/w1
    val1 *= (w1/w2)-1;
    val0 = val0 + 1;
    val1 = val1 + 1;
    val0 = -val0; //Flip the sign so that when the x is multiplied by 1/y it will flip the sign of x
    val1 = -val1;
    mVertexData.setPerpectiveCoords(i+3, -1, val0, 1);
    mVertexData.setPerpectiveCoords(i+4, -1, val1, 1);
    mVertexData.setPerpectiveCoords(i+5, -1, val0, 1);

    Note -1 in the perpective coords. If you go back and look at the pixel shader you will see we multiply the y value by perspectiveCoords.x. By passing in -1 we flip the y axis. We flip the x axis by passing in a negative perspectiveCoords.y value.

    ALMOST DONE!

    The bottom triangle is fixed and this works for arbitrarily shaped trapezoids. The only problem is that it only works for texture coords from 0 to 1. But in real life our texture coords are usually things like 4.5 to 4.8 or 2.2 to 5.8 (in my application the y is always 0 to 1 though). That’s what this shader line is about:

    add ft2.x ft2.x v0.z //translate by some amount (we haven't discussed this yet)

    We just do all our math from 0 and then add back however much we want. If you look at these lines:

    mVertexData.setPerpectiveCoords(i+5, -1, val0, 1);

    And replace the , 1); with , 4.5); or , 2.2); or whatever texture coord you want you will get your desired translation. To set your desired width you just pass the width in to the UV coords as usual:

    mVertexData.setTexCoords(i, 0, 0);
    mVertexData.setTexCoords(i+1, 0, 1);
    mVertexData.setTexCoords(i+2, desiredLength, 0);

    Now we really are truly finished and we are rewarded by beautiful globby circular level layouts like this:

    final

    Callooh! Callay!

  • Spelunky + Game Designers = <3?

    I was watching this video by Rev3Games hosted by Anthony Carboni this morning , at the beginning of the interview Anthony suggests that game designers tend to love Spelunky more than other people. I don’t know if this is true but I have a theory about why it might be.

    Games are inherently about getting better, progressing towards mastery and there are two ways for games to give you this feeling of mastery:

    1. Skill Mastery: give you systems that you can learn and improve at (i.e. improving your multitasking is Starcraft)
    2. Number Mastery: increase some number over time (i.e. increase your level in Final Fantasy)

    Games are almost always a combination of the two. The core of the game is something you can improve at and by improving you are able to increase some number that is a gauge of your skill. I think the less of a gamer someone is the more easily they confuse these two things. The most casual games have almost no skill mastery but strong number mastery systems (Farmville being an amazing example). The least casual games usually have number mastery very tightly coupled to skill mastery with Starcraft and Chess’ ladder systems topping the chart. Game designers, who think about games all the time, should be really good at distinguishing between these two things and that helps them like Spelunky, which has wonky number mastery.

    Spelunky is a hardcore skill mastery game. No matter how many times you play you always start the game naked as the first time you played. In the video above and in other places Derek talks about how Spelunky has a non-traditional difficulty curve: it starts very steep in the mines, gets even harder in the jungle and then eases out with the ice and the temple. But the rate at which people aproach skill mastery is the opposite, they start bad and then get better and better and better. This means the game’s number mastery system (getting to later levels) is telling you that you are improving very slowly even when you are improving very quickly. Even a future master of the game will spend a lot more time dying in the mines then they will ever spend in the late-game temple levels.

    The result of this is that the game is very frustrating to players who look to number mastery for their “I’m improving” fix (since improving at something is why games are fun) and less frustrating to players who “see past” the numbers and know that they are greatly improving their skills despite not being able to beat the first level.

    Does this mean that some people are better at self-gauging when they are improving at things than other people? Or that they trust their own sense of improvement over external indicators? Or that they value external indicators less? Probably a combination of all three. I would also wager that the more games you play the more true all of these things become. As time passes you play less and less for the numbers and more and more for the raw experience of playing and learning, of experiencing novel environments and learning to master them.

    So game designers, because we play a lot of games, probably like Spelunky more than people who have played less games. You could also argue that being in indie games self-selects people with a strong attraction to internal indicators over external ones. Making an indie game requires months or years of work with little clear, positive, external feedback. Meaning we have to be good at self-guaging when we are improving.

    It may be that all of these things make it easier for players like me to enjoy Spelunky, but I doubt that it makes Spelunky better for us. I think we would probably enjoy it just as much if the numbers reflected our growing skill more generously, and maybe all those people who find it “too hard” would realise that the game is just lying to them.

  • Solution to the BirdBrain Puzzle

    I posted a very hard puzzle here and challenged the Internet to solve it. It’s quite a hard puzzle and it took about a day from originally posting it for someone to solve it. That someone was Mark Ivey (@zovirl). I asked him to write a quick description of his solution and he did up a very nice little post which I thank him for. Here is Mark Ivey’s solution to my puzzle:

    The Solution to the BirdBrain Puzzle by Mark Ivey

    Overview: A down-and-left circuit moves the birds to the first & last yellow pellets. A decaying memory circuit bounces the birds up off the red ball. Since this loop decays over time the birds will go down again after clearing wall #2.
    Down-and-right circuit
    To bounce up, the birds have to hit the ball from the top. If they hit the side, they’ll bounce at the wrong angle.
    The right signal is slightly stronger than the down signal to make sure the birds get over the ball before hitting it.
    Decaying Memory Circuit
    Bouncing up requires reversing the ball signal. Keeping the birds moving up after they hit the ball requires a memory loop. When a bird hits the ball, the ball signal gets injected into the loop. The 2 neurons in the loop keep the signal alive even after the bird leaves the ball. Then the signal is reversed (repel from the ball instead of attract to it) and passed to the wings.
    Don’t want the birds to keep going up forever, just want them to go high enough to clear wall #2. This means the memory of hitting the ball has to decay. A sidetrip out through the 1/2 neuron does this. To keep the signal from decaying too quickly, more connections are added between the 2 memory neurons. This dilutes the effect of the 1/2.

     If the bounce signal has to fight against the down signal, the birds move too slowly. To prevent the bounce from having to fight the down signal like this, a bunch of parts of the bounce circuit send suppression signals to the down-and-left circuit.
    Tuning
    Once the birds are moving in a nice down-up-down motion, it took some tuning to get them to just barely clear wall #2 before going back down to the 3rd pill.
    Tuning #1: The memory decays slower if there are more connections between the 2 memory neurons (this dilutes the effect of the 1/2 signal). About 5 connections in each direction worked well.
    Tuning #2: The suppression lines are doubled in a few places to suppress the down signal even more.