Adding Enemies to the Map
Most RTS games have groups of enemies that work together to attack the player units while they are exploring the map covered by the Fog of War, making it difficult to predict where the enemies could be hidden, patrolling an area, and waiting for the right moment to attack from the shadows.
In this chapter, we are going to learn how to create enemy groups, with different configurations, and how to add them to the map using predefined spawn points. We will also learn how to implement a fog to cover all of the map but leaving the initial area clear, as well as how to clear the fog above the units while they are moving to covered areas of the map. To make the enemies even more dynamic, we are going to add a new behavior that will allow them to patrol an area between two points, creating more challenges for the player when exploring the map.
By the end of this chapter, you will learn how to create a flexible solution to add one or multiple enemies in a group...