Bacon and Games

Category: Game Design (page 7 of 9)

The Making of an HTML5 Game: Biolab Disaster

Biolab Disaster isn’t the most exciting game I’ve ever played, far from it actually, but this isn’t a game review. The game is built entirely in HTML5, which in and of itself isn’t all that exciting either.

What excites me about this game is that Dominic Szablewski (the creator) was nice enough to make a short “behind the scenes” video showing how the game was built. For Flash game programmers in particular, it’s difficult to conceptualize how a game might be programmed without the techniques and tricks we’ve grown so accustomed to. Dominic’s video does a nice job of pulling back the curtain. For those of you using Flixel, his approach should be very familiar (not to mention that the game itself looks like it was built in Flixel… right down to the bouncing particles, the shaking and the familiar “press X or C to start”). Biolab Disaster was actually built using the forthcoming Impact Game Engine.

Dominic has plans to release the source as well as his level editor, but for now you can play the game here. I’ve included his ~8 minute behind the scenes video below. I always enjoy seeing how other people approach their projects, this is the first “sneak peek” I’ve seen on an HTML5 game. Thanks Dominic!

Prototypes from Adam Atomic

Recently, Adam Saltsman (Canabalt) released a bunch of game prototypes he’d been working on. They are each at various stages of completion, but they’re all worth having a look at. You can play them here.

I think it’s great that Adam has decided to share these with everyone. Prototyping is an important part of the game design process. Unfortunately, it’s also a part of the process that is often skipped (myself included). Adam typically creates game with very simple mechanics and as a result it’s easy to assume he might be skipping the prototyping phase. But as you can see, even a minimalistic designer like Adam Saltsman takes time to prototype.

Prototyping…

  • helps you find out if your concept is fun before you spend time making final art
  • allows you to figure out how you’re going to use assets before you get into final art. In whipping up placeholder art you might find that you prefer nested clips to having all your animation on one clip’s timeline, for example. It’s better to find that out before you create your art than having to go back and change it.
  • induces flexibility. When you’re working with placeholders and are rapidly prototyping, you’re not worrying about holding yourself to using art assets you’ve already created. Sometimes it’s hard to let go of stuff you’ve spent time on which can inadvertently lock you into concepts that really aren’t that important. You’ll find that you will code with more agility when you’re prototyping.
  • makes it easier to try out new things. I find that if I’m working towards a final productI’m worry about all sorts of additional stuff that’s unrelated to game mechanics; menus, game restart, transitions between game states, etc. When I’m prototyping I don’t build any of those things, so I’m free to just throw down a bunch of stuff, try it out and not have to worry about how or if it relates to any of the “non-gameplay stuff”.

On another note, I think it’s great to see some of the well known and successful game developers sharing their unpolished work. With thousands of people creating new games every week, we end up seeing primarily the best of the best… it’s all we have time for. As a result, it’s easy for budding game developers to get the impression that there are people out there who do nothing but have great ideas and crap out steaming piles of awesome. I think, particularly for young game developers, that there’s great value in having the curtain pulled back.

No-one gets a game right the first time.

Everyone has to work at it.

Having to revise your work, scrap ideas and change code is NOT a sign a failure it’s a part of the process that you’re not only expected to encounter but should be planning on doing.

How to Simplify Programming Challenges

I recently had a young programmer named Jack (that’s not his butt to the right) ask me for help with a game he’s been working on. I don’t want to give away too much about his unreleased game, but for the sake of discussion I have to at least tell you that it involves a big ass rock that goes around smashing the crap out of different shit. (and 2 sentences in I’ve hit my butt reference limit for this article)

The version he shared with me was pretty far along but he was stuck on one particular detail; getting the rock’s tail to point in the proper direction. Essentially he wanted the tail to point away from the direction the rock was moving, similar to the tail a roll of toilet paper might draw when thrown through the air.

This is a fairly common challenge in game programming and I, like many other game programmers, have done this in the past. I have code that I would have happily handed over to him, but after speaking to him we decided it would be more valuable for me to push him in the right direction rather than just take his FLA and fill in the blanks. I’ll spare you the Chinese proverb about teaching a man to fish..

On Problem Solving
Whether you’re programming super complicated banking software or just making a simple number guessing game, the process is the same.

  1. What do you need to do? Define the challenge.
  2. What do you know? Assess the tools and info you have at your disposal.
  3. Do you have all the pieces? Figure out if what you have can be used to solve the problem.
  4. If yes: Create a plan for using what you have in order to solve the problem.
  5. If no: Break the problem into smaller challenges and return to step 1

