Tag Archives: beginner

Game Development 101, Part 2

Can’t wait to get started on developing apps and games for Windows 8? I know, me too!! To help you get started, sign up for 30 to Launch to get tips and tricks in your inbox that will help you take your app from idea to in-store.

This is the second post in a series that goes over some basics of game development. While this series is targeted at beginners, you’ll find yourself going through these motions for every game you create. I hope you find something useful and are able to finish with a better understanding of game development. Don’t miss Part 0 and Part 1 of this series!

In this post I’m going to talk about the Game Loop. When you start programming your game the first thing you need to create is your game loop. The game loop is what makes your game run! All games, from the simple to complex, have a game loop that runs continuously. The game loop has a core set of methods that allow it to do all sort of useful and necessary things for your games. Here’s what they are and what they do.

Initialize

In this method, you will start any required services and non-asset resources. For example, if you plan on using random numbers in your game, that initialization statement would go here. If you need to connect to a web service or a network, that should be done here as well. Initialize is called before any other method in the game loop is called, so the time is takes to execute this code will be perceived as a delay by the player. This method is called once.

Load

You’ll load all the things you need for your game in the Load method. If you want your game to have a background, you’ll point to your background asset here. If your game to have character sprites, you’ll point to those asset files here. If you want sound, you’ll tell your game where to find the sound files in the Load method. You get the idea. Everything that you want to appear in your game (textures, sprites, fonts, 3D models, sound) you will load in this part of the game loop. This method is called once.

Update

This is where lots of fun magic happens! All of the player and game interaction happens in Update. If a character is moving, it happens in Update. If you need collision detection, it happens in Update. If there is an explosion, guess where it happens? Update! All of your player input is also dealt with in Update. Just because all this stuff happens in Update doesn’t mean the code has to long and messy. Use those object-oriented programming skills and create methods that you can call from Update. For example, you might have a method called UpdateEnemies that is called from Update to move the enemies across the screen, check for collisions or even play a sound effect. Update is called multiple times per second, the exact number depends on the frame rate of the display device.

Draw

Just like Update, lots of magic stuff happens in Draw! Draw uses the textures and sprites that you defined in Load and the object information from Update to display all the visual parts of your game on the screen. Draw and Update word closely together to make the changes to game (movement, explosions, etc.) look seamless. Draw is called multiple times per second, the exact number depends on the frame rate of the display device.

Example: Monopoly

While this is a non-digital example, it helps to illustrate that all games go through the game loop. This loop hold true for your favorite digital game as well whether it’s popping balloons or shooting zombies.

Initialize

We’re getting our non-asset resources ready. In this case, we’re going to start our multi-player network. For Monopoly, this means we’re going to gather the family around the kitchen table.

Load

This is where we get all of our game assets ready. Is the game board here? Check. Is the money here? Check. Are the game pieces here, including the thimble? Check. And so on until we know the location of all of the things we’ll need to play Monopoly.

Update and Draw

Just like the game you’ll develop, Update and Draw happen multiple times per turn in Monopoly. In any given turn a player may roll dice (Update) and move their game piece (Draw), buy a property (Update) and put a house on it (Draw) or draw a Chance card (Update) and go to jail (Draw) along with a number of other actions a player can take.

 

Hopefully you’ve been able to learn a little something about game development. Want to know more? Let me know what you want to see next in the comments! Don’t forget, you can get started on building games and apps for Windows 8 with 30 to Launch. Sign up today!

Game Development 101, Part 1

Can’t wait to get started on developing apps and games for Windows 8? I know, me too!! To help you get started, sign up for 30 to Launch to get tips and tricks in your inbox that will help you take your app from idea to in-store.

In this series, I’m going to go over some basics of game development. While this series is targeted at beginners, you’ll find yourself going through these motions for every game you create. I hope you find something useful and happy developing! UPDATE: Go back and read Part 0 or move forward and read Part 2!

Game development is an industry that involves tons of different areas. Programmers to MBAs can find a place in the video game industry. If you’re starting out with game development, things generally fall into three categories:

  • Planning & designing
  • Programming & testing
  • Asset creation: art & sound

As this is Part 1 for Game Development 101, I’m going to focus on the Planning part of game development. The very first thing you need to get started with game development is an idea. Based on this idea, you’ll want to create some game design documents that will help guide the game as it gets further into development. These documents will be used to express the vision of your game to others, such as developers or designers. It’s best to put as much detail into these documents as you can, however they are living documents and you should update them as necessary.

