Age of Kings Heaven 139
Downloads Home
Best Files
Review Guidelines
Main site
Code of Conduct

Advanced Search
AI Files
New Releases
New Reviews
New Comments

Submit File
Browse Categories
New Files
Recent Updates

Downloads Home » AI Files » James I v2.0

Download File Post Review Post Comment

James I v2.0

Author File Description
File Details
Version: The Conquerors
This is my first AI! Written for the Britons, currently has a rudimentary adapting military, working on a variable army that can rush. Plays both RM and DM. Does not use cheats. *Update* v1.7.4: Fixed Building rules. Added early dark age villager scout
v1.7.4.1: Fixed errors in the britmilitary file
v2.0: Complete Rebuild of the James I script. After looking at and playing against other scripts I decided to simplify and change my overall structure. Thanks to all other scripters, you most likely have directly impacted the script, or at least inspired a change.
Pages: « First « 1 [2] 3 » Last »
AuthorComments & Reviews   ( All | Comments Only | Reviews Only )
Campidoctoris You have also improved your script a lot. I’ve tested it against the standard computer and you lost the first game because you had bad luck with initial food resources (few sheeps and any deer) delaying your flush and allowing the enemy became too strong. But in the second game, with an acceptable natural food amount you advanced in a better time (14:54) and smashed the Standard Computer in only 30’, very quickly.

Things to improve:
- Mill: it’s now your first building, and it’s good. You build it when you get your 10th villager. It can be good or not, the best moment is when your villagers are starting to foraging, to reduce walking time. The condition sheep-and –forage-too-far can help you, but if you find any difficulty to make it, you only need to copy it from the Training AI, yes, the same script designed to be a guide for newbies like ours that I mention you every post. Don’t worry about copyright, his author (Bear The Great) gives permission in this script to copy every fragment you need. Although he, and me, recommends that you modify it to adapt those rules to your script. Even if you finally make a completely different mill rule, with this guide you’ll learn a lot. You can download here, in the Blacksmith, you only need to use the “Search” function to find it.
- Lumbercamp: again, the 11th villager can be a good moment, or not. Elite Raider, one of the most famous scripters implemented a few years an algorithm to set the strategic-number (SN) sn-camp-max-distance at an adequate value. If this SN has a value too high, you could build your lumber camp further to your TC than necessary, if it’s too low, you couldn’t not build it if the next forest is too far from your TC. This algorithm can avoid a lot of walking time to your villagers. You can find it also in the Training AI, where it’s explained how it works (I could add you more explanation if you don’t understand it).
- Farms: You have improved your Dark Age economy building them. Anyway, it’s advisable start to farming only when you have built your mill and first lumber camp. In early dark age you still have berries and sheeps, so you can wait a little for them. For the moment it isn’t making your AI worse, at least I see as you build the lumber camp anyway, but once you improve your eco even more it could be a bottle neck.
- Houses. A minimum of housing-headroom of 2 is enough in most cases. But when you build the mill/lumber camp, sometimes you haven’t enough wood to build next house at time, taking idle TC. There are a few ways to avoid it, the most simple it’s force a minimum of housing-headroom of 3. In later ages it should be higher, because you’ll have more buildings producing units.
- Constants and obsolete strategic numbers can help you hugely to improve your script. More information in Training AI.
- Your economy is still pretty unbalanced. You have improved this aspect using the market, and it’s a good idea. But remember that you’ll lose a small percentage of the resources traded in every transaction (smaller if you are Saracen, but even they pay interests). So I recommend adjust better your gatherer percentages to avoid it, even if you only can do it partially. Anyway, your new trading rules have improved your economy. Obsolete strategic numbers can help your AI to identify when you are in Dark Age but you have clicked the Feudal or not, allowing you change your gatherer percentages when you have started transition to feudal.
- One only mill, one lumber camp and one mining camp for gold and other for stone are enough at the beginning. But once you are in later ages you’ll need a few more. For example, in the game that you lost because bad luck, you had won it anyway with more mining camps, when your gold was exhausted you finished cavaliers and longbows production, losing a game in which you had a small advantage. One only lumber camp can make you easier to flush. In Training AI you can find a few rules about. I have them, although modified.

