Game Programming

Game programming is the software development of video games. Game programming requires substantial skill in software engineering as well as specialization in simulation, computer graphics, artificial intelligence, physics, audio programming, and input. Like other software, game development programs are generated from source code to the actual program by a compiler. Source code can be developed with almost any text editor, but most professional game programmers use a full integrated development environment (IDE).

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.

Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris.

Well, a long time ago, in a galaxy far far away, I was a highly-skilled Tetris player. When I was 18 I worked as DJ in a disco-pub at my hometown. There was a Tetris gaming machine, and I spent hours and hours playing on it. Many nights I saw the blocks falling every time I went to bed and closed my eyes.

It rained some since then, but I still believe that Tetris is one of the best videogames ever made.

In 2000, I developed a Tetris ActiveX control for the Planet Source Code site using Visual Basic 6.0. With that control I won some prize in the Planet Source Code monthly contest (some software pack, I don't remember well). You can still see the page (and download the ActiveX control and its source code) here.

Now I think the time has come to write a .Net version, so this article presents to you the TetrisBox class: a Vb.net class extremely useful to create highly customizable Tetris games in .Net Winforms environments.

The logic under the TetrisBox Class

The TetrisBox class inherits from the System.Windows.Forms.PictureBox control, as it is basically a drawing surface. All the drawing work is done in the overwritten OnPaint method. Because the …

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough. To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer.” Despite the humor of their conversation, he pegged the nature of AI. Turn anything into a simple yes or no answer. A simple AI, might be, “If player is to the left, move the enemy ship to the left” which is a very simple AI for interception or chase, but it is not a learning AI. A learning AI must have the ability to decide to go right for reasons it was not specifically programmed for in the first place.

A learning AI is highly important for ensuring that non-player characters (NPCs) will have more interactive choices for the players, without requiring developers or AI designers to program AI for each possible option combination in the game. (A game with 10 spells, 10 items and 10 effects would be 10*10*10 combinations, or 1000 combinations to be programmed for.)

To cover the AI, I’ll discuss two different types of learning AI, reactionary and meditative.

Reactionary Learning

Reactionary is where the game learns immediately. It must still depend on pre-programmed choices, but those choices can depend on historical data. I.E. In Mortal Combat, let’s say the player keeps winning with one particular move when …

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain. A* is a particularly easy way to approach it. I’ll start with the algorithm in general, and then give a few valuable upgrades and how to apply them.

Finding the first route (there are 2)

To begin with, let's take a look at a possible game map:

White indicates spaces we can travel in. Blue represents Water, and that we cannot cross it. Red represents our target (B6). Finally, our starting place is at Green (E5). I’m also going to say that the NPC can move horizontally, vertically and diagonally.

Next, we start with two Arrays/Lists to manage the creation of the path. These lists will contain Grid Positions, which I will call “Tiles”:

1) Possible Moves List – This lists all the possible moves the character can make. It is not filled with all the white spaces on the map at the beginning, but gets filled over time.

2) Attempted Moves List – This is a list of possible moves that we have considered.

Initialize your list by adding the starting Tile to the Possible Moves List.

Process Loop Part 1 of 2:

1) Get the Tile from the Possible Moves List that is closest to the target.

1. What is RenderMan

RenderMan is a not any particular piece of software.
RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of the Renderman standard, but not the only one. RenderMan-compliant sofware uses REYES rendering algorithm, RIB format for scene description, and RSL for shader writing.

3. What is RSL

RSL is RenderMan Shading Language. It is a programming language, somewhat similar to C, but simplified and with a functionality limited mainly to processing shading, displacement, and light information. A simplest RSL surface shader might be:

Game Programming

Game programming is the software development of video games. Game programming requires substantial skill in software engineering as well as specialization in simulation, computer graphics, artificial intelligence, physics, audio programming, and input. Like other software, game development programs are generated from source code to the actual program by a compiler. Source code can be developed with almost any text editor, but most professional game programmers use a full integrated development environment (IDE).