While you can have as many documents as you need to describe your game with what ever titles fit best, you should think about including three core documents:

  • Storyboard: This is where you draw out what you want your game to look like. Storyboards can be complex and detailed or simple. In the story board you can map out how you want a level to look or character design. Check out these examples of storyboards. Think you don’t need to storyboard? Pixar storyboards games!
  • Game summary: This where you describe you game, its objective, the story and other details that might not have fit into the Storyboard.
  • Flow chart (great for simple gameplay, like Rock Paper Scissors Lizard Spock): This is where you map out the interactions and game updates for game play. Here are two examples of flow charts that have been made for games. By using a flow chart, you can map out all the player’s decisions and it can help you decide where to put things like sound effects, animations or help screens.

db2e_lizard_spock

These documents should outline and describe your game in such a way that someone else would have a pretty good idea of what your vision is for the game. The documents should cover the core objectives of the game and talk about features of the game & implementations. They should also cover things like characters, enemies, levels, music & sound effects, dialog, player interactions, user input, etc. When you’re done with creating your planning and design documents, you should have at least answered the following questions:

  • What kind of game is it?
  • What is the game objective?
  • What are the game play elements?
  • What are the engineering elements?
  • What art assets will you need?

Now you should have a pretty good idea of what exactly is needed to create your game. Art assets, sound effects, transitions, animations and more should all be referenced in your design documents. Taking the time to plan out your game can show you where you are missing documentation and it can save you time later in the game development process.

Stay tuned for the next Game Development 101: Part 2 where I talk about the game loop.

Game Development 101, Glossary (Part 0)

Can’t wait to get started on developing apps and games for Windows 8? I know, me too!! To help you get started, sign up for 30 to Launch to get tips and tricks in your inbox that will help you take your app from idea to in-store.

This is the “getting ready” post for a short series, Game Development 101. In this series, I’m going to go over some basics of game development. Since this series is targeted at beginners a good place to start is a small glossary. UPDATE: Read Part 1 and Part 2!

If you’re new to game development, you’ve probably heard some of the terminology thrown around and wondered what it meant. Here’s a list of some common terms that you’ll run into game design. Some of them are obvious, like Sounds, others you might not have heard of before, like Sprite (not a lemon-lime carbonated beverage). While this isn’t a complete glossary, it is something that can get you started. If you come across something you don’t know, you can try a search for “what is _____ in game development” or by searching for a more complete “game development glossary.”

 

Glossary of (some) Terms

AI: the logic that is used to determine the computer’s decision.

Assets: Including images, sound effects, fonts, 3D models and textures, these are any external pieces of content you’ll be importing into your game.

Collision Detection: Detecting an intersection between one or more objects in your game. Player & enemy, enemy & weapon, player & wall, etc. Boundary collision detection is done by putting a rectangle around game objects and checking if the rectangles intersect. This isn’t always exact due to different shaped objects in your game. Pixel perfect collision detection can make boundary collision detection more exact by checking the pixels involved in the rectangle intersection. This is an expensive operation for your game so don’t check more pixels than you have to!

Game Engine: An engine is a system designed to for the creation and development of games. An engine allows for reuse by letting the developer use different art and data sets. You can use a game engine that’s already available or build your own.

Game Loop: This is what makes your game run. The game loop run continuously, updating your game based on player input and drawing the changes to the display. If you use a game engine, the game loop might be provided for you. It consists of the core methods: load, initialize, update and draw. For more information check out Game Development 101: Part 2.

Game State: All the information that defines an object at a particular time. This covers everything from where an object is positioned to whether a gamepad button is being pressed. Often you’ll compare one state to another and take some action based on the result, such as firing a weapon when the space bar is pressed and released.

NPC: Non-Player Character. This is a character that is not controlled by the person playing the game. This often refers to character that the player talks to as part of the story in the game.

Player Input: A game has to have a way to take player input. This can be from the keyboard, a game controller, mouse, pen, touch or even audio commands. If you port games from one platform to another, you may have to update how to accept player input based on hardware form factors.

Sounds: Of course you know what sounds are, but having sounds and audio are an important part of a game. Sound effects, background music, level music, battle music, etc. are all great ways to give the player a more immersive game experience.

Sprite: Several 2D graphics images of one object or character for each of it’s possible positions and states. The game engine displays the correct image based on the object’s or character’s position.

Texture: Images that are loaded into your game. Textures are used for backgrounds, enemy images, bullet images, etc.

Vector: A vector is a set of two or more numbers, often used to indicate a position (on an imaginary grid) or a direction. A two-component vector can be used to for two-dimensional space: (x,y); a three-component vector can be used for three-dimensional space (x,y,z); and so on. You might use a vector to define the location of a character on screen and you would update the vector value to reflect movement.