Simulation part 2 [edited]
-
This is a follow up to one of my GameDev blog entries. The website has been on a declining path for some time, it is offline now and chances are it will stay that way forever. I decided to post an update to my blog here. The theme of my blog was “creating a Starcraft AI player that behaves like a human”. There are many RTS titles out there I chose Starcraft with the intention to narrow down on what I’m trying to achieve. The blog had several entries, the most important of them was titled “simulation”. Here is a short recap of that entry: When the AI pl needs to build an expansion to his base the question is is it a good idea to send one of his SCVs and start building a Command Center in a nearby crystal cluster. To make that decision he needs to place the SCV on every path node of the path between the SCV start position and the target crystal cluster position. The AI will simulate an attack from the enemy* to every path node mentioned above. For example An SCV path made of 20 nodes means 20 simulated attacks. If the SCV dies at any node it means sending it to build an expansion is not safe. If a group of friendly combat units are in the way on the paths the enemy units are following, sending the SCV towards the crystal cluster in question is safe. That is what I spoke about in my previous blog entry. What I want to add now is that the tactic of moving a worker and constructing an expansion described here applies not only to constructing expansions but also to constructing any type of building in your base. When playing Starcraft you have a long term goal set in your mind. Getting to that goal can be achieved not just by one singular course of action. Same thing applies to AI. What AI builds is decided by his long term goal. How he builds it (where he places the buildings) is decided by the conditions at the time he needs to make the build. Another thing I want to mention is that not only the AI can check if it is safe for an SCV to do something he can also take measures to make it safe. To achieve that he needs to place combat units on the path between enemy units* and the area where the SCV will move I am still far from getting this stuff working in my own game. I’m still learning to get the units execute a Starcraft type resource collecting sequence. * when I say that AI will simulate an attack from the enemy I mean that it will either simulate an attack from a group of enemy units nearby he is aware of or if he is not aware of any enemy units nearby: a generic attack coming from the direction wh