| 12-09-2004, 07:03 PM | #1 |
My custom AMAI no longer works in game. There is no error messages or anything in compile, but when you start game the computer is still computer(normal). I don't understand whats happened. Its as if its just stopped working. Also i am not sure if apply table changes is causing weird side effects to ai's. E.g. I set races of player to 2 races and then apply table changes, but the other races that should be removed from certain tables are no longer removed. I not sure if this is whats caused the problem with the AMAI no longer working. Its not much to go on, I know. Just wondering if you know possible reasons for it not working in game without error messages. If not i'll have to give you the scripts. EDIT- aha New question. Would having race folders containing exactly the same stuff as each other so they are identical then compiling cause an issue with the common.ai. I guessing it would. Cause thats what i done and its only thing i can see that could cause. EDIT 2- no that didn't work. o_O EDIT 3- The Apply table changes dosn't always fail. Sometimes it does actually work and remove parts that shouldn't be there or re-adds them. |
| 12-09-2004, 08:11 PM | #2 |
Actually there should be no problem with the race folders containing the same. Maybe I overlook something but since the infos in the racial folders are compiled into separate scripts they should not cause problems with each other. Just make sure that the target script names in Races.txt are different. When computers don't get specific names that means that either the compilation failed or that the threads crash or run into infinite loops. To check what the matter is, put a call DisplayToAll("Script started") at the beginning of function main in the racial scripts. If that text is displayed, then the script actually started which means that it compiled properly. Otherwise there is some compile error that was not recognized by PJass. You could try the newest version of PJass from http://amai.wc3campaigns.com/pjass.zip . |
| 12-09-2004, 08:30 PM | #3 |
yeah. its a compile error. Thanks for that. I'll try the latest pjass. See if it finds anything. EDIT- LAtest pjass didn't work either. Man, where could this error be ![]() |
| 12-10-2004, 07:52 AM | #4 |
I'll guess i will have to work blind trying to find this unknown error. I guess its a common.ai error as none of the racial scripts run so it must be a global error and not specific to a certain race ai. |
| 12-10-2004, 06:53 PM | #5 |
AHA. i found it. I found what was causing it. Took me a long time, but i did it. You cannot place in the race of units in standardunits.txt as HUMAN,ORC this for some reason is not accepted properly and when present in units caused the compile error. It has to be Just a race or all the races as ELF,HUMAN,ORC,UNDEAD So you need to either allow this functionility or error needs to be detected. EDIT - this latest amai version my custom ai has got a longer lag at start even though you say its been optimized. About 5mins just waiting. Before it would be just a few seconds or so. And ill stop multiple posting now. ;) |
| 12-11-2004, 01:23 AM | #6 |
If the time for map scanning increased, then there is likely some error like an infinite loop or something in there. But I did not change anything about the map scanning iirc. Do you have triggers that save the gamecache? The gamecache can run full which causes a huge decrease in performance (it is a hash table and when it gets full then the number of collisions increase a lot). The map scanning uses the gamecache to pass info between the AI players so a nearly full gamecache could increase the map scanning time by a lot. Try a new single player account or try it in multiplayer (like a fake LAN game). |
| 12-11-2004, 09:36 AM | #7 |
I don't beleive i am using gamecache triggers. What i do have is a lot of unit is issued an order type triggers. But i have done something very crafty that seems to have worked. I disabled all triggers that not needed at start of map then once amai has loaded these triggers are re-enabled. It just uses a timer of about 30 seconds to re-load them. This fixed the problem and the amai now loads in its usual 3 seconds. |
| 12-11-2004, 11:54 PM | #8 |
Then likely the unit is issued an order triggers are the problem. To scan the map, AMAI issues 8100 Sentry Ward orders. Which in your case started loads of triggers (or at least checked the conditions). |
| 12-13-2004, 01:33 AM | #9 |
@AIAndy: Just curious, but why did you use Sentry Wards instead of Level 3 Farsight orders? |
| 12-13-2004, 01:44 PM | #10 |
The purpose of these orders is not to see through the fog of war. That is no problem for scripts. Actually the sentry wards are not even cast (except in rare cases). What it does is scan if at a position is pathable terrain. Since sentry wards can only be placed on pathable terrain, the order native returns false if the terrain is unpathable at that position. So as the result of that scan (plus an additional test if the unit moved to that position actually got placed at that position) I get a 90 * 90 grid of booleans that say pathable or unpathable. On that grid a pathing algorithm is then run, that tells which mines are reachable and how far away they are. |
| 12-14-2004, 12:58 AM | #11 |
@AIAndy: Is the grid resolution configurable? E.g. If I increase the grid resolution, will it solve the pathing problem in "Friends" map? (I still see, say Undead Abominations, trying to go the fountain blocked by trees) |
| 12-14-2004, 11:30 AM | #12 |
Yes and no. It can be changed but 90*90 is the maximum you can get because of the max array size in JASS. I will have a look at the friends map to see why it thinks the fountain is reachable. |
