Crusade AI Project
Posted: Fri Dec 03, 2010 8:14 am
I present you Crusade project, my future AI. I’m speaking a “little” about it to receive your conseil and learn about to improve it as maximum.
I want Crusade serves for every civ and setting, but at first it I’m designing its strategies for Saracen civ, because they are a generalist civ and most strategies for them will be useful for others. Always thinking in RM but adding rules that allow more military buildings or faster age advancement if we have tons of resources (DM games or perhaps a few scenarios). When I had created strategies for every civ in Arabia, I'll make strategies for more defensive maps, team games and finally for water maps. Supposing I'm not tired with Arabia, because I haven't got a lot of time and you know better than me that this is an exhausting hobbie.
At this moment I've made the files for constants and the dark age (prepared to function even in non-dark-age-starting thanks to the goal G-INITIAL-AGE).
Well, at first was greatly impressed because surprisingly my AI seemed arrive to Feudal Age in 13:40 (14 villagers and loom researched with NO idle Town Center except the last seconds building first house). Of course with an economy too weak to flush. But today I've tested it again, but in difficult level, in this case my villagers aren't so fast, so I feudal with 31 villagers.
I've copied defrules from Training AI, of Bear The Great, about building extra mill to hunt but modifying it to make it possible in Dark Age. With my superfast advance in easiest I haven't enough wood to make them, but now I can see that perhaps is not a bad idea because now it works. Of course I need test if it causes me problems in wood to another important buildings.
Now the most interesting. My first flush strategy will be based in the famous article by Steve in AoKH (http://aok.heavengames.com/university/s ... map/flush/), and that’s because a I want an AI with a human behavior (as VNS_Halen or The Dragon) buy with a personal touch:
- I only create military units if it doesn’t result in idle TC. Villagers are the most important.
- Wood and farm technologies have next priority. Wheel barrow is important, but only if we have enough villagers (28?)
- I consider a waste pay for a military building and have it inactive, so my barrack will start spamming spearmen, although they will be trained only if haven’t free military buildings or if enemy has cavalry units.
- Later will arrive an arquery spamming skirms, with more priority than spearmen, they are better against enemy villagers.
- We continue with a blacksmith. Once built I’ll allow gold minig, because once I research fletching for my skirms, my archers will be more useful. Then civs with champions (except byzantines) will research man-at-arms because they’re better than spears except if enemy can attack with cavalry.
- Civs with blood lines, as Saracens, will make an stable for scouts. In next flushing strategies other civs will make a second barracks or arquery.
- Finally a market to equalize resources.
Future strategies will be trush (ideal for Spanish, Japanese or Koreans) mining stone in the transition to feudal; mat-at-arms-rush, gold mining in the transition to feudal, researching this tech before get fletching and archers and with two barracks and one arquery); or even with civs without champs train always spears to not waste resources in improve a dead line.
To decide when train counter units, I’ll use a few obsolete SN’s. Their value will be 0 if enemies can’t train that never, 1 if the unit to counter is not created but the building and age allow this, and 2 or more depending of their force (you need more light cavs to arrive to G-THREAT-CAVALRY 5 than knights, for obvious reasons).
When my Saracens flush well, then arrives their “krush” strategy. Starting with lots of monks (something like Arfii, Demon is another great monk rusher but I prefer only one monastery for this AI) and knights. But using as can arquery (for cav archers or foot archers depending of our civ and enemies), barracks for spears (only if enemy knights) and swords as can (if the tech tree contains champions, otherwise spears), specially vs mesos.
For civs without paladins I want use a timer to get knights only at early feudal, although I could make them until imperial transition or getting long swords tech. Even when cav timer isn’t triggered, you train light cav if monk’s threat is higher than swords or camel if it’s cav threat.
For unique units it’s more complicated. For Saracens it’s easy, you train mamelukes if cav threat > 1. But for Vikings I’m thinking about create berseks in castle age and forget them in imperial because barraks are cheaper than castles. For Teutons it’s worse, because I’m training TK’s but I don’t know if make also champs because they are faster. I think no, because to counter ranged units Teutons have better units.
I’ve upload my AI project, so if anyone decides test it and give me ideas I’ll be very glad.
2010, 18th December: The last versions I'm uploading are able to fight decently.
2010, 19th December: Now it's able to defeat stronger AI's, despite that lacks a few necessary rules
2010, 21th December: Its Counter System now works well.
2010, 23th December: Finally completed!
2010, 29th December: Stronger in general. With second barracks when enemy arrives to Castle Age.
2011, 7th January: Its flush starts with spears/skirms and turn later into swords/archers, if necessary.
Crusade 2.0 Mayans and Saracens
Crusade 2.1 Mayans (improved) and Saracens
Crusade 2.27 Britons added
Crusade 2.4 Huns and Persians added. Building system improved
Crusade 2.5 Random civ!
Crusade 3. Prepared for team games.
Crusade 4. Prepared for water maps.
Crusade 4.21. Forgotten Empires civs added. Warning this version doesn't use yet most FE units and techs, and mesos are bugged. Of course this only happends with FE version, for Conqueror versions (with or without UserPatch) mesos and everybody works awesome.
Crusade 4.3. Every setting. Every Forgotten Empires civs can use at least a unique unit and a unique upgrade. Warning this version doesn't use yet most FE units and techs, and mesos are bugged because they can't research heavy eagle upgrade. Of course this problem only happens in FE version, because that upgrade doesn't exist in Conqueror versions.
Crusade 4.41. Prepared for Forgotten Empires. Of course still works with 1.c and UP Conquerors.
Crusade 4.42. Perhaps my last update compatible with 1.c.
Crusade 4.42a. Its only change is the addition of sn-enable-patrol-attack set to 1 for a better battle behavior.
Crusade 4.42b. Now truly compatible with 1.c. Sorry for my mistake with 4.42 version.
I want Crusade serves for every civ and setting, but at first it I’m designing its strategies for Saracen civ, because they are a generalist civ and most strategies for them will be useful for others. Always thinking in RM but adding rules that allow more military buildings or faster age advancement if we have tons of resources (DM games or perhaps a few scenarios). When I had created strategies for every civ in Arabia, I'll make strategies for more defensive maps, team games and finally for water maps. Supposing I'm not tired with Arabia, because I haven't got a lot of time and you know better than me that this is an exhausting hobbie.
At this moment I've made the files for constants and the dark age (prepared to function even in non-dark-age-starting thanks to the goal G-INITIAL-AGE).
Well, at first was greatly impressed because surprisingly my AI seemed arrive to Feudal Age in 13:40 (14 villagers and loom researched with NO idle Town Center except the last seconds building first house). Of course with an economy too weak to flush. But today I've tested it again, but in difficult level, in this case my villagers aren't so fast, so I feudal with 31 villagers.
I've copied defrules from Training AI, of Bear The Great, about building extra mill to hunt but modifying it to make it possible in Dark Age. With my superfast advance in easiest I haven't enough wood to make them, but now I can see that perhaps is not a bad idea because now it works. Of course I need test if it causes me problems in wood to another important buildings.
Now the most interesting. My first flush strategy will be based in the famous article by Steve in AoKH (http://aok.heavengames.com/university/s ... map/flush/), and that’s because a I want an AI with a human behavior (as VNS_Halen or The Dragon) buy with a personal touch:
- I only create military units if it doesn’t result in idle TC. Villagers are the most important.
- Wood and farm technologies have next priority. Wheel barrow is important, but only if we have enough villagers (28?)
- I consider a waste pay for a military building and have it inactive, so my barrack will start spamming spearmen, although they will be trained only if haven’t free military buildings or if enemy has cavalry units.
- Later will arrive an arquery spamming skirms, with more priority than spearmen, they are better against enemy villagers.
- We continue with a blacksmith. Once built I’ll allow gold minig, because once I research fletching for my skirms, my archers will be more useful. Then civs with champions (except byzantines) will research man-at-arms because they’re better than spears except if enemy can attack with cavalry.
- Civs with blood lines, as Saracens, will make an stable for scouts. In next flushing strategies other civs will make a second barracks or arquery.
- Finally a market to equalize resources.
Future strategies will be trush (ideal for Spanish, Japanese or Koreans) mining stone in the transition to feudal; mat-at-arms-rush, gold mining in the transition to feudal, researching this tech before get fletching and archers and with two barracks and one arquery); or even with civs without champs train always spears to not waste resources in improve a dead line.
To decide when train counter units, I’ll use a few obsolete SN’s. Their value will be 0 if enemies can’t train that never, 1 if the unit to counter is not created but the building and age allow this, and 2 or more depending of their force (you need more light cavs to arrive to G-THREAT-CAVALRY 5 than knights, for obvious reasons).
When my Saracens flush well, then arrives their “krush” strategy. Starting with lots of monks (something like Arfii, Demon is another great monk rusher but I prefer only one monastery for this AI) and knights. But using as can arquery (for cav archers or foot archers depending of our civ and enemies), barracks for spears (only if enemy knights) and swords as can (if the tech tree contains champions, otherwise spears), specially vs mesos.
For civs without paladins I want use a timer to get knights only at early feudal, although I could make them until imperial transition or getting long swords tech. Even when cav timer isn’t triggered, you train light cav if monk’s threat is higher than swords or camel if it’s cav threat.
For unique units it’s more complicated. For Saracens it’s easy, you train mamelukes if cav threat > 1. But for Vikings I’m thinking about create berseks in castle age and forget them in imperial because barraks are cheaper than castles. For Teutons it’s worse, because I’m training TK’s but I don’t know if make also champs because they are faster. I think no, because to counter ranged units Teutons have better units.
I’ve upload my AI project, so if anyone decides test it and give me ideas I’ll be very glad.
2010, 18th December: The last versions I'm uploading are able to fight decently.
2010, 19th December: Now it's able to defeat stronger AI's, despite that lacks a few necessary rules
2010, 21th December: Its Counter System now works well.
2010, 23th December: Finally completed!
2010, 29th December: Stronger in general. With second barracks when enemy arrives to Castle Age.
2011, 7th January: Its flush starts with spears/skirms and turn later into swords/archers, if necessary.
Crusade 2.0 Mayans and Saracens
Crusade 2.1 Mayans (improved) and Saracens
Crusade 2.27 Britons added
Crusade 2.4 Huns and Persians added. Building system improved
Crusade 2.5 Random civ!
Crusade 3. Prepared for team games.
Crusade 4. Prepared for water maps.
Crusade 4.21. Forgotten Empires civs added. Warning this version doesn't use yet most FE units and techs, and mesos are bugged. Of course this only happends with FE version, for Conqueror versions (with or without UserPatch) mesos and everybody works awesome.
Crusade 4.3. Every setting. Every Forgotten Empires civs can use at least a unique unit and a unique upgrade. Warning this version doesn't use yet most FE units and techs, and mesos are bugged because they can't research heavy eagle upgrade. Of course this problem only happens in FE version, because that upgrade doesn't exist in Conqueror versions.
Crusade 4.41. Prepared for Forgotten Empires. Of course still works with 1.c and UP Conquerors.
Crusade 4.42. Perhaps my last update compatible with 1.c.
Crusade 4.42a. Its only change is the addition of sn-enable-patrol-attack set to 1 for a better battle behavior.
Crusade 4.42b. Now truly compatible with 1.c. Sorry for my mistake with 4.42 version.