The Exploration and Composition Elements E-mail
Written by Adam Wannamaker   

The Game Basic 3D™ Engine is now one of the most technologically advanced 3D rendering engines available today for Visual Basic supported by any Microsoft Windows platforms apart from version 3.1 and below.

Video games are nothing more than ingenious, entertaining, and highly interactive computer programs. In the implementation, emphasis is given to using best practices and highly optimized programming techniques. Though the final design must be geared towards entertainment value while still maintaining high standards. This is a difficult proposition at best, and an impossible task at worst.

To help prepare you for the endgame, technically speaking; I am going to discuss the history from where this industry evolved, and teach you some basic game design practices.

This chapter will cover the following major topics:

1. History of the Video Games Industry
2. Designing Different Types of Games
3. Brainstorming Designs and Storyboards
4. The Components of a Basic Video Game Pipeline

History of the Video Game Industry

I can’t resist taking a few minutes to reminisce, because there is a great deal of history to talk about. However it all began at some point in the 1960s when the first mainframe computers came to be. The video game industry might be considered by-product of the computer game industry since computers games actually predate the first video game Pong.

Conversely the first computer game was called Spacewar, written on one of the first computers called the DEC-PDP-1 with a classic round monitor by Marvin Minsky, founder of the AI lab at MIT. However even by today’s standards, Spacewar was a pretty cool game, with realistic propulsion based on inertia and gravity that caused the ships to drag toward a star at the center of the screen. In typical fashion, other students helped to improve the game Minsky wrote, adding hyperspace and explosions to the game.

When early personal computers such as the Commodore and Apple II hit the market, hobbyists soon realized that they could make their own games. Eventually these early hobbyists realized there was a market behind this scene, and started the first computer game development companies. Sierra, Activision, and Electronic Arts are all good examples.

Once true 3-D hit the scene, and everything in the game became a polygon, the computer industry transformed, in my opinion, from a game industry into an Entertainment industry, Of course this pushed 3D accelerated hardware to a whole new level and is now the main reason computer and video game industries have come together.

The largest game developers now produce both computer, and console games. The software development kits have become profoundly efficient, and console accessories now include the keyboard and mouse.

Designing Different Types of Games

One of the hardest things about writing video games is designing them. Sure! 3D mathematics are difficult, but! thinking of a brilliant game and design is just as difficult.

These days, there are probably just as many games as political promises, but considering the amount that are actually made you can easily bunch them into a handful of genres:

First Person Shooting Games

These games are completely 3D, for the most part, and viewed from your character’s perspective. Doom, Hexen, and Quake are all good examples of first person shooters. Technologically, they’re probably the most difficult to develop, and they require cutting-edge technology to be noticed.

Sport Simulation Games

Sports games are either 2D or 3D, but! these days more, and more have approached the 3D terminology. In any case, the sport can be one-man or team play. The graphics in sports games are usually not as impressive as first-person games, but have come along way. However the artificial intelligence seen in most sports games is some of the most advanced of all the game genres.

Fighting Games

Fighting games are typically played by one or two players, and the action is viewed from the side or a 3D floating camera. The game imagery can be 2D, 2.5D (multiple 2D bitmap images of 3D objects), or completely 3D. Unfortunately fighting games aren’t as popular on the PC, probably due to the interface problems with the controllers, and the two player fun factor.

Arcade/Platform Games

These games are your typical Asteroids, Pac Man, Snake material. They’re basically old-school games that are primarily, however they’re being redefined and remade into 3D worlds. However the game-play is relatively the same, and just as addictive.

Role Playing/Strategy Games

These games have splintered into a number of sub genres over the years, but! suffice it to say we’re talking about strategy turn-based; thinking types of games such as Diablo, Final Fantasy, Warcraft. And again, I’m being a little cavalier considering Diablo, and Warcraft are real-time, but both still involve a great deal of strategy, and thinking. On the other hand Final Fantasy is turn-based and not real-time.

Interactive Story Games

This category includes Adventures of Monkey Island, and Myst. Basically these are games that are prerendered or on a track, and you move through the game by figuring out puzzles. Usually, these games don’t allow free roaming, and are like playing interactive books, for lack of a better definition.

Puzzle/Board Games

There’s not much to say here, these games can be 2D, 3D, prerendered, etc… Tetris, Monopoly, and Mahjong are a few games that fall into this category.

Brainstorming Designs and Storyboards

Large corporations conduct feasibility studies before signing on the dotted line for a new software development project. In similar fashion, you should at the very least brainstorm, and make a list of every idea you can come up with before starting to work on one.

When you start to design a game, remember to keep it simple and intuitive. The simple part means you design a game with only few variables or conditions. The intuitive part means that the game requires only a few commands or controls to learn. You can apply this recipe to just about any type of game, and if executed well, it will be successful.

