ID:89244
 
Keywords: ai, design, interface, rts, ui
Over the last few weeks, I had been hammering away at the HUDs, Base, and Factory. This lead to a number of new features which didn't get added to the AI routines.

Remember, the goal was to design the game around the AI. I had started putting off the AI updates because I was working on getting the HUD/Interface features working. Now I have a bunch of features ready for the AI to use so I started looking at the AI again.

I knew I needed to scrub my original AI (place holder) design with something a little tighter before adding a real decision tree. I came up with the following design and I'd like to get your feedback.

Bots will have 7 attributes. These attributes fall under 1 of 3 buckets which determine the bots general behavior. Remember, there are only 100 points to distribute between the attributes.

- Building Fortifications
- Gathering Resources
- Assaulting Opponents
- Amassing Units
- Expanding Empire
- Tactical Prowess
- Analytical Decision Making


As an example, you or the game can build bots that look something like this.
- Building Fortifications: 15
- Gathering Resources: 15
- Assaulting Opponents: 15
- Amassing Units: 15
- Expanding Empire: 5
- Tactical Prowess: 10
- Analytical Decision Making: 25


Inside the game, I combine the above attributes into higher level buckets which look something like this.

- Gatherer
- Hunter
- Chief


By combining the attribute values from above into buckets, it tells us what kind of overall behavior the bot will have. The above bot would be pretty balanced although it would spend a few more ticks thinking about what to do.

- Gatherer: 30
- Hunter: 30
- Chief: 40


Here's how the attributes get broken down.
Gatherer: 30
- Building Fortifications: 15
- Gathering Resources: 15
Hunter: 30
- Assaulting Opponents: 15
- Amassing Units: 15
Chief: 40
- Expanding Empire: 5
- Tactical Prowess: 10
- Analytical Decision Making: 25


This next type of bot will spend more time producing units and attacking players with only a little bit of forethought.
- Gatherer: 30
- Hunter: 60
- Chief: 10


The next type of bot will naturally become a turtle and produce fewer tanks but many turrets and will most likely place them in fairly strategic locations.
- Gatherer: 60
- Hunter: 20
- Chief: 20


In my decision tree, through probability, I will enter one of the three high level buckets. Inside that bucket, I will again use probability to pick an associated attribute. As an example, if I end up in "Hunter", I will choose either "Assault Opponents" or "Amass Units". Decisions inside these attributes will rely on data provided by the Chief during earlier cycles.If the Chiefs data is stale or non-existent, we make a best guess (random choice) at what to do. If the Chief didn't suggest which type of unit to build, we pick one at random. If the chief didn't select targets for us to attack on the map, we don't target anyone or we may pick one at random.

The neat thing about the Chief is that it weights the decisions of the Gatherer and Hunter vs deciding everything for them. If something is extremely urgent such as "we are being attacked", the Chief (when it gets called) will adjust the probability to "very likely" that we will enter the waypoint setting to move our tanks into a defensive position.

During normal (non threat) operations, the Chief will slowly increment and decrement the probability of any one choice. This lets the Gatherer and Hunter do what they normally would using data provided from the Chief.

This design also lets each type handle the problems in their own way. As an example, if we get attacked and the Gatherer branch is entered, we would most likely opt to place turrets near the location being attacked while if we had entered the Hunter branch, we would most likely opt for a counter-attack.

So the Chief is the brains of the operation. However, the Chief will be limited. I'm considering a point system based on the Chief stat. As an example, a "Chief: 20", may get 20 points to spend on analyzing the field of play during a given tick. One point would be spent looking for good locations to place a turret. Another point would be spent on looking for good locations to place a war factory. Another point would be spent on analyzing things in oview(2). This point system is essentially the intelligence of the bot.

Thoughts?
ts

Will players get to design AI?
Vermolius wrote:
Will players get to design AI?

Yes... if by "design" you mean that you can can customize the name, description, image, and the following attributes.

- Building Fortifications
- Gathering Resources
- Assaulting Opponents
- Amassing Units
- Expanding Empire
- Tactical Prowess
- Analytical Decision Making

I will most likely add a few more customizations as time goes on and as I learn more about how the AI will behave.

You can then pit your bot against others and then tweak until your heart is content. I will provide a "battle royal" mode that lets you run your bot against other bots for days on end. I might also add the option to do player bot vs player bot. As of right now, the host chooses from his own custom list of bots along with those the game will provide.

ts
Interesting.