Friday, September 02, 2005

Easy to Create Game Engine

the last year. I write game with C++.Net 2003 and DirectX SDK 9.0c. I have sourcecode 30,000 line. I think if I use template and change only variable. It easy ? sure it easy

It's Concept

I have 2 part

1. GUI -> save file to XML

2. Process -> read XML to generate source code and compile

part 1

this GUI it have config in game and save file format in XML

Part 2


use Nvelocity or Codesmith for Generate XML and generate to source code . after use Nant for compile and copy file other to directory

finally

it easy to make game but it in large game . Process is complexly and hardly. You must coding yourself.

Design Patern in Game Setting

Process coding in game is complex. you can write code in 1 page and success in your program but the next step you cann't modify source if you not write in pattern or sturcture . source code is not to read again. I want to purpose pattern to design source code for easy read and modify

pattern setting in game

the picture to show how to coding step

1. design game and divide it the same in picture

2. if you use OO (object oriented) you can divide 2 class :

-- 1. class Scene ->it have method to load level and delete level

-> in addition you can load model,terrain,sound, and other

** extension **

in attach method ai for model you can write each other class example

Ai class

-- 2. class GUI -> the class have method for button , panel , label and other component

-> and have action(activity of event ex. click button ->play sound etc)

example

Class : Game
-int: state
-Int: health
-void: menu()
-void: level1()
-void: run()
-void: destroy()

it useful to maintain and reuse source code.

(-_+)zZ kha