|04/12/2008 01:56:08 AI unit building algorithm|
A question for some of the more developed bots out there. How do you manage credits and unit production? Some possible ideas I have are:
This is the next thing on my to do list and obviously the first two have severe limitations, but the complexity of the third could get a bit extreme. Any advice? Right now, my bot is just randomly selecting a unit an hoping it has enough to build it.
|04/12/2008 09:41:37 Re:AI unit building algorithm|
Version 3 should be the pick.
A short desciption:
Like you do it yourself it is imprtant how many bases you have, how many bases the enemies have and what units are out there. On your side an on the one of your competitors.
So based on the strategy you select for your bot (or in an advanced mode the bot chooses for the situation), the list of favorit units differs. For example if you want to use the mass+artillery option it might be a good idea to build troopers and (based on the opponent units) heavy troopers, and save money for artillery. If you wanna raid your opponent raiders or hovercrafts are the main units.
But over all, building units is one of the key features of a bot. I was not able to finish the basic framework last weekend. But the key questions are allways:
- what unit do I need to put pressure on my opponent?
- what unit do I need to defend against my opponent?
- how fast is the unit in the conflict zone?
- how many credits do I have?
- and if I have not enough credits, it is worth to wait and save money?
Finding answers to those questions will make the bot "intelligent" and finding the best balance between the answers makes your bot a winner.
|04/12/2008 22:33:37 Re:AI unit building algorithm|
You left out another strategy
4) Copy the opponent
ai_DavidBot builds unit to have a "balance" between different types of units. It tends to focus on counteracting an opponents units (rather than copy them). As a result it reacts to the units built.
At one point I was not happy with the build method and replaced it (for testing purposes) with a and random build option. When it played against itself in this mode it was beating my first idea. Thus I knew that I needed to work on that part of the game.
This taught me that literally half the strategy is in building units. The other half being in moving them.
I strongly recommend a second bot to test against to determine if any change you make improves or does the reverse to the bot. Sometimes the results are surprising.
|05/12/2008 03:47:09 Re:AI unit building algorithm|
Do you think it'd be "unfair" to hard code a building strategy for a particular map, Aruba for example, and then use a general strategy for other maps?
|05/12/2008 04:32:23 Re:AI unit building algorithm|
No. But a completely hard-coded strategy obviously would not react well to different opponent strategies. A hard-coded strategy may be best for the first few builds however.
This message was edited 1 time. Last update was at 05/12/2008 04:32:39
|05/12/2008 06:29:29 Re:AI unit building algorithm|
A hard coded strategy would be no different than playing chess from an opening. Its actually a good idea to use YOUR best judgment.
Now I just need to implement it.