This is of course a grotesquely generalized version of problem solving. But what’s important to note is that by asking the right questions you can distill ANY problem into simpler more manageable parts. No matter how complex, the solution to all programming challenges (and most real life ones too!) is simply the sum of smaller problems solved in the right order.

Asking the Right Questions
Let’s take a look at Jack’s problem and how we might break it down into a solution.

1. What do you need to do?
We need to rotate the rock so that it’s “facing” the direction it’s moving.

This is a “plain English” definition of the problem, which is the best place to start, but before we can continue we’ll need to convert the definition of our problem into something we can quantify.

Since movieClips have a rotation (_rotation in AS2) property, it’s likely that we’re going to need to use this to point the clip in the right direction. We know that the rotation property accepts degrees, so we’re probably looking for an angle.

The real answer to Question #1 is:
“We need to figure out the angle at which the rock is moving.”

2. What do you know?
In this step you’ll want to keep the answer to Question #1 in mind, but it’s perfectly fine to be liberal about listing the things you know. You can sort out the relevant data from the irrelevant later, but you never know what piece of information might spark an idea so to start it’s a good idea to list whatever comes to mind. (be creative!)

  • Since the rock is a movieClip we have access to all of its properties; rotation, x, y, etc. These 3 are the most likely to be useful, but remember movieClips have all sorts of properties.
  • It’s moving so we probably know its speed in the x and y directions
  • Our rock might be in an environment with some rules, such as gravity, windspeed and friction. It’s our world, so we’d know all these things too.
  • We also probably know who shot Mr. Burns. Who doesn’t? But I can’t imagine that’s going to do us any good.

3. Do you have all the pieces?
Now that we’ve listed the stuff we know, we have to sift through it for something that might help us calculate an angle.

If we can define a line, we can calculate an angle. Well, a line is defined by two points so let’s look at what we collected in Question #2 and see if we can come up with two points; two points that define the path of our rock.

We have the current location of the rock, via the x and y properties of the movieClip, which would be the end point of our line. We need the starting point to complete the line, which we don’t have in our list.

This means that the answer to Question #3 is “No”. We have to put this part of the problem on hold for now and refine our problem into a more specific question:

Where can we get the starting point so that we can draw a line?

Luckily for us this is an extremely simple problem. On every frame we’re going to be updating the position of the rock. So all we have to do is store the current position of the rock before we move to the next frame. (I recommend a variable called lastPosition)

If we do that, we can add lastPosition to the list of things we know, which gives us two points. We’ve got our line! This means we can calculate an angle, which means we can figure out what angle we need in order to point the rock in the right direction. We’re almost done!

The next thing we need to do is write a function into which we can pass our starting and ending points that will give us an angle in return. Since this isn’t a math lesson, it’s a lesson about learning to fish (OK I lied about the proverb), I’ll just write the function for you. They’re adapted from one of my favorite books, Keith Peters’ Foundation Actionscript 3.0 Animation: Making Things Move! (I’m also a big fan of this book) Both are fantastic resources for math, physics and other common game programming stuff.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// AS2
function getAngle(startX,startY,endX,endY):Number{
	var dx:Number = endX - startX;
	var dy:Number = endY - startY;
	var radians:Number = Math.atan2(dy,dx);
	return radians*180/Math.PI;
}
 
// AS3 
function getAngle(st:Point,end:Point):Number{
	var dx:Number = end.x-st.x;
	var dy:Number = end.y-st.y;
	var radians:Number = Math.atan2(dy,dx);
	return radians*180/Math.PI;
}

The last thing for us to consider is how to setup the rock clip. If we set it up so it’s facing to the right in its default position [rotation=0], the angle we get back from our function will point the rock in the correct direction.

There you have it, a seemingly complex problem broken down into a few manageable parts.

This problem was small, but the process is applicable to a project of any size and challenges of any complexity. The key is accurately defining the things you need to achieve. From there you can survey what you have at your disposal and see if what you have can be used to get what you need. If you can’t, you need to define more specific questions until you have all the tools and info you need to finish the job. It’s just that simple.

Now go, build the next Farmville or twitter or Google Wave, you know…something really useful. Oh, one more thing, bedonkedonk… I lied about the butt thing too ;)