You’ll smash Standard Computer every time, even with bad luck in the start, only with a few extra improvements. Stronger scripts will fall later.
I’ve read your BritMilitary file, and your counter system is interesting and more simple than mine. I’ll study it ;)
jdstankosky As per version 1.7:

I want to point out the following...

You have:
(housing-headroom < 2)
(housing-headroom < 5)

This tells your AI to build a house when you only have room for one more unit or vill. Often times your production is blocked because the house takes longer to build than is desired. I would try increasing this until you notice satisfactory results.

You should make this your House building rule PERIOD. If you need to stop houses from being built, add a goal or condition to that effect, but simply, you will ALWAYS need a house if your are running out of housing-headroom and there's still population-headroom left. There's no need for multiple house building rules.

Granted, you might want to change housing-headroom to < 15 if you are training a LOT of units, which is often the case in Castle and Imperial.

Next Item:

(can-build farm)
(idle-farm-count == 0)
(building-type-count farm < 7)
(build farm))

This will blow you away if you try this:

(can-build farm)
(idle-farm-count < 1) ; I use < 4.
(build farm))

The reason is because with the suggested change, your AI will build as many farms as it needs and none less and as little as only 1 more. It makes a world of difference.

Has anyone mentioned anything to you about buffers? Marathon is the champion when it comes to buffers, but in a sense:

If a Vill costs 50F and a Scout costs 80F, add the following buffer to your train scout rule:

(food-amount >= 130)

This will guarantee that no matter what, the villager gets trained.

Similarly to Farming, if a Farm costs 60W and an Skirm costs 25F and 35W:

(food-amount >= 75) ; Buffer for Vills
(wood-amount >= 95) ; Buffer for Farms

Since honestly, you NEED to prioritize your farming and Villager training over everything else.

I've noticed that you have some rules cloned in your script, one example I can think of off the top of my head is your research feudal-age. You have it in more than one spot. Try browsing through your script and eliminate the extra rules that may or may not cause things to unexpectedly break stuff.

A suggestion for your general strategy:

Avoid forward building like you're doing. It can be great if the circumstances are right, but I watched so many Villagers get murdered and buildings get razed, for what? Nothing. You would be better off keeping your vills close to home than risking them in the field. I think I counted 17 villagers and 6 buildings get destroyed by the enemy computer who's units were waiting for you to get there.

I don't know if you knew this or not, but any building that is destroyed before it's 100% constructed (not if your builder is attacked and the building is canceled, but the building itself actually destroyed before it can be finished) CANNOT be rebuilt for the rest of the game! (not on the official 1.0c patch anyways...)

That's another risk of such an aggressive and foolish forward-build plan.

One last parting suggestion:

I don't know if it's just your coding style and it's easier for you, but your code could do with some formatting to make it easier to read. When people look through your code they can find problems you can't easier. Heck, even YOU might find problems easier! :)

I look forward to the updates! Take heed to Campeador's suggestion of reading through rival scripts. You can learn a LOT! As always though, don't directly copy portions without giving proper credit. Our AI scripting community holds a GREAT deal of respect for one another and our scripting abilities and styles, we wish to perpetuate that spirit of competition!
File Author
Thank you for the continued advice, I'll post an update as soon as its ready!


Updated! Version 1.7.1 now available! As stated in the description this is a massive overhaul with several changes!

[Edited on 02/24/11 @ 01:18 AM]

Campidoctoris Well, your script is improving quite fast. Anyway, even if you script during a few years and become the best scripter in the world, you’ll always find a few things to improve.

