Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IE - One Sided AI: Fixed!
#1
I've been working on debugging an error that mysteriously popup in AR2. The game ONLY crashes when I play against a Genesis AI. I have debugged for days and countless hours for the past couple of weeks. I've already determined that it is not the AIMD.ini because I have every trigger commented out currently. The game still works with the old rules and no active AI Triggers.

The game either crashes while the credits are loading up, 3861 Credits (except2.txt), or several seconds afterwards (except1.txt).

I have debugged in many different ways. At first I was converting an older working rules into the newer broken rules, slowly copying over all the general changes and testing. I did find 2 errors, both corrected. However, they aren't the cause of the IE that is happening currently. Finally, when I got the game to start causing the same IE as the broken rules, it was inconsistant. I couldn't track if the IE was connected to a building or what. Sometimes the game would IE at the start, sometimes I would be able to play a whole game.

I also tried putting all the  tech levels of the buildings except the Conyard to -1. My plan was to slowly re-enable each building. However, with just the MCV enabled it crashed. So I wasn't able to get anywhere with this method.

Two changes that were done before this IE started to occur were: Renaming and reordering the Building, Unit and Infantry Lists. I have taken the old rules and reordered the lists in the same manner as the newer rules and there was no IE. So for the moment, I have concluded that it is not the cause.

So if anyone has experienced this error before, has any idea why the one AI would cause the crash (on all difficulty levels), or can read the except1.txt and except2.txt, feel free to enlighten me. I'm pretty positive it isn't building code because if I play as Genesis against a Nemesis AI I can build every structure and unit without error. I do know that it's possibly caused by general AI code, building list order, or the renaming of most units and structures. Yet, I'm stuck now without any direction. Thanks.

Details
Only occurs when AI is Genesis.
Crashes while the credits are loading up: 3861 Credits, except2.txt
Several seconds go by: except1.txt


Attached Files
.txt   Less than 1 minute ago">except1.txt (Size: 25.37 KB / Downloads: 366)
.txt   Less than 1 minute ago">except2.txt (Size: 25.35 KB / Downloads: 363)
Reply
#2
Well it appears I fixed it. AIBuildThis=yes was somehow commented out on the Construction Yard entry. That creates problems. Yay! Smile The plus side of all the debugging that I did is that I found and fixed 2 other IEs. It just took a little more thinking. Thanks everyone for letting me post my dilemma here. Work on AR2 continues. Smile

So someone should add to the guide for the AIBuildThis= tag, that a Construction Yard MUST have this set to Yes, else you get a crash at the beginning of the game when the AI plays as that side.
Reply
#3
Now that's a detailed problem report Smile
I've added this to the appropriate ModEnc page, but for the record, you people can add/edit information on ModEnc yourselves too. Wink (And should do so Wink .)

Worth playing: 1 | 2 | 3
Reply
#4
when you say re-ordering buildings, what exactly do you mean? changing the order of the original buildings will cause you problems. re-numbering is ok, but not re-ordering, only re-order units, infantry and if you ever need to, aircraft.
Reply
#5
He means re-ordering as in changing the order of entries on the lists. The numbers do nothing anyway. Re-ordering is fine, but it can screw up the AI, since aimd.ini references objects by their place in the list, rather than by name. We are redoing the AI for AR2 completely, so this is not a problem.

On a side note, it seems that the AI uses the order that structures appear in their list to some extent in determining build order.
[Image: alexstand1.gif]
Reply
#6
jkraska Wrote:The AI "walks" (from top to bottom) through the structure list. If it finds something it can build, it builds it, and then moves on. If it doesn't have a prereq, it goes back through the list (again, from top top bottom) seeing if it can satisfy prereqs again. If it believes it has built everything, it stops building defenses also.
Source

Worth playing: 1 | 2 | 3
Reply
#7
Oo! That clarifies a lot. Thanks!
[Image: alexstand1.gif]
Reply
#8
Yeah, but: BuildPower, BuildBarracks (I didn't mod a long time so I might reference wrong tags), etc. are hardcoded (power goes first, then barracks, then refinery, etc.)
Also, when I experimented with this, it sometimes didn't do exactly what I wanted, I think TechLevel has something to do with that.
Reply




Users browsing this thread: 1 Guest(s)