Thanks to Ajay Karat for lending me his rock and fire art for the trajectory sample above.

Super Mario Crossover

One of the articles I’ve got queued up to write is “The Physics of Mario”, which will be a look at the the way Mario moves, because there’s something about it that’s really unique and charming. He can perform a shallow jump, run into a long high jump and then parlay that momentum into a duck-slide to avoid an enemy. He can change direction in mid air or bounce nimbly from enemy to enemy without ever touching the ground. Mario’s variety of abilities truly makes you feel like you’re in control of a superhero. How great does it feel when you put on the air brakes and narrowly avoid that Koopa Troopa and grab the mushroom, all in one fell swoop?

<———————— this great, that’s how ————————>

Besides giving you a quality range of motion, the slightly slippery physics of Mario entice you to play the game with bravado, instead of the heavy-footed careful stepping you have to do as Simon in Castlevania. Don’t get me wrong, Castlevania is a great game but for very different reasons than Super Mario Bros.

Great, Nintendo ass-kissing…what good is this article going to do me?
Well, as I discussed in my first article The Difference Between Tetris and “tetris” and then revisited in Tips for Making a Successful Game Clone it’s very difficult to clone something as well known as Super Mario Bros., Tetris and other staples from video gaming history. You’re working with a well known property and thus expectations are high and opinions can run hot. This article is about someone who got it right.

Where most Mario clones fall short is Mario’s movement system, the physics of Mario. Mario has been copied dozens of times by the Flash gaming community (here are a few Flash Mario clones) but most of them just don’t feel right. Most of them don’t give you the ability to vary the height of Mario’s jump, because it’s easier to set a constant jump height than worry about tracking how long the user holds down the jump key. Many Mario clones will jump again if you land while still holding the jump key, which can be really annoying. This can have you hopping around like a rabbit against your will… and that’s no good. And rarer still is the Mario clone that allows you to vary your jump height based on Mario’s run speed.

Besides the physics of Mario, there are other little touches that can be easily missed:

  • The speed at which Mario rebounds off the top of an enemy or the bottom of a coin block
  • Piranha plants won’t come out of a pipe while Mario is standing next to it
  • At the right speed, Mario can run over small gaps without falling.
  • The game “pauses” when mario collects a mushroom

There are many things that have to be there in order for the clone to feel like the classic we all know and love. Sure, I ran into a few bugs…the floor was missing from one level leaving me to fall immediately to my doom, I had a few shells pass through Mario without killing him and I found it extremely odd that the run and jump buttons were reversed…but all in all Super Mario Crossover is an EXTREMELY well done clone of Mario.

The jumping, sliding and acceleration of Mario feel almost perfect. As far as I could tell the secret mushrooms and warps were all there. I even saw a mushroom jump over a small gap as they sometimes did in the original. It’s just really great to see a clone of Mario that does justice to the original. I was able to enjoy this game because I didn’t find myself yanked out of a familiar experience by something that just felt “off”. That came out snobby…I wish I was writing this with a tool that allowed me to edit my words before sending them out into the world…*sigh*.

What’s really neat about this clone, is that it’s not a clone at all. I used the term “clone” in Tips for Making a Successful Game Clone and caught a little flack for it…but in a constructive way. It was suggested to me by I-smel of Newgrounds that the term “clone” was misleading. He and others, like Luis, went into the article expecting that I was advocating unoriginality, when in fact I was exploring the challenges and benefits of having to work from an existing and familiar concept. Two of the tips I gave in that article were:

  • Play the original…ie know every detail of what you’re building
  • Have a hook…make your game different enough that users aren’t just left wishing they were playing the original

Super Mario Crossover lets you play through Super Mario Bros. in its entirety, with the option to play as Mario, Bill R. (Contra), Samus (Metroid), Mega Man (um…Mega Man), Simon (Castlevania) and Link (if you don’t know this one I’m not going to tell you…also I hate you). Each brings his (or her…sorry Samus) own control scheme, weapons and powerup hierarchy to the experience. And in most cases, each new character moves and feels much like they did in their original game, with the exception of Simon who learned how to double jump since we first saw him. This is a great addition, which falls under one of my other tips: take the opportunity to fix things from the original that frustrated you…let’s be honest, Castlevania was great but the movement was a bit irritating in that game.