- It wouldn’t be bad a second lumber camp in the late Dark Age, at middle feudal at latest. I recommend you to delay your first barracks until transition to feudal and take first the 2nd lumber camp. It will help your woodies, avoiding they became crowded and it doesn’t matter if you build one minute later a barracks which you are finishing anyway earlier than needed. In Training AI, VNS_Halen and other AI’s you can find a few rules to create extra lumber and mining camps in later ages. Choose the ones who you consider better suited to your strategy, modify and adapt them four your tastes and give to the author credit if it’s appropriate. For example, I have taken mining camp rules from Training AI, but I have changed those rules to avoid miners walking along the map because they have exhausted the first mines and my civ need more gold.
- A feudal eco better balanced. When you don’t use archers you always have an excess of gold and lack of food. With a few less of villagers in gold, changing them to food, you could train infantry and skirms quicker and advance to castle faster. It’s not a problem against the standard computer because you have a quite more potent AI anyway, but once you face stronger opponents it can be the difference.
- Town size. If you pretend an AI only for Arabia map (like me, although I’m trying to make my own easy to adapt to everyone) the progressing of your town size is correct, although I’ve only test it a few games. But in Dark Forest (one of the map with less space to building) you have problems in Castle Age. In one game you have an university and much more resources than needed to build a siege workshop and a castle, but your AI didn’t it. I’m almost sure than in the case of the castle it was because your town size is too small for that map (I haven’t seen your siege workshop rule). But in Arabia you build your desired castle without problem.
- Play games from the point of view of the strongest scripts, to watch how they act. It can give ideas to you. Anyway, it’s advisable to give your AI its own personality, there are a lot of ways to catch the victory (Kamikaze trushes, The Horde rushes and then advance to castle, Eagle Revenge KLEWs, Aztec SRN KLEWs or mushes, Lade prepare a few defense in feudal and then it booms, etc).
- IMO, the siege workshop should have a higher priority than the castle, because you’ll need rams if you want attack the enemy in the castle age and it’s well protected by castles. Anyway it’s only MY opinion, and you could stand with your early university if you find REALLY important for your strategy murder holes for your castle or ballistics for your archers.
- With you attacking protocol you won’t attack if you have 59 soldiers and your enemy has only 20. I’d advice you to add a few more rules for attack. You could even try with 6 vs 1, 12 vs 5 and later 20 vs 10 and so on. Of course, the exact numbers are your decision. Crusade can attack even with only 5 soldiers (4 real soldiers + explorer) if the enemy only has the explorer, to punish quickly a possible fast castle enemy. You can do it with different numbers.
- You could study the TSA attack from Training AI. There is an article in which compares it with attack-now and attack-groups commands. Every method has advantages and disadvantages over the rest. Only you can know which is the most adequate your strategy. Crusade used TSA until version 1.1, 1.2 used attack-now mixed with TSA 1.3 attack-groups mixed with TSA. With Crusade 2.0 I’ve returned to pure TSA because I don’t understand the other method too well, but I have the idea to mix att-groups with TSA again but with a different way. My TSA makes my troops less suicidal, but worse grouped and organized, I think I could combine the advantages of every method with a few future experiments.
- After Training AI. More tutorial scripts: VNS_Halen (which is one of the best flushers and a top AI) by VNS_None, Vicky The Vicking by Norman_Duck and Tutorial AI by Berrys66.
- Login to aiscripters. A huge source of information. Once you request to login, you’ll be accepted in 2-3 weeks, the time needed to know that you are not a hacker with bad intentions (this site has been attacked in the past). A good amount of the top scripters post in this site.
- Test your script against stronger opponents. March your next version against a few classical AI’s like Saiyan and Tiger RM. Next step could be Hispain Special and Chong Wong Fei.
marathon Saiyan is too weak imo. Unstable. It often hits 17:xx feudal times.
You could test against it at a later stage, when you want to test your defenses. Right now, I don't think that you have any defensive rules.

