Original Post
I am working on an RTS game and right now I am just brainstorming ideas for how I will handle the AI. If anyone could comment on my ideas and also, let me know if you know of a better method! I''d like to figure out how I will do this before I get halfway through it and realize it doesn''t work very well.
(this is my first project with AI so I''m not very experienced with the subject)
Base Defense:
Each base will be centered around the Military Headquarters building. This is basically like the Construction Yard from C&C. It also serves the purpose of determining what constitutes the "base". The base can extend for up to a ~50 tile radius around the HQ. But the actual base is determined by counting out about 5 tiles from each structure. This way, the base perimiter won''t be too far away from the actual base early in the game and it will prevent any gaps between buildings that would otherwise not be defended without the use of the HQ method.
The area that makes up the base is basically the set of all tiles taken under consideration when making defense decisions. I think influence maps are the best way to determine where an enemy concentrates most of its forces. So the more enemy units that pass over a particular tile within the base will have a higher defense threat. Thus, when considering where to build a defensive structure or place a unit, it will look at this influence map. After enough time has passed without any enemy activity, the tiles defense threat decreases.
Resource Gathering AI:
I think an ant-based algorithm would be the best for this part. The resource units will wander around the map looking for whatever it is they gather. When they find it they will leave the pheromone trail to the resource location. Then, other resource units will follow the trail, just like the standard ant colony...
I also think an evade algorithm would work well with these units. I always hated when my harvester would wander into an enemy base in C&C! >
Attack AI:
I really have no clue. Please help me out with this one!
Other Stuff:
Units will just be FSMs, battalions will be the next command level up, consisting of up to 5 units. A platoon will vary in size. When the user selects a group of units, that is a platoon. I don''t know how I will get the computer to pick a good size for its platoons (unless I just make it constant for the AI but that wouldn''t be very fun). And finally, the main command runs everything at the General level. But this is the other area I''m having trouble with.
Right now I haven''t put too much thought into the upper level functions. Start off slow, get the batallions to work effectively as a team and build from there I guess...
Well, let me know if you have suggestions or new/better ideas. Thanks!
--------------------
Nicholas Skapura
skapura.2@wright.edu
http://skap.8k.com
AIM: skap35