It’s never been my intention for this site to be a game review site, there’s enough game review sites and users on them that there’s no shortage of opinion on the net. It’s been my intention to get people to think more deeply about creating great games and what it takes to do that. I’m not the greatest game designer nor the greatest programmer in the world, but I do feel that I’m entrenched in that world enough that I’ve got something useful to pump back into the community, be it tips, code snippets or just articles that spurn discussion and thought. I hope that some of what I put up on this site is useful to aspiring and seasoned game developers alike.

Super Mario Crossover and this article can do a bit to help people think about how difficult it really is to nail a clone of a classic game. But mostly I just wanted to take a moment to appreciate what an amazing job Jay Pavlina did with Super Mario Crossover. He had a great concept, he nailed the mechanics and as a result the glowing reviews are pouring in. Congratulations, Jay, on your success. I’m very excited to see what you do in the future.

Tips for Building a Successful Game Clone

Many times in my career as a game developer I’ve heard the phrase, “how tough would it be to build our own version of this game…?”. I’ve found myself in this situation for many different reasons. Sometimes it’s driven by a client’s desire to have their own version of a specific game. Sometimes it’s a choice my company has made in order to deliver something of high quality at a low cost to our client. And sometimes I just can’t help but challenge myself to code something neat I saw or put my spin on a game I’ve grown to love.

Whatever the case may be, it’s not unusual to wind up with the task of emulating or building on the concept of an existing game. This is especially true in the casual games space. If I see one more match 3 game I’m going to swap a bullet for my brain and hope for a big combo bonus. But since there are many reasons (all very different) you might rebuild or rework someone else’s game, I’ll hold my opinions regarding when this is appropriate and just talk about what happens once you’ve arrived at the decision to do so. In the interest of opening up on a positive note, let’s start by talking about some of the advantages.

Advantages of Working from Someone Else’s Game

  • Clients are typically not very good at visualizing a concept. Having a working version of what you’re proposing helps speed the pitch and pre-production process along considerably, which will save you time and money.

    YOU: “It’ll be a lot like this game, but with your characters instead of Mario…”
    CLIENT: “Super. Here’s a small shed filled with twenties. Quit your day job and don’t disappoint me.”
    YOU: “Wow, that was easy.” ;)
  • Having a clear picture of the final product from the start makes it much easier to estimate how long it will take you to program. Original ideas tend to evolve more than clones, because you often don’t know how a game will feel until you play it. Refining a game on the fly costs you money in the form of time. Accurate estimates usually mean higher profit margins.
  • Hopefully the game you’ve chosen to emulate has already proven to be fun, which can make it easier to sell the client on it. And more often than not, clients come to the table with a game they like and want to duplicate or build upon.

    CLIENT: “Have you played this, my kids love it!”
    YOU: “Really, your kids love Turbo Tax for the iPhone. Really? reeeealllly?”
    CLIENT: “As it turns out the closest thing I’ve ever come to playing a game is editing an excel spreadsheet. But let’s go with my game concept anyway. You only live, eat and breathe games. Here’s a dollar. Make me a version of Halo I can play on my watch.”
    YOU: “I’m going to pee in your coffee when you leave the room.”

    Just make sure the game you or your client choses to emulate is within scope and isn’t a piece of garbage.

Disadvantages of Working from Someone Else’s Game
Unfortunately, these advantages come with trade-offs. As I discussed in my article, The Difference Between Tetris and “tetris”, emulating a classic is an uphill battle. If you know the game, it’s likely other gamers will too. That means as soon as they figure out who you borrowed your idea from they’ll start comparing you to the original. If your game doesn’t hold up, you’re in trouble. On top of being compared to your game’s predecessors, you open yourself up to angry users who might take exception to your tampering with a game they know and love. And by opting out of an all-together original idea your game enters the world as a follower rather than a leader or an innovator. The good news is that if you’re smart about it these disadvantages can work in your favor.

