sse643.1


 * Course:** SSE643
 * Project:** 1
 * Subject:** Introduction To Game Development
 * Student:** Dmitriy Slipak
 * E-mail:** dslipak@gmail.com

=Table Of Content=

Preface Introduction Game Graphics 2D Content Creation Suites 3D Content Creation Suites Game Development Kit (GTK) Simple 3D Project With Dark GDK SeaFight – The Course Game Wiki Experience Conclusion

 =Preface=

This report is an introduction to the Advanced Graphic Interfaces course. This is also my introduction to the world of games design and development. This report is not an overview of all possible types of games. The goal for this project was to get basic knowledge of the tools involved in game design and development process. I selected C++ as a primary programming language and Dark GDK (Game Development Kit) for this course. The report delivered entirely via wiki. All supporting material can be found at course FTP server under my folder.  =Introduction=

Game design is the process of designing the content and rules of a game. The term is also used to describe both the game design embodied in an actual game as well as documentation that describes such a design. This is the definition for game development term from Wikipedia.

Game design and development is a complex process which involves large number of principals, tools and techniques. We can see how big the game design process might be from Example Game Design Document by Chris Taylor.

In general, video game design and development include the following procedures:


 * **Game Mechanics** - are a construct of rules intended to produce an enjoyable game or gameplay.

> All games use mechanics; however, theories and styles differ as to their ultimate importance to the game. In general, the process and study of game design is the effort to come up with game mechanics that allow for people playing a game to have a fun and engaging experience.


 * **Visual Arts** – are art forms created by a game artist(s).

> A game artist is an artist who creates art for one or more types of games. Game artists are responsible for all of the aspects of game development that call for visual art. Game artists are often noted in role-playing games, collectible card games and video games.


 * **Programming** - a subset of game development, is the programming of computer, console or arcade games.


 * **Production Process** – a process when a game developed and approved by stages.


 * **Audio** – a process of sound development and applying in a game.

 =Game Graphics=
 * **Narrative** – a process of game narrative texts development and applying in a game.

One of the major parts of any game is a game graphics. Game graphics can be 2D and 3D.


 * //2D Graphics//**

2D graphics are those that are seen from one perspective, and include things like photos, paintings, sketches, and the kinds of doodles do can do in photo programs like GIMP or Photoshop. Although there are no real limitations on the kinds of images that can be classified as 2D, all 2D images share a common property that classifies them as 2D: 2D images cannot be seen from other perspectives. We can draw a happy face on a sheet of paper, but we cannot turn the paper at different angles and observe the face from other sides. We cannot, for example, walk around to see the back of the face if we have only drawn the front. Nor can we see either profile of the face. In short, it doesn't exist as a 3D head, but rather appears exactly how it is drawn.


 * //3D Graphics//**

3D graphics are analogous to sculptures and are made in 3D graphics programs like 3ds Max, Maya, and Blender 3D. Unlike 2D graphics, 3D graphics can be rotated, moved, transformed, and scaled, and it's possible to see the models from any angle. We can zoom in or zoom out, turn the model around to see it from the other side, and we can even zoom down the spout to see it from the inside.

There are number of libraries which draw graphics to the screen. Here are some of them.


 * //DirectX//**

DirectX is a well-known free library maintained by Microsoft. Most people will probably have seen this library installed alongside their game on Windows systems. It is intended to be used primarily for game development, although many other kinds of software can be made using it too, ranging from museum kiosks to bowling alley displays, and the list goes on. DirectX as a library provides a set of classes and functions that abstract the graphics hardware and allow developers to draw fast 2D and 3D graphics, as well as play media files such as MP3s and AVIs. It can also abstract the input hardware and accept data from the keyboard, mouse, and even plug-and-play joysticks and other peripherals. From a graphics perspective, DirectX offers a range of functions to draw images to the screen in coordinate space. The top-left corner of the screen is the origin (0,0), and by using such a coordinate space, programmers can draw animations, videos, and static images at specific screen locations. DirectX can also represent 3D graphics in a 3D coordinate space, where coordinates are defined as x, y, z. Naturally, DirectX does not provide features to organize a game in the sense of storing lists of data, such as units of an army, nor does it include functions for artificial intelligence, or making the computer think and respond to the player. These kinds of features are either made by the programmers themselves or can be provided by a separate library. The purpose of DirectX is to draw graphics-either 2D images loaded from files such as BMPs, JPEGs, and PNGs, or 3D models exported using 3D software.


 * //OpenGL//**

OpenGL (Open Graphics Library) is like a kind of cross-platform DirectX, and is also open source. Like DirectX, OpenGL allows developers to draw fast-paced 2D and 3D graphics for games and other multimedia software, and is also free to use for commercial and non-commercial products. However, unlike DirectX, OpenGL does not provide support for areas other than graphics. It does not offer classes for programming sound or input.  =2D Content Creation Suites=

There are number of open-source and commercial applications for 2D graphics development. I prefer GIMP since it's free and powerful.


 * //GIMP//**