It is a common misconception that game development  “just sort of happens”, rather than being planned in advance. While this may initially seem like a ridiculous idea, it has been my experience that is often what happens with any game development project. An important piece of code is completed, and rather than following the design; if there even is one; the lead programmer will decide which aspect of the game needs attention, and then jump to that piece of code.

A far better way to handle this is to follow the established ADLC – Application Development Life Cycle, in which all phases of the project are clearly defined ahead of time; Requirements, Design, Build, Test, Implement. Of course you will not be able to foresee all of the problems you may encounter as the project progresses, but having broken the project up into manageable pieces then unforeseen problems will only affect a part of your project rather than the whole project timeline.

It is also a common mistake to build a prototype and then call it the first beta version. It will obviously infuriate everyone, including you, and put unnecessary pressure on the entire project. Don’t fall into the trap of showing off until it is in a reasonable state of development, at the point where you’re merely cleaning up. When the game is running smoothly on multiple computers without any problems, and the game has been played several times from start to finish without any failures it may be considered complete.

The Components of a Basic Video Game Pipeline

Video games are extremely complex pieces of software. In fact they are without a doubt the hardest programs to write. Sure! Programming an application such as Microsoft Word is far more difficult than Pong, but Doom III or Half-life 2 for example supporting Dynamic Physics Simulations, and Virtual Displacement Mapping is more complicated than anything to yet be created.

This simply means that you have to learn a new way of programming that’s more conducive to real-time applications and simulations, rather than the single-line, event-driven, or sequential logic programs that you may be used to. A video game is a continuous loop that performs logic and draws an image to the screen at an average rate of 30 frames per second or more. This whole effect is quite similar to how any type of animation is displayed, except that the logic driven behind the scenes dynamically creates the next frame.

Therefore let’s begin by taking a look at a simplified game pipeline.

Section 1: Initialization

In this section, you perform the standard operations you would for any application, such as memory allocation, resource acquisition, loading data from disk, and finally embark the main pipeline loop.

Section 2: Retrieve Player Input

In this section, the player’s input is processed and/or buffered for later use.

Section 3: Performing Physics and Game Logic

This section contains the majority of the game code. The artificial intelligence, physics simulations, and any general game logic are executed, and the results are used to draw the next frame on the screen.

Section 4: Render Next Frame

In this section, the results of the player’s input, and the execution of game logic are used to generate the next frame of animation for the game. This image is usually drawn on an off-screen buffer area, so you can’t see it being rendered. Then it is copied very quickly to the visible display.

Section 5: Synchronize Display

Many computers will speed up or slow down due to the game’s level of complexity. For example, if there are 1,000 objects processing on the screen, the CPU is going to have a higher load than if there were only 100 objects. The frame rate of the game will vary, which isn’t acceptable. Hence you must synchronize the game to some maximum frame rate and try to hold it there using timing, and/or sub classing. Usually, 30fps is considered to be optimal.

Section 6: Loop

This section is the simplest of all; just go back to the beginning of the game pipeline and repeat the whole process.

Section 7: Shutdown

This is the end of the game, meaning that the end-user has requested to exit the pipeline, and wants to return to the operating system. However, before the user does this, you must release all resources and clean up the system, just as you would for any other piece of software.

You might be wondering about all the details of a real game pipeline. Granted, the preceding explanation is a little over simplified, but it captures the fundamentals of what’s going on. Listing 1.1 is a more detailed version of what the pipeline looks like in real code.

Listing 1.1 A Simple Game Basic Event Pipeline

Option Explicit
' Game Basic 3D Engine Build 4096
' Copyright © Monarke Studios. All Rights Reserved.
Private Engine  As New GameBasic3D.Engine
Private Sub Form_Activate()
    ' Initialize OpenGL, and embark the main pipeline loop.
    If Engine.Initialize(Me.hWnd, Width, Height, Pixel Depth, Full Screen) = False Then End
    ' Load the scene
    Do: DoEvents
    ' Begin rendering to next frame buffer.
    ' Draw the scene
    ' Synchronize with display buffer, and loop.
    ' Check for shutdown, and terminate the form.
    Loop Until Engine.Unloaded
End Sub
Private Sub Form_Terminate()
    ' Release all resources and return to the operating system.
    Set Engine = Nothing
End Sub


Well I think that’s probably the longest tutorial in game programming I have ever disposed! I covered a lot of ground, but! I think of it as the back of the box version of this series. I just wanted to give you a feel for all things that I am going to teach you. In addition, it’s always a good idea to take a look at a complete reference because it generates a lot of questions to think about.

Before moving on to the next Chapter, which covers advanced algorithms, make sure that you feel comfortable compiling the example code. If you aren’t, I would suggest opening, and reading the Visual Basic manual. This series is obviously not intended for you.