AI Editing and Information

Started by Kernel64, March 02, 2010, 11:58:43 AM

Previous topic - Next topic

Kernel64

So far, I've come across a few tidbits that could help in developing the AI scripts.

1. The Phase/State the AI is in is time controlled. Can be edited at NotHard file. Not sure if two states can run side by side. For example, Open and MidGndA.

2. AIClearStock() resets the AI in some way.

3. defaultExpansion function can be controlled by modifying the gas and mineral entries. As it counts every mineral and gas close to a TH, you can set the mineral and gas entries to trigger the AI to expand.

4. There are three modes of expansion: default, VitalHard, and Normal
     a. vital hard seems to include gas structures automatically

5. You can add if and while within the [race]0 files.

6. You can define functions there and call them in a "goto" sort of way. So you can actually make a loop between two functions.

7. The AI will rebuild stocked units through AIstock unless the AIClearStock is called.

8. AIStockandWait can be used in an if(!). This function automatically stocks in a unit or structure if the AI doesn't have it. Other actions following will wait for this to be true before being run.

9. TechCount using ordercompleteonly can also be used to make if statements. Works like AIstockandWait.

10. AIstock function does not run one after the other. The AI engine may decide to build/train the next cheapest item.

Things in mind/to test:

1. Is it possible to edit the retreat and attack items in order to make the AI not dance? Say increase the time before attacking in the section where the AI is not in combat but is not too weak? Can the difficulty be 2000 and set the ai's APM to 75 and not bog it down to achieve this result instead?

2. Is it possible to add randomization and enter build orders within each of the multiple openings and following MID and Lates through if statements?

3. Is it possible to use Counterunit and allow the AI to decide what unit to train while utilizing AIClearStock() to completely change the AI's unit composition and Base composition? Or is it better to use if's and randomization instead? Can we make the AI take information and as such use that information to call specific custom functions suitable to handle these information?


That's it for now. I'll update whenever I find more or make progress. Note that the exact terms are not there. I can't remember them all at this time, but will update them for those who are not familiar with the code.

hd

Is there any way to turn on a sort of debug mode that will spit out errors in the ai code? would make it a hell of a lot easier to track things down  ::)


hd

Quote from: itsarabbit on March 03, 2010, 02:59:34 PM
http://darkblizz.org/Forum2/ai-development/ai-script-editing-tool/
It will feature a debug mode.

i'm quite curious how he's going to put in debugging without a complete list of available functions, constants, variables, etc. and executing the code without the information, you won't know if a variable is returning null, or incorrectly, if a function is failing, where it's getting hung up, if there's bottlenecking in ai orders/builds/etc.

Kernel64

Maybe the app will debug only simple things like ";" "{}", or "(())" things. I don't know, but I'm hoping he knows of the code and this app would provide the functions and what they're for, etc.