I am trying to make a strategy game simular to age of empires or starcraft. I am at the point where an AI is needed, and have brainstormed on what it might have to be.
5 Different "modes" for AI
1. scouting: always in background, explores map with 1-2 units, only becomes active if less than that
2. build base: includes resources and building buildings. Switches off with military for resource consumption. starts with high piority, but loses some as game progresses
3. build military: builds military units, choosing which units based on type of map, type of civ, and what resources are available. Trades off with build base for resource consumption. Becomes more important (higher priority) later in game.
4. attack: active when there is a certain amount of units built (probable around 10). Works in the background, and the units attack the most dense area of enemy buildings/units.
5. under attack: immediately ovverides rosource consumption to make more units, unless there are already more units than those attacking. Sends up to 10 more units than the attacking army to stop them. Once enemy stops attacking, goes to lowest priority.
Priorities of building units
1. higher priority if there is a civ bonus for that unit/special unit.
3. Higher priority (by alot) if there is enough resources for 3 of them.
4. Lower priority if already lots of units (makes diversity)
Building Placement
1. If resource collection point, has to be within 3 "grid" squares from the resource.
2. Must be at least 3 "grid" squares from other buildings.
3. Higher priority locations go to places close enough to your buildings, but closer to the enemies (makes the AI build towards you)
4. Higher priority (not much) of military buildings near resource collection buildings (for protection)
Is this along the right lines? Am I missing anything important? I have never done AI this complicated before.
|