Improved AI for RTS games
-
This is a followup to a previous post made here in the Lounge, that post was titled “Simulation” I think. The main problem with AI in RTS games is that while the building of the base resembles to what a human would do, the fighting itself follows no strategy. If we take Starcraft for example the AI player combat units always attack following the shortest path, regardless if it’s a case of a building or a unit in it’s own base suffering damage and needing protection or a case of attacking the enemy base. In the later situation the attack force enters the enemy base as stream of units arriving one by one which makes the attack useless. Among the main challenges in Starcraft is defending the base and the expansions. At the beginning of the game you have a small number of combat units. If you build an expansion, splitting your combat units in two to defend your main base and the expansion is not a good idea, two small unit groups separated from each other are easy to defeat. The solution is to keep your units together and place them in a location that will cover both bases. That can be done by tracing paths from the enemy base to your bases and see where the paths overlap. The place where the common nodes end and the two paths go in different directions makes a good location where you can keep your units. This way you can use your units to protect both bases at the same time
-
This is a followup to a previous post made here in the Lounge, that post was titled “Simulation” I think. The main problem with AI in RTS games is that while the building of the base resembles to what a human would do, the fighting itself follows no strategy. If we take Starcraft for example the AI player combat units always attack following the shortest path, regardless if it’s a case of a building or a unit in it’s own base suffering damage and needing protection or a case of attacking the enemy base. In the later situation the attack force enters the enemy base as stream of units arriving one by one which makes the attack useless. Among the main challenges in Starcraft is defending the base and the expansions. At the beginning of the game you have a small number of combat units. If you build an expansion, splitting your combat units in two to defend your main base and the expansion is not a good idea, two small unit groups separated from each other are easy to defeat. The solution is to keep your units together and place them in a location that will cover both bases. That can be done by tracing paths from the enemy base to your bases and see where the paths overlap. The place where the common nodes end and the two paths go in different directions makes a good location where you can keep your units. This way you can use your units to protect both bases at the same time
Tactics generally dictate concentrating all your forces on a given point when attacking. Ai can calculate attack and defend strength and arrive at probabilities. Strategy involves iterating over the enemy and finding his weak points, and your own. At its core, it's about maneuvering (march rates; terrain; inclines; fatigue); putting your strength against his weakest point. In real simulations, there are no "barracks" that spawn hundreds of troops at a time or infinite farms: you go for supply (communications) lines.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
Tactics generally dictate concentrating all your forces on a given point when attacking. Ai can calculate attack and defend strength and arrive at probabilities. Strategy involves iterating over the enemy and finding his weak points, and your own. At its core, it's about maneuvering (march rates; terrain; inclines; fatigue); putting your strength against his weakest point. In real simulations, there are no "barracks" that spawn hundreds of troops at a time or infinite farms: you go for supply (communications) lines.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
>Tactics generally dictate concentrating... I think that changes a bit depending on the game you’re playing. It is true if you’re playing a game like Warcraft 3. In Starcraft however the main rule is inflict damage without taking damage. That means your attacking units need to be placed not on the edge of the enemy base that is closest to your base ( which is the place where the typical AI sends his units) but somewhere else where they don’t take damage. This can be achieved by marking on the map the areas that fall in the enemy units fire range and keeping your units away from those areas.