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

Advanced Search
Utilities
Home
New Releases
New Reviews
New Comments
Top-Rated

Submit File
Browse Categories
New Files
Recent Updates

Downloads Home » Utilities » AI tricks

AI tricks

Download File Post Review Post Comment
Author File Description
WizardBoy
File Details
Version: Age of Kings
This is a very useful AI when you like to have different things been detected or viewed.

Some of the AI's i have include:

Wood detection -> will send a chat message that you have a certain amount of wood, i know its a basic one but i tought it would be good to add.

Goal detection -> this will detect when a specific goal is achieved. By using triggers to detect the goal you can then make a message appear from the AI that says: Mission complete.

Spy player -> this AI will reveal the map when it has 1 villager. Of course you can edit it to your wishes.

I hope you will like them. Please give me credit for it. Any comment is welcome.
AuthorComments & Reviews   ( All | Comments Only | Reviews Only )
dave_earl “New AI Tricks” is a utility containing four short .ai/.per files. They are labelled “Cheat Warning”, “Goal Detection”, “Spy Player”, and “Wood Detection”.
AI stands for “Artificial Intelligence”; and these files should be used to control computer players. I am assuming Wizardboy intended us to use these ai files for custom scenarios.

I was planning to do a formal review of this utility, however, I have decided against it. Simply, the ai’s generally do not work; and are therefore not useful.

I will outline the difficulties with each specific ai, and then some general concerns. Wizardboy, I am aware that this is a modified version of a file from SWGB Heaven, which is fine, but you really need to test your files more thoroughly before uploading them to The Blacksmith.

The first ai, “Cheats Detected”, contains the following code:

(defrule
(true)
(cheats-enabled)
=>
(chat-local-to-self "You do not need cheats!"
)

Unfortunately, it has several issues. Firstly, the (cheats-enabled) condition detects whether or not the “Cheats Enabled” feature is selected for a multi-player game. It does not detect whether or not someone has used cheats. Thus its application in a custom scenario is, to put it mildly, limited. Secondly, the line beginning with “(chat-local…” is missing a closing bracket, so will not be accepted by the game engine. An error message will appear whenever the ai is loaded and it will not be used. Thirdly, the effect “chat-local-to-self only displays a chat message to the player to whom the ai belongs- for debugging purposes usually. The only person who will see the message is the computer. Should the message have been visible to the other players, it would be continuously repeated, as there is no “disable-self” effect to stop the commands looping.

The second ai, “Wood detection”, contains the following code:

(defrule
(true)
(wood-amount == 500)
=>
(chat-local-to-self "500 Gold have been transferred to your account")
)

Firstly, the ai contains two conditions. “True” always fires, so there is no point in it being there. “wood-amount == 500” detects when the computer player who is using the ai has exactly 500 wood, which is fair enough. When the computer player meets these two conditions, it tells itself it has received 500 gold. Nothing is transferred, and only the computer player can see the message.

The third ai, “Spy Player”, contains:

(defrule
(true)
(cc-players-unit-type-count 1 villager 1)
=>
(spy)
)

Firstly, the command “cc-players-unit-type-count 1 villager 1” will no work as it is missing a relative operator. Put simply, a relative operator is a mathematical symbol which allows the computer whether to test if something is true. For example: greater-than (>) or less-than (
(chat-local-to-self "Mission Completed"
)

Again, there are several problems with this script. Firstly, the both the lines beginning with “(goal 1;x ….” and “(chat-local…” are missing closing brackets so will generate an error message at the start of the scenario. Secondly, there should not be a semi-colon between the “1” and the “x”. More crucial, though, is the fact that the “goal” condition is the incorrect fact to test in this case.
Goals are user-defined conditions which the computer can test. Consider the following script:

(defrule
(wood-amount == 500)
=>
(set-goal 1 1)
(disable-self)
)

(defrule
(goal 1 1)
=>
(chat-to-all "Goal 1 is set to 1")
(disable-self)
)

In the first rule, the ai would set its internal goal 1 to setting 1. In the second rule, it would realise that its goal 1 was set to 1, and sent a chat message to all players.
What Wizardboy needed to use was the condition “event-detected”. The scenario designer would need to use the trigger effect “AI script goal”, selecting the computer player and the “AI trigger number” 1. The following code would then need to be in the ai:

(defrule
(event-detected trigger 1)
=>
(acknowledge-event trigger 1)
(chat-to-all “Mission completed”)
(disable-self)
)

Finally, even if the first part of the ai worked then all that would happen is that the computer would tell himself “Mission Completed”).

Some general observations about the scripts:

i) The folder that “readme.txt” recommends extracting the ais to is incorrect (“X:\program files\microsoft games\ai” should be “X\programs files\microsoft games\age of empires ii\ai”).
ii) The scripts included would have been better appended to some sort of “Immobile Script”. When many parameters are not set they default to standard; thus the computer player who is using the ai would be doing all kinds of strange things.
iii) Generally, to get any of these ais to work at all, some knowledge of ai scripting is essential. As these commands are some of the most very basic commands available. it seems unlikely that anyone who could get them to work could not write them themselves in less than a minute.

I’m sorry, Wizardboy, but these tricks are not useful at all. I know you have a great deal of enthusiasm for ai scripting, but would suggest you practice a bit more before posting scripts. I found Berserker Jerker’s “The AI Tutorial for Scenario Designers” article at the Tsuniversity very useful: http://www.tsuniversity.com/articlepreview.php?133.
Tanneur99
Official Reviewer
I moved the file from AI Files.

Even though the .zip contains AI files, dave_earl stated correctly that it is a utility.

The AI files do not work as intended, but combined with the comment above they serve as a valuable utility.

-Blacksmith Administrator

Post Review Post Comment

HGDL v0.7.1

Login
Forum Username:


Password:




Create a new account
Forgot password?
Statistics
Downloads:345
Favorites: [Who?]0
Size:1.59 KB
Added:02/25/06