Nikolay Gavrilov
personal web page

Real-time strategy (RTS)

Download (1.84Mb)

This was the best video game project I've made, I always wanted to create my own RTS game. Here I really tried my best to make a good GUI and get rid of bugs, so I was working on this project for two years. After implementing the multi-player mode, however, I put the project aside for I had to do my coursework.

I made the game in 3 iteration, 2 months each. First I made a 2 players game, a basic AI, obstacles on the battlefield and abandoned the project for a while.

Then being encouraged on game developers forums I increased the game performance, fixed bugs, made up to 8 players in the game, save/load game option. I was experimenting with the gameplay: construction of the bases, harvesting resources, but eventually I came to the original basic gameplay.

And lastly I made a descent GUI (buttons, forms, etc.), imploved graphics, added sounds, even tried to compose a background soundtrack, increased performance. Added the fog of war and implemented the multi-player mode by local network, which, however, I had not tested well.

When creating this game the most challenging problems were: synchronization in multi-player mode, path search, units interaction (game allows up to 20000 units on the battlefield).


Game description

A player controls units on a 2d battlefield trying to destroy all enemy units. There are polygonal obstacles on the battlefield.

There are also "bases" that can be captured by any player. The captured base can produce units.

Victory: destroy all enemy units and capture all bases

Defeat: when all units and bases are lost

When a unit steps on a base then the player captures it; in the beginning every player has one base.


There are 6 types of units in the game:

Can fire missiles - - - + + +
Velocity 5 3 14 5 3 11
Melee damage 20 45 15 6 6 6
Recharge time 35 100 12 80 100 40
Melee defense 3 6 5 2 2 0
Missile defense 14 15 18 10 2 0
View range 5 5 5 8 7 12

A missile damage is 24. The units of type 2 frequently (with 87.5% possibility) deflect the missiles, making this type of units efficient against firing units. The units of type 6 can go backwards from the enemy firing at the same time.


The bases produce and repair the units. In order to repair units select them and click on the shield icon in the bottom left corner. This way these units will go to the nearest base to protect it and be repaired. In order to produce units click on the "Build Units" button in the top right corner. In this case all the captured bases on the battlefield will produce units, including the enemy bases. Note that the enemy bases will produce 2 times more units so it is better to wait when the enemy starts the building of units. Or you should capture 2 times more bases on the map than your enemy did. There are 5 types of bases that differ by the unit types they can produce:

Unit type
25 25 25 10 10
0 0 0 0 10
0 0 10 10 10
0 15 25 10 10
0 0 0 0 10
0 0 0 10 10


In fact the mouse only will do to play this game. Left mouse button to select units of bases, click on menu buttons etc. Right mouse button to send units at a specific battlefield position, setup the destination of just created units for bases.

Scroll mouse wheel to change scale (there is no mini-map). By holding Ctrl you can add route points for units, so they could visit multiple places.

The icons in the bottom right corner set the selected units behavior:

Shield - unit goes to the nearest player base.

Sabre - unit attacks enemies if sees them.

Anchor - unit holds his ground.

Hot keys

F1 - on/off game speed restriction
F2 - save game
F3 - load game
F4 - exit
F5 - on/off "fog of war"
1-6 - select all units of a certain type
0 - unselect all units
P - pause
Q, A, Z - change scale
i - show/hide info about units number and the units production process.
D - show/hide diplomacy info.
F - on/off accepting of armed truce form other enemies.
S - adjust game speed
G - group selected units
U - ungroup selected units
Del - delete selected units

Units grouping

A group of units attacks together and its viewing range is a bit more than of a single unit. However if the group is spread it becomes vulnerable, in this case better to ungroup the units.

Only units of the same type can be grouped and the group number must be in the range from 50 to 160 units.

Multi-player mode

To play the multi-player mode run the server net.exe - this is a console program in game archive. When started enter the number of players. In ServerIP.txt file you will find th IP adress of the current PC. This file must be the same for every player and contain the IP of the server PC.

After the server prints "Listerning for connections..." you can proceed: every player starts the game (SGame.exe) and creates a new multi-player game. After that the game will try to connect to the server using the IP from ServerIP.txt.

The first player that succeeded to connect to the server shooses to game settings. After all players are connected and the game is set up the game begins.

© 2009-2021 Nikolay Gavrilov