GIMP is a multi-platform photo and graphics manipulation tool. GIMP is an acronym for GNU Image Manipulation Program. The GIMP is suitable for a variety of image manipulation tasks, including photo retouching, image composition, and image construction. GIMP has many capabilities. It can be used as a simple paint program, an expert quality photo retouching program, an online batch processing system, a mass production image renderer, an image format converter, etc. GIMP is expandable and extensible. It is designed to be augmented with plug-ins and extensions to do just about anything. The advanced scripting interface allows everything from the simplest task to the most complex image manipulation procedures to be easily scripted. One of The GIMP's strengths is its free availability from many sources for many operating systems. Most GNU/Linux distributions include The GIMP as a standard application. The GIMP is also available for other operating systems such as Microsoft Windows™ or Apple's Mac OS X.

Here is a simple graphics created with GIMP  =3D Content Creation Suites=

There are number of applications for 3D modeling. I found that Blender is one of the best programs for 3D modeling.


 * //Blender//**

Blender is the free open source fully integrated 3D content creation suite, available for all major operating systems under the GNU General Public License. It has all the tools for making linear animation and non-linear (interactive) 3D graphics. All of these features are provided in one single application and gives the artist a very smooth workflow from design, to modeling, animating and on-to publishing of 3D content. For example if we needed to make a demo trailer of a game we would need a modeler, a renderer, a video editing application and the game engine itself to produce the video. Blender offers us all these tools combined to produce interactive and linear 3D content.

Learning Blender takes time and requires patience. But result is worth. Here is a seascape that I created with Blender 2.49b. Blender source file for this animation can be found at course FTP server under my folder.  media type="youtube" key="ICkmygA9imI" width="600" height="400"

But an animation is expensive. 10 seconds movie above is 219Mb.

Blender is really powerful tool for 2-D content generation as well. It's renderer produces high quality graphics from scenes. Below is example of image generated by Blender's renderer.   =Game Development Kit (GDK)=

Game Development Kit is a set of libraries for a game development. In general it's a platform for the game programming process. There are many GDKs available today. Some of them are free and open-source, some commercial, cross-platform (platform-independent) and platform-specific. Almost every GDK is programming language specific. There are GDKs for game development in Java, C++, C#, etc. Some of popular GDKs are the following:


 * Microsoft XNA for game development under .NET platform
 * JmonkeyEngine for game development in JAVA
 * Dark GDK from The Game Creators for game development in C++ under Microsoft Visual C++ IDE

Since I selected C++ as a primary programming language for this course, I will use Dark GDK for the course projects.


 * //Dark GDK//**

The Dark GDK is a game development kit for C++. It implements most of the commands available in DarkbasicPro but significantly increases the execution speed and frames per second in 3D intensive applications.

> DarkBasicPro (DarkBASIC Professional) - is a BASIC language that uses Direct X 9.0c, It supports the creation of both 2D and 3D games however the language is more inclined towards 3D game creation. The language compiles to machine code and there are several IDE's available. It can support Libraries written in other languages including C/C++.

The Dark GDK is a complete game engine that illustrates the latest DirectX 9 technology. Some of its key features are:


 * Over 1000 game orientated commands
 * Binary Space Partioning (BSP) Support
 * Nodetree Optimization
 * Light Mapping
 * Environment Mapping
 * Pixel and Vertex Shaders
 * Particle System
 * Extremely fast 2D Sprites
 * 3D Studio and Direct X Object Support
 * Works with Microsoft Visual C++ 2008 Express

I am using Microsoft Visual C++ 2008 Express edition IDE and the Dark GDK works perfectly with it. Once installed, the Dark GDK provide the IDE with additional project templates. Each of these templates offers a simple starting point for a Dark GDK game. The 2D game template contains basic code to display some sprites on screen. The 3D game template contains code demonstrating how to create 3D objects and move the camera. Finally the game template contains the minimum code required for a Dark GDK game. Once a project selected from the list of game templates, the GDK will create “Main.cpp” file with a basic game code generated. This is a game starting point.


 * //Dark GDK and STL//**

I noticed that compiler will generate run-time library error during compilation under "Debug" mode when there is usage of STL (such as standard List) in the project. The fix is to change "**Runtime Library**" compiler setting to "**Multi-threaded (/MT)**". This setting is under "Project Properties" - "Configuration Properties" - "C/C++" - "Code Generation".  =Simple 3D Project With Dark GDK=

To learn the Dark GDK functionality I created a simple 3D project using "Dark GDK – 3D Game" wizard. I wanted to see how we can use the GDK to operate 3D models. I created simple 3D animation in Blender. I selected a monkey object - default mesh provided in Blender, and created animation which is a simple monkey object rotation over "Z" coordinate. Blender source file for this animation can be found at course FTP server under my folder.



One good thing (of thousand others) about Blender is that it allows to export animations to different file formats. One of them is "X" format for models to be run under DirectX. And I exported my 3D monkey model to "X" format (monkey 3D model can be found at course FTP server under my folder).

Once monkey 3D model is ready I loaded it into my C++ project using dbLoadObject function. Now we have all the control over our 3D model. We free to operate it and it's up to game functionality. I just tested basic functionality. We can move, rotate our 3D model as well as scene camera. We have full control over the scene camera and lights. Th source code for this simple project is below:

