On gamestart every map will get a unique ID, a file will be openend with this ID as name and a single line will be written to it if it is the first use on this map: "true". This functionality is of course enabled/disabled by a win condition flag like AI highspeed. "true" does mean the AI will use the old terrain analyzer function. Around the old function a wrapper is coded, writing "false" into the file before and overwriting with "true" after the function is called. This wrapper and the old function are only used if the map did not have a "false" in its file on gamestart.
So what will happen ? If the battle ends and the game did not crash, we have a file with unique map ID, "true" written to it. So next time this map is used the old function is used again. If the map crashes the state written to file will be "false" and the old function will not be used next game. Therefore you will only encounter a single crash on any map at max. After multiple runs over all maps you will have a fine collection of files reflection the state of these maps. These files can be distributed with the AI so people don't have to encounter crashes at all if they want to use this AI Map DB functionality and toggle it in win conditions.
I have it coded and working. I tested on 20 maps so far and now the most astonishing part : I did not get a SINGLE crash, even in big battles with 8 AI players !!!
Is it possible that Relic did fix their HasThreadOnPath() function ?
Let me know if you are interested and I can give you the code.
Edited by LarkinVB, 01 April 2009 - 06:47 AM.