3D RTS Game
Development
I implemented this game during my free time in spring 2007 using the book ?Programming an RTS Game with Direct3D?. Later I extended the game I created using the book with more features.
Detailed Description
This 3D real time strategy game features all the elements that players usually expect. While I reimplemented most aspects of the game, some of them, like the artificial intelligence and the assets, are still as provided by the book.
The game features playback of an introduction video as well as a menu where the player can choose between the option to start a new game or to exit the game. These two, the video and the menu, feature the basic framework around which all games have to be built.
When playing the game the player can build three different buildings. The buildings depend on each other, for example, the barracks can only be built after the town hall has been constructed. Each of the three buildings produces each own unit.
The units featured are the basic units used by most strategy games. The worker unit produced by the town hall is able weak but able to construct new buildings. The magician educated within the tower building is able to cast two different spells: A healing spell and an attack fireball. The warrior trained within the barracks is the melee unit of the game and heavily armoured.
Since the strategy game does not yet feature multiplayer capabilities the player can only play against some AI opponents. The AI implements a three tier design. On the top level there is a manager deciding to build new units and building attack or scout groups. The second layer implements a group commander coordinating one group of units. The lowest layer is implemented by the individual unit deciding how to execute orders and how to react to the environment.
Additionally the game features a so-called mini map and fog of war.
Future plans
I am currently in the middle of an extension of the game. Planned features are things like a map editor, basic scripting support, concepts like expanding the terrain and similar features. The features are currently, with cautious estimations, about forty to fifty percent done.
Technical Details
- Programming Language: C++
- Development Environment: Microsoft Visual Studio.NET 2005
- Project Size (Last Release): 69 files, 13397 code lines, 2605 comment lines, 4550 blank lines, 587 KiB code
- Project Size (Development): 561 files, 48847 code lines, 13381 comment lines, 17751 blank lines, 2.37 MiB code
- Project Duration: About 5 months
- Technology used: kaos Engine
Feature List
- Introduction video
- Menu
- Three different Units with different abilities
- Three different buildings with dependencies on each other
- Mini map
- Fog of war
- Random terrain generation
- Many others
Challenges
The problem with this project was getting it done. Even though I implemented everything by myself, and did not use libraries as in the book, implementing the game by itself was not the main difficulty. But getting it done, fixing every little nasty bug and still keeping the motivation up to test, find more bugs and fix them, that was the main challenge of this project.
Screenshots - Current Release
Videos - Current Release
Code Sample
This code sample shows the game?s main loop.
//-------------------------------------------------------------------------------------------------------
/*! \brief Main
*/
void Application::Main()
{
while(guiserver_->IsRunning())
{
// update fps things
last_frame_time_ = current_frame_time_;
current_frame_time_ = get_kernelserver()->timeserver->GetTime();
delta_time_ = current_frame_time_ - last_frame_time_;
last_fps_time_ += delta_time_;
if (last_fps_time_ > 0.2)
{
double_t fps = 1.0f / delta_time_;
current_fps_string_ = kaos_convert<string_t>(fps);
last_fps_time_ = 0.0;
}
try {
DispatchInput();
if (guiserver_->IsRunning())
{
Update();
BeginFrame();
RenderFrame();
EndFrame();
}
}
catch (Exception& e) {
HandleException(e);
break;
}
guiserver_->Trigger();
}
}
Additional Material / Downloads
I have testet the game as good as possible during my spare time. I still heard of crashes on different machines. Credits go to Carl Granberg since I used his art and to Paul Houseman who produced the background music used in the game.
Related Links