DEV Community

Cover image for RTS game development - Week #4
Christopher Toman
Christopher Toman

Posted on

RTS game development - Week #4

Current state: 9 000 lines of code over 80 files

I've made some progress since the last update, so let's see what I did.


Attack heatmap

Heatmap which shows where are shots being fired on the field. That shall help AI to organise itself to be more passive or active in certain situations.

Alt Text


Fog of War

Fog of war was very painful at first, but the solution I've found seems to be robust. A post-processing effect gets the world position of every pixel. Then compares it with all known unit positions and their Line of Sight. Based on that it determinates if the pixel should get dimmed or be fully clear.

Alt Text


Minimap

Shader based minimap which displays coloured circles. The future plan is to have actual textures instead of pure colours.

Alt Text


Soldier stances

The units can change their "Cover state" and that affects the damage they can receive and how much they are detectable.

Alt Text


Bomber

A plane flies through the map and drops the bomb right at the correct time, so it hits the ground at the target. First, I made it physically based, so had calculated some very basic physics formulas to get when to drop the bomb. But that had many limitations so eventually, I ended up with a custom curve which the bomb follows and the result is satisfying enough.

Alt Text


Helicopters

Very nice helicopter motor was made. It has its own momentum and feels natural. The helicopters can transport units.

Alt Text


Future plans

  • The unit squad should get more segmented with different weapons and similar differences.
  • There should be a selectable main tent.
  • Units should have a conic vision instead of a circle vision.

...

I hope you found it at least a little interesting, till next time...

Top comments (0)