I found some possibly unsafe codes (for example null value unchecked before passing into other functions) in rules/scripts and I am trying to fix the crashing that is happening when I play a 8-player toughest AI game for more than an hour.
The crashing is reproduce-able (loading the same .sav file will end up crashing at the same time no matter what I do between the loading and the crash, and each crashing happens at the exact same code when opened in disassembly debugger) so it is likely an AI issue.
However I found out that even if I change the function names in prodai_lib.bhs, for example, to some random names the game won't give error when starting up so it is likely the files in rules/scripts are not compiled every time as those in Data/spells, I am wondering how should we specify so that they are compiled every time?
-------------------------------------------------------------
UPDATE:
This is confirmed as a bug of the game itself, has nothing to do with AI and I have posted a fix in the link below
http://rol.heavengames.com/cgi-bin/forums/display.cgi?action=st&fn=2&tn=994&st=recent&f=2,994,0,10
However, it would still be helpful if I can re-compile rule/scripts so anyone knowing how to do it please let me know.
-------------------------------------------------------------
I figured it out by myself. It is actually pretty simple; For example, to make the game re-compile Vinci rules(and all included files), just change the following field in Data/tribes/vinci.xml to anything other than vinci.bhs;
Then copy the vinci.bhs and re-name it to the new file that you put in the PRODAI_SCRIPT field. Apparently if it is the default script then the game will use a pre-compiled version and ignore the script file but the game WILL actually re-compile if it is a non-default script
The crashing is reproduce-able (loading the same .sav file will end up crashing at the same time no matter what I do between the loading and the crash, and each crashing happens at the exact same code when opened in disassembly debugger) so it is likely an AI issue.
However I found out that even if I change the function names in prodai_lib.bhs, for example, to some random names the game won't give error when starting up so it is likely the files in rules/scripts are not compiled every time as those in Data/spells, I am wondering how should we specify so that they are compiled every time?
-------------------------------------------------------------
UPDATE:
This is confirmed as a bug of the game itself, has nothing to do with AI and I have posted a fix in the link below
However, it would still be helpful if I can re-compile rule/scripts so anyone knowing how to do it please let me know.
-------------------------------------------------------------
I figured it out by myself. It is actually pretty simple; For example, to make the game re-compile Vinci rules(and all included files), just change the following field in Data/tribes/vinci.xml to anything other than vinci.bhs;
<PRODAI_SCRIPT> vinci.bhs< /PRODAI_SCRIPT>
Then copy the vinci.bhs and re-name it to the new file that you put in the PRODAI_SCRIPT field. Apparently if it is the default script then the game will use a pre-compiled version and ignore the script file but the game WILL actually re-compile if it is a non-default script
[This message has been edited by modder00 (edited 09-03-2016 @ 11:22 AM).]