Tips that might help your clone, tribute or adaptation to be a success:

  • Play the original. Beat the original. Learn the original top to bottom and then make sure you at the very least get the game mechanics right. People familiar with the original will have expectations, meet them and then some. If you make a Super Mario Bros. clone and don’t give the user a run button your users are going to be pissed, get frustrated and give up on your game.
  • Figure out what frustrates you about the original. This is your opportunity to fine tune some of the things that might have made the original clunky or frustrating. Super Mario Bros. was great, but not all first runs are that well polished and even that game wasn’t perfect. If you’re copying a that didn’t allow you to restart levels as quickly as you wanted to, make sure yours does it better. Improve where there’s room for it, emulate what you loved.
  • Give credit where credit is due. Gamers (and developers) appreciate a nod to the creators. It shows that you’re not trying to pass a concept off as your own, which is endearing and comforting. If you’re making a web game you’ll want to do everything you can to avoid the wrath of angry forum kiddies itching to flame content thieves. Plus it’s just plain respectful to give thanks to those who came before you. Do the right thing :)
  • Gamers are a fun crowd with a sense of humor. If you can be funny and down to earth about the ideas you’re borrowing you’ll find that your game will get a much better reception. Making a game very similar to Super Mario Bros? Have the rescued princess ask you where Mario is and have your hero respond “he’s out on a call, Koopa clogged his toilet…again”. Gamers love references, easter eggs and other quirky inside jokes.
  • If you’re making more than just a clone, have a hook. Make your version unique enough that it feels like its own game. I LOVE orange juice and I like vodka. When I have a screwdriver I usually just end up wishing it was orange juice and move on to a gin and tonic (keep your groans to yourself, Jack and Coke lemmings). If your version is only slightly different than the original, people are going to wish they were playing the original and resent yours. You need to add more than one new piece to your Tetris game in order to make people want to play yours instead of the original. Maybe you let your users rewind the game (a-la Braid) so they don’t have to live with their ill-fated decision to wait for that straight piece. What if the entire board, along with the gravity, could be rotated 90 degress? These kinds of changes maintain the mechanics of Tetris but create opportunities for completely different strategies to emerge.
  • Be smart about who you choose to emulate. It’s probably not a good idea to take on EA Sports’ Madden series. Sometimes choosing a game to emulate also means you’re choosing an opponent. If it ends up that’s what you’re doing, pick a fight you can win or at least survive. If you can’t win, can you benefit from associating yourself with the right competition…which brings me to my next point.
  • Recognize the power of generics. Drug companies know the power of this approach. They know that X number of people will always buy their name brand drugs, even though the cheaper generics are literally the same as the name brand. By selling the Walgreens brand (which is often actually made by the same company that makes the name brand and is then packaged by Walgreens) drug companies accept the fact that making a fraction of their name brand’s retail value on a generic is better than making nothing at all. So what does this have to do with games? Farmville has upwards of 80 million active monthly users. If you create a Farmville clone and expect to earn the same numbers, you’re probably setting yourself up for failure. Whether your game is better or not you’re starting 80 million users behind (is an iPod really that much better than other mp3 players?…maybe but their head start has served Apple pretty darn well.) If you instead create a Farmville clone with the expectation that you’ll get a 10% runoff from them, there’s nothing wrong with enjoying the still impressive revenue you can earn on 8 million active monthly users. The question then becomes not, “how can I do exactly what Farmville does so I can have 80 million active monthly users?” rather, “what generic version of Farmville can I offer that appeals to people who aren’t ready for Farmville but might be interested in my game/app.” (This of course assumes that you’re not trying to be better than Farmville, which is most admirable approach, but that isn’t the subject of this article) There’s nothing wrong with creating a game that feels like a widely successful game with the intention of taping into the gaming market equivalent of “swing voters”.

Certainly I’m not suggesting that it’s a good idea to go out and poach other people’s ideas. But from time to time, for whatever reason, this becomes our reality. Whether it’s our own idea, our boss’s idea or the client’s you might find yourself in that situation. When you do it’s worth your time to think about how you can use it to your advantage and what things you can do to help make it a success.

I suppose in a lot of ways this article strays from the spirit of this site, which is about making great games. Much of what’s in this article touches on the business/marketing side of making games, which isn’t really what the site is supposed to be about. As much as I’d love to just hole myself up in a room somewhere and just make great games, that isn’t always the reality of my job, though some of it is and I’m thankful for that. Regardless, repurposing games and emulating successes has been a hot subject lately so I thought I’d put some of my thoughts in writing. It’s certainly more relevant than an AT-AT made out of bacon ;)

UPDATE – 4.30.2010 – For a perfect example of someone rebuilding a game as a learning experience, read this interview with Jay Pavlina about Super Mario Crossover or my article about what makes Super Mario Crossover so impressive.

Olderposts Newerposts

Copyright © 2024 Bacon and Games

Theme by Anders NorenUp ↑