IS_Machine is a script that you know that it will rush you in feudal. It is too strong even for testing against it. Try its weakest civs for now, like Persians, Saracens or Koreans. Avoid its deadly Goths and Aztecs.

In early feudal you need wood. Most of all. For buildings and a farming infrastructure. Later you could shift more to food, since you have many farms and you want to advance. In any case, just a few goldminers in feudal. No more than 7 imo, not even with an archer strategy.

You will need a TS expansion system for later ages' buildings.
And you may want a TS reduction for key buildings like Town Centers, so that they are placed closer. And for good defense.
This TownSize problem is complex, but you will have to face it eventually.
File Author
I've been experimenting with TSA and some other things, hopefully will have at least a small upgrade available by the end of the night.


New version available! Version 1.7.2! Contains my thoughts so far on a mixed TSA, attack now strategy.

[Edited on 02/28/11 @ 01:39 PM]

TheLaughingMule Please use the edit button to avoid double posting.

Thanks - Blacksmith Staff
Campidoctoris As always, look at WW-Teutons thread every time that it’s number of comment has been increased, WigWam is also being adviced.

Extra tips for you:
- You have limited your dark villagers to 30. Then it would be a good idea if you reach those 30 researching loom without wait until feudal age. You would avoid idle TC.
- I haven’t seen any TSA rules in your script. It isn’t necessarily bad, pure attack-now could be better, but you have posted that you have added it and I don’t find it. Which file does contain them?
- Balance better your eco. It’s really difficult do it well, even top AIs can have an excess gold and lack of food, etc. I’ve said you that it’s even more difficult with AIs which change their units constantly like ours. One great tool is a dynamic gathering percentages, it’s too long to explain it here, but you can find a few lessons from Marathon to me in Other useful tool could be changing also your units if you detect unbalanced resources, for example train skirms in late feudal if you have +800 food and -200 gold, or archers if gold excess. Phyrexx makes something similar you can study it. Both systems are compatible. Your market can be useful, but those two ways could help you to avoid market loses.
- You stop soldiers training in Castle Age. It allows you a very good Imperial time, but… The reason to spend resources in age advancing is to get new units and upgrades, but you still lacked most castle age techs, while the imperial techs you needed require take first castle age techs (for example long swords if you want champions or xbows if you want arbalests). In my test, you have been smashed by Hispain Special because it has a powerful castle age army while you were in imperial, but with only a few feudal troops poorly upgraded. The only exception to this rules are fast castle strategies, which avoid most feudal techs, but it’s because knights, eagles and monks are not feudal units upgraded, they require advancing to castle age.
File Author
Addressing the TSA-
During feudal I automatically set the town size to an extreme in the hopes of disrupting the opposing economy early. In tests (especially when my opponent builds walls) I've found that it just hurts my economy instead.
-I've been thinking about how to create a more fluid economy and I will definitely read the articles on aiscripters to see how they can help set this up.
-I think there is some other error in the update that is causing the sudden stop in training, I haven't personally experienced this problem, but I will look into it.

[Edited on 03/11/11 @ 12:38 AM]

Campidoctoris It seems you haven't understood TSA. Don't worry, here you have the article:

The key is not the hope to find the enemy, it's advancing step by step until enemy-buildings-in-town.

Of course, the TSA of the example is too fast, it's pretended to be short. You should advance 2 or 3 tiles every step (better 2, IMO), not 20. Exceptions: 5 or 10 tiles per step until TS:60 to find enemy base faster, and 20 tiles per step once you arrive to TS:100 to avoid problems in big maps and team games. Every scripter uses different numbers.

Anyway, your idea about searching more information in other webs (aiscripters) is good. You even could find that you are more happy with attack-now than with TSA. For example, VNS_Halen and MiniHorde are stronger scripts than mine and don't TSA.
Pages: « First « 1 [2] 3 » Last »

Post Review Post Comment

HGDL v0.8.0

Forum Username:


Create a new account
Forgot password?
Favorites: [Who?]0
Size:37.90 KB