code format="c++"
 * 1) include "DarkGDK.h"

// the main entry point for the application is this function void DarkGDK ( void ) {       dbSyncOn; dbSyncRate(60);

dbPrint("Loading monkey model..."); dbSync; dbSync;

dbLoadObject("monkey.X", 1); dbRotateObject(1, 80, 0, -5);

dbPositionCamera(0, 1, -5);

dbLoopObject(1); dbSetObjectSpeed(1, 20);

// our main loop while (LoopGDK) dbSync ; } code

And the output result of program run is below

Complete project can be found at course FTP server under my folder.  =SeaFight – The Course Game=

I selected to create the SeaFight game for this course. This is a platform for remaining project 2 and project 3. Every project in this course will contain the game evolution. There will be a separate wiki page for the game explanation. For now, I will give a brief overview of the game.

SeaFight is a simple 2D shooting game based on my lovely game from childhood. I selected 2D implementation since 3D battleships modeling in Blender requires too much time.



The SeaFight game which I have played in Soviet Union was based on 1969 Midway Sea Raider game by Sega EM. The game principle is simple. You are at submarine and see battleships in the periscope. You have 10 torpedo to shoot, and the score based on how many battleships you will destroy.

I rendered seascape image created in Blender.

Next, I took very nice picture of Japanese Imperial Navy (JIN) battleship "Nagato" from wikipedia.

I scaled the image and added transparency in GIMP. This will be the game main sprite at this stage.



Next, I created 2D project in Microsoft VC++ using Dark GDK template and started the game coding. I have created few classes:


 * Application class – for main game operations
 * Gui class – for game UI manipulations
 * Battleship class – for battleships manipulations

code format="C++"
 * Module** application.h
 * 1) ifndef _APPLICATION_H_
 * 2) define _APPLICATION_H_


 * 1) include
 * 2) include "gui.h"
 * 3) include "battleship.h"


 * 1) define WINDOW_TITLE "SeaFight"
 * 2) define WINDOW_WIDTH 640
 * 3) define WINDOW_HEIGHT 512
 * 4) define RESOURCES_DIR ".\\resources\\"

class Application { private: Gui* gui; std::list* ships;

void initialize;

public: Application; ~Application;

void play; };

code
 * 1) endif

code format="C++"
 * Module** gui.h
 * 1) ifndef _GUI_H_
 * 2) define _GUI_H_


 * 1) include "DarkGDK.h"


 * 1) define SEASCAPE_IMAGE "seascape_1280_1024.jpg"

class Gui { private: int width; int height; char* title;

void initialize;

public: Gui(int w, int h, char* t); ~Gui;

void set_width(int value); int get_width; void set_height(int value); int get_height; void set_title(char* value); char* get_title; };

code
 * 1) endif

code format="C++"
 * Module** battleship.h
 * 1) ifndef _BATTLESHIP_H_
 * 2) define _BATTLESHIP_H_


 * 1) include "DarkGDK.h"


 * 1) define DEFAULT_Y_POS 279

class BattleShip { private: int id; char* name; char* image; int image_w; int image_h;

void initialize;

public: BattleShip(int ship_id, char* ship_name,       char* ship_image, int width, int height); ~BattleShip;

void move; };

code
 * 1) endif

The major part of the game at this stage is a battleship movement from battleship implementation file:

code format="C++" void BattleShip::move {   for (int i = -image_w; i < 1280; i++) { dbSprite(id, i/2, DEFAULT_Y_POS, id); dbSync; }

dbSprite(id, -image_w, DEFAULT_Y_POS, id); } code where

> DEFAULT_Y_POS – is a battleship image Y position on the screen; > image_w – is a battleship image width; > id – battleship image and sprite Ids; > dbSprite function sets particular sprite at specified position; > dbSync function updates the screen

The battleship movement loop above moves the battleship image from left to right. Once the battleship became invisible on the right side, the code re-positioning the battleship image to the left side of screen. The code is ready to accept and manipulate any number of battleships.

The game at current stage produces following output:

Complete source code and supporting material for the game can be found at course FTP server under my folder.

The goal for course project 2 is to add periscope functionality as well as battleships functionality, improve scene via camera movements and lights modifications.  =Wiki Experience=

I like the wiki implementation done by wikispaces.com people. I have previous experience with wiki since I am always using Redmine application for my personal projects and it contains a wiki module. The wiki from wikispaces.com has many advantages, including reliable content management and "visual" mode for page editor. The "visual" editor is very important for beginners. Moreover, wiki from wikispaces.com extended with additional tags for different media content manipulation. We can easily include videos into pages from several sources. Wiki allows to make much easier projects reports delivery. Projects reports became more accessible (easy access from anywhere on different devices). What is most important wiki allows to share knowledge between classmates.  =Conclusion=

This project, as well as entire course is a real challenge for me. I have no previous experience in game design and development. Moreover, I have no previous experience in 3D modeling as well. Learning Blender as well as Dark GDK shows me totally different and interesting side of software development. I am glad I have decided to take this course. And I am looking forward to extend my knowledge in game design and development area.

Last revision date: {$revisiondate}