Original post by Anonymous Poster
I'll make a comment on the C&C Generals AI though.
So the C&C generals AI is 100% scripted. That's why the opening attack is always the same. It's almost completely deterministic and thus really crappy. You can actually look at the AI if you open up the Libraries/ folder and open one of the .map files in the Worldbuilder tool. You have to remember though that it's ~5yrs old so hardly represents the pinnacle of RTS AI. (Incedentally the AI for generals was completely new for that iteration of the franchise. It had really good reviews when it was released, it just looks crappy now b/c our expectations are higher.)
At any rate, more modern RTS AIs are a lot less deterministic and the best don't actually cheat at all. The way they are challenging is by exploiting the things that a computer can do better than a player. More or less that is soley micro-management. A human is always going to be better at tactical planning and long-range thinking so you can't win by just making an amazing tactical planner.
Humans however are serial thinkers. We can only think directly about one thing at a time and to multi-task we have to keep switching our attention to different parts of the map. Even the best players can typically manage no more than 3 or so parts of the map. Any more than that and the effectiveness of the forces at those locations is lowered because the player cannot micro-manage them effectively.
IMHO the key then to making a challenging AI opponent then is to keep the player frantic by waging a war on many fronts. Whereas the player has to move the camera around all the time (thus losing focus on local battles) the AI does not and can operate everything simultaneously.
I think that a potentially great strategy for RTS AI is to attack on at least 3 fronts at all times so that the player is forced to keep switching attention between the attacks. I find that it works really well in terms of distracting the player. Basically if you can constantly maintain 2-3 attacks, the player is either going to lose one battle due to lack of attention or they will forget to queue up units at their base and the AI will get a step ahead in production. Essentially you are exploiting the ability of the AI to never lose focus on what it is doing. You also exploit the general lack of low-level unit AI. In most RTS games units that are near other units that are being attacked will not move over to help their buddies out. It's done for game mechanic reasons (you don't want the player's units to run around aggroing on everything b/c it might destroyed some kind of bait tactic and annoy the player). If you can keep the player frantic then you can win.
I think it's also vital that the AI plays clearly towards the win conditions of that map. In most RTS games the win condition is "all enemy buildings destroyed". Thus the AI should only consider buildings to be targets. If the player takes his entire army to the side of the map, the AI should completely ignore them and just rush the base.
Anyway, whatever road you choose to go down the single most important thing for developing a challenging RTS AI is to watch as many replays of RTS battles between people who are the best in the world at the particular game. The most effective winning strategies actually have little to no actual strategy to them. Typically it boils down to rushing and attacking multiple fronts of the enemy. I think the danger in developing an RTS AI is to make up theories of how military battles actually unfold and to make your AI really good at military theory. It's certainly a more appealing and complicated problem to solve but actually has little to do with how people win at RTS games.