My RTS, Firewall, is a little different from most (see below in my signature for my website), but I still may be able to offer some advice. When I build AI for games, I first think of what I would do when I play it. I build my AI off of my intelligence, which is human (obviously). That way, the computer thinks the same way that my friends do, so it is more like playing against human opponents than dumb computers.
In my RTS you have to fight off viruses that are invading your computer. There are three different robot types that do different functions, and ten different robot designs that have different abilities (flying, shooting, fast, slow, strong etc...) The computer has access to the same robots, bases, and drones as you do. You each start out with one Poster (building robot) that builds up your memory (territory). Everyones territory is analyzed every 5 seconds to see where there is oppurtunity to build, and if it is close to enemy terriroty. This data is used by the computer AI to build new Posters (builders) where the territory can be expanded, and build Hackers (robots that destroy other's territory) where the territory comes close to the enemie's territory.
Now that is just fine, but you must control how fast the computer AI expands and builds. In Firewall, you get points. The more memory you control, the faster your points go up and the more points you can hold. You don't have to go find resources, just wait for them. The more territory you have, the shorter you have to wait .It may seem simple and boring, but ask Jess, it is fun (that is, if he tells me the truth

). Now, depending on the difficulty level, the computer's points may actually go up faster than yours under the same circumstances (yeah, I know it's cheap, but it works and no one seems to notice

). The computer AI, like a human would, saves some points and doesn't spend all of its points on useless stuff. It waits until it has a decent number of points, then builds a large army to attack you. And it only builds the army if it will do any good, it checks the data to see if there is enemy territory nearby, and builds the army there.
There are also Wreckers in my RTS, robots that destroy other robots. These are used to defend your territory and protect your Hackers and Posters to invade the viruses' territory. The computer AI doesn't build Wreckers for not reason unless it has tons of points. Then it will build a strong group with lots of drones (little things that pump up your robots) that will defend its territory. It usually only builds Wreckers to protect it's Hackers when it builds them, or when it is being attacked. Whenever a post is destroyed in my game, variables are stored in arrays that tell the player whos post it was where the post was destroyed. The computer uses this information to build Wreckers there. Information is also stored as to what type of robots destroyed the post, so the computer AI builds the correct types of robots (ones that can reach flyers, more powerful ones, etc...) Also, if there are a lot of guards detected nearby, the computer AI will build Implode Drones instead (little things that blow up, actually suck in, energy and destroy robots) because it knows that if it puts out Wreckers, they may just get destroyed.
To make it simple: the computer analyzes everything that it can to make the best desicions, but each computer only does something every 6 seconds or so, so the computer AI doesn't slow down the game at all. These methods actually work, try my game and test it out.
Darn, now that I told everyone how my AI thinks, they will be able to beat it
I hope I helped, just ask if you want to know something specific.
Xander Moser of Bolt Software
Firewall: Your Computer's First Defense - Real Time Strategy game
