Re: Monster AI
Well, our new house finally got a phone connection, so I am back Online. I worked on warship design for my AI for a couple of days, doing the attack/defense ships/bases and the colony ships. I then decided to run a test game and ran into a stone wall at exit from second bankruptcy turn 88-89. I thought at first that I had busted the game with my 915 colonies with yards, but it turned out that the game engine still can handle it. Unfortunately it takes **** 9000 seconds **** more or less to execute a single turn when building ships/units. It only takes a couple of minutes for 915 colonies when doing only facilities. It only took a few minutes with 186 of 915 colonies with yards at entrance into second bankuptcy. So execution time when specifically building ships/units is directly proportional to the SQUARE OF THE NUMBER OF YARDS AVAILABLE times some HUGE number of instruction cycles. My best guess is that the AI has no memory at all of which is the fastest yard available, and rather than cycle through all colonies ordered by yard rate and number of turns already scheduled, it cycles through colonies in the order planted. So for every single colony with a yard it does an evaluation of every single other colony to see if that colony would be a better choice for building the current item. If there is a better choice then it moves on to the next colony in the list. The item gets sheduled only if there is no better choice available compared to the particular current colony. When it has run through all the colonies and has scheduled something, then it starts the whole charade over again and basically repeats the cycle up to 30*30/2 times depending on how many different yard rates are available. Then if the current item in the ship/unit queue is successfully fully scheduled, the whole process basically starts all over again for the next queue entry. When at least four or five turns of work has been scheduled at all colonies then nothing gets scheduled and the circus grinds to a halt for the current turn.
I have a Compaq Presario with AMD K-6 3d processor bought in 98. It runs Windows 98 Year 2000 Update 2 operating system and has 64 megabytes of memory. With SE IV running it reports 77% resources free during a turn, but there is no way to check while the AI is running to next turn because the minimize to windows button is ignored during the AI processing of a turn (another issue). Nevertheless I think that the execution time is NOT due to my computer limitations but instead to the generation of TRILLIONS of instructions by the AI engine. I did my first AI in 86-89 by rewriting a public domain 4x game called "Conquest" for the Commodore Amiga. I also wrote a performance analysis tool called "Debugger" to study the game and improved its execution time by a factor of 50+. In 91-92 I spent a couple thousand hours writing my own 4x game for the Amiga called "Galactic Zoo". I abandoned it and released it as public domain in 92 when some people who looked it over said that nobody would play it because managing an empire looked too much like work. A year or two later the first Versions of Civilization and Master of Orion came out and became big sellers, proving the analysts wrong, but by then my Amiga had died from over 20000 hours of hard usage.
In case you other folks in this forum did not know it, a (labor intensive) strategy game pays a breakeven wage to the developer compared to a regular job only if it sells 100-500 THOUSAND units depending on the royalty percentage per unit actually sold delivered to the developer. Game writing as a profession SUCKS. So my sympathy goes out to Aaron fighting an uphill battle just to pay for rent and groceries. OTOH his AI engine is LOUSY on an absolute scale although it is ok compared to what many game designers put out. The absolute scale I use for comparison is the AI for the Space Shuttle, which I became familiar with while working on simulations at JSC in 79-81 and again in 87-88. Since tens of MILLIONS of dollars are spent on improving that AI every year that may not be very fair, but it does give me an idea of what is POSSIBLE. During the past few days I have fought the AI engine in my game uphill to reach turn 125 at which time it is finally building some ships besides colony and minelayers, rather than skipping their queue entries (another issue). While waiting the long hours for each turn to process I am unable to use my computer to do anything else. I have spent the time staring at the screen and speculating as to just WHAT THE **** he may be doing with his AI engine that takes so ******* LONG. I think by now that I have a fair idea, and am in the process of writing a LONG list of DETAILED suggestions to improve the execution time, plus reporting yet more bugs/features observed during this test game. My original interest in this game was for playing, but the AI was not challenging enough. My second interst was development of an AI that could survive at the center of Nexus maps, but that has been overridden by my latest interest. That interest is HOW THE **** can this ******* AI engine be improved to manage over 1000 colonies with yards and still take only a couple of minutes per turn. If I can get him a factor of 50-75 execution time improvement as on earlier games without even seeing the source code then I can later brag about that too. So Aaron and his game distributer get free labor until I can resume work on my AI, which is also free labor of course, but somewhat more personally satisfying.
I will not post save game files for this current test game because I already posted files in the scenario/mod archives for the previous one, which is of similar size. What I thought was a lockup after the Last save of the previous game almost certainly was NOT. It just never occurred to me that a game could possibly take over an hour to process a single turn for a single player and be functioning as designed. The only reason why the game was allowed to run a turn to completion at exit from second bankruptcy in this test game was that I was very tired, had no phone to go Online with, and just did not bother to hit CTRL ALT DEL and exit the game before going to bed. To my extreme surprise, when I got up in the morning the game was waiting for me at the next turn! I also will not bother to post the AI minister bugs/features because nobody commented on my previous postings and they are a matter for the Beta testers and MM to resolve. So until the AI engine is 50 times faster there will be nothing else to report about my AI.....
Edit :
It is probably 30 times not 30*30/2. I do not know why I thought it was that way when I posted. I need to catch up on my sleep again....
[This message has been edited by LCC (edited 01 August 2001).]
|