Interesting things..?

Making games fun

Now that I've stooped to dispensing punditry (see the previous post!) here are some tips from Advanced Game Design with Flash for making games fun to play.

1. Make your game responsive: For every action, have a reaction. If a player collects objects or bumps into something, make a burst of color and play a sound. Our real world is like this. Accelerate too fast, and your tires squeal. Bump your head, and you see stars. Why should games be any different?

Giving players multi-sensory tactile information about the game world adds a sense of immersion. Players feel that they're inhabiting and interacting with a parallel universe inside the game. That wondrous sense of escape into an alternate reality is part of what makes games so enjoyable to play.

Responsive feedback from the game, like flashes of color or bursts of sound, will instruct players about how to play the game while they're playing it. Get this right, and you won't need rules or instructions.

2. Yes, simpler really is more fun: Fun doesn't need to be complex or difficult. Watch a kitten playing with a ball of string. Watch most human beings for most of human history play with a ball and a flat surface. Find an amusing interactive toy to play with, like a circle bouncing off a square, and build a game around it.

This applies to your user interface, too. Use logical keys for game actions, and use the mouse or touch as input wherever you can. The less time players spend figuring out how to play your game, the more time they will have to enjoy playing it.

Players decide within the first few seconds whether or not they like your game. There's a lot of competition out there, so pull them in right away and keep them playing.

3. Have a goal: Players like challenges. They like to have a clear goal and then fail to achieve it. Let them play again to see if they can learn from their mistakes. For some strange reason, this makes humans happy! Having a goal is what turns a toy into a game.

Your goal can be anything you dream up. Find the exit, save the princess, get a high score, find the right pattern, make an interesting object, or just try to survive to the end of the game. But whatever it is, make sure that everything in your game reminds players what that goal is and nudges them toward achieving it.

That means that if the players do something wrong, tell them! Sound an alarm, create an explosion, or shake them about. If they do something right, make happy sounds, shower them with bright flower petals, or give them some flashing bonus points. Your game world can direct the player into succeeding with the right combination of positive and negative feedback.

4. Give them little victories: As a child, I was mortified by a story my dad told me. He was watching my sister and I play Super Mario World. "Ah yes, just like rats!" he said.

"What?" I asked in a hyper-focused, mid-level, bleary-eyed stammer.

"If rats press a lever, and they get food," he explained, "the rats will keep pressing that lever endlessly, even if they get fed only once in every 100 attempts."

He was right. I had played that level countless times, but I kept falling off a ledge somewhere in the middle. (It was the infamously difficult level, Tubular. Even to this day, it's heart-stopping!) What kept me going was that I was able to succeed at collecting little coins and stars, and stomping on easy enemies along the way. The fact that I kept falling off that ledge at a critical point didn't matter. I knew I could win, even if I wasn't winning right now. The buzz of my little victories kept me going.

My dad, a psychologist, was referring to a well-known phenomenon described by B.F. Skinner called intermittent reinforcement. It's the crack cocaine of human survival. But unlike crack cocaine, it's free and legal. Use it in your games whenever you can! Reward players for completing small, easy tasks, and they'll approach the more difficult tasks with compulsive abandon. If they know they can succeed eventually, they'll keep pressing that lever over and over again.

5. Involve the player in creating and modifying the game world: Games with the greatest replay value are those that allow players to contribute something to the game world. Players' actions can interactively change the shape of the game level, or modify the goal. Players can be given a choice of multiple strategies to reach the goal, each with differing outcomes. Let players make something, uniquely on their own, that they can use in the game.

6. Wind them up and let them loose: Program the enemy AI with simple rules so that they interact with the game world in a specific way. If the game world changes in unexpected ways, the AI should be able to adapt to those changes in equally unexpected ways. This makes the AI seem like intelligent living creatures and adds to the sense of immersion.

Keep an eye these game design features: once you start looking you'll find them everywhere, from Angry Birds to Skyrim.

Advice for programmers?

I was recently asked to provide some advice for programming students just starting out on a professional career.

Me, give advice??

Oh my.

That got me thinking!

How about: "Throw everything against the wall and see what sticks. If you're not dead or seriously injured/hospitalized by the end of it, you'll know you've succeeded."

That strategy has worked for me countless times. But, somehow, I did not think I could in good faith burden the impressionable youth of tomorrow with such a heavy personal responsibility, however much fun it may be. So I thought about it some more, and realized I should maybe try to be a little more helpful. So, here goes!

1. Only work on projects that you really love doing, without compromise. If you're bored with a project, drop it and start working on something that makes you happy. If you're inspired by the work you do, it becomes self-motivating. You'll eventually get better at it than anyone else, and other people will notice. That will result in great original games and applications that no one else has thought of.

2. Don't copy anyone else's ideas or work, and don't try and make your work look like something that's already successful. The easiest way for your product to thrive in an extremely competitive industry if it's a totally original concept that no one has thought of before. And the worst thing you can do is tell yourself that this isn't true, and that all the good ideas have already have been thought of. Interactive media is a totally new medium, and the games and applications being produced today will look totally different from those being produced 10 years from now. The best ideas just have not been thought of yet, so there's huge opportunity for fresh ideas to take root. This is especially important for people just trying to break into the industry. Make one really, really cool, unique product. Keep it simple, put your heart into it, and shop it around. People will remember it, and they'll remember you.

3. I haven't yet met anyone who was totally dedicated to their goals who failed to achieve them. But I've known lots and lots of people who gave up, and thus created their own failure. And the worst part is, those who give up, never actually do so consciously. They just slowly start doing other things, and over months or years stop doing what they really love. Succeeding at what you love doing can take a lot of time, and be extremely difficult, and often it feels like you're banging your head against a brick wall. But remember that you're always making tiny, imperceptible little dents in that wall, and eventually it will give way. Just stick doggedly to what you believe in and what you love doing, and you will succeed at it. I've seen this happen over and over again.

4. Here's something more practical: Try and work on lots of little projects that you can finish quickly, rather than one big one. If you can write a game or application in 10 days or less, that's optimal. Start with small, simple games and apps, and go from there.The reason for this is because programmers suffer from an extremely high burn-out rate. If you work on a project that takes months and months to finish, chances are it will drain you of any will to work on it further and be left incomplete.

5. Remember that the product you're making is always the most important thing, not the technology behind it. Think about what you want to make, and then find the best tools for the job. It could be Flash, Objective C or HTML5. You're going to need to be very flexible and have a whole set of different skills in your back pocket to help you survive in a very quickly changing marketplace.

6. This one may seem really silly, but it's extremely important and most programmers I know completely forget about it: get some fresh air and enough sleep! Computer programming, which involves sitting motionless while staring at a glowing rectangle for 10 hours a day, is one of the unhealthiest things you can ever do. Your brain needs oxygen, and the best way to feed it is by dedicating about an hour day to real cardio-vascular exercise: biking, running or swimming. You'll find that the time you put into doing this is payed for because you'll become much more productive at your work. You'll program faster and solve problems more quickly because you've got more oxygen. And sleep is just as important. 10 hours a day is nice. Especially if you're working for yourself, you don't need to be constrained by an artificial 9-5 schedule, so throw your alarm clock out the window and just wake and go to sleep up naturally, whenever you feel like it. You'll have much more energy, won't suffer from fatigue or be dependent on coffee. Plus, all programmers know that 3am is the witching hour for writing voodoo code, and you can meet all kinds of really interesting people at 24 hour supermarkets that time of night.

Hint: if you do have the misfortune to be stuck in a 9-5 job, and your employer balks at letting you sleep till noon every day, just tell them you suffer from "diurnal arrthymia" (all of humanity suffers from this!) and find a doctor who will diagnose this for you if you have to.

"There is no hope for a civilization which starts each day to the sound of an alarm" -Author Unknown.

Dear readers, I truely have no idea at all whether this is good advice or not. But, after I'd written it I actually thought it sounded like advice I might like to follow myself. I'm going to try.

Foundation Game Design with ActionScript 3.0

The long-awaited second edition to Foundation Game Design with Flash is finally finished! It's called "Foundation Game Design with ActionScript 3.0", and you can find it here. The entire text and code have been re-written from scratch, so it's a completely new book. It's is full of new examples, new games, and many reader requests from the first edition.

I've written it to be "platform neutral" which means that all you need is a plain text editor to program your games - you don't need Flash Professional or any other expensive software. The first chapter introduces how to use Flash Builder to make your games, but the code and examples will work not matter which development platform you're using: Flash Professional, Flash Develop, TextMate, NotePad or anything else. In addition is a full chapter on how to use Photoshop and Illustrator to make game graphics, and how to import and use those graphics in your games.

Buy Foundation Game Design with AS3.0 at Amazon

A better A-Star

Thanks to reader Zhan for this improvement to the A* algorithm in Advanced Game Design with Flash. He found some maps where the A* algorithm doesn't skip diagonal paths around corners as expected. Here's the code from the book on page 685 that routes the path around corners:

if(nodeMap[testRow][testColumn].id != centerNode.id
&& map[testRow][testColumn] != wall
&& map[testRow][centerNode.column] != wall
&& map[centerNode.row][testColumn] != wall)
{

He made this change to the code:

for(var column:int = -1; column < 2; column++)
{
  for(var row:int = -1; row < 2; row++)
  {
    if (Math.Abs(col) + Math.Abs(row) == 2)
    {
      continue;
    }

It now seems to work for all map types. Thanks Zhan!

Books

Foundation Game Design with ActionScript 3.0

Advanced Game Design

Foundation Game Design with Flash

Communicate

  • Kittykatattack.com makes games and game engines for all platforms. We're currently working on an autonomous, evolutionary, self-replicating storytelling engine for RPG and adventure games based on multi-celluar string theory. Contact info@kittykatattack.com for details.