Posted: Mon Dec 09, 2019 12:54 am Post subject:
AI Join
Subject description: A tool for joining multiple aimd.ini files together
This is a small program for joining more than one aimd.ini files for Red Alert 2 together. With this program you can work on and test different parts of your AI separately, then automatically combine all the parts together without having to worry about anything having the same ID# or having to edit the TaskForces, ScriptTypes, TeamTypes, or AITriggerTypes lists. This script can also join together 2 or more fully built AI files to increase the variety of attacks and make the AI more unpredictable.
To use the program just give each aimd.ini file you want to combine a different name and put them in a new folder together with the ai-join.exe file and run it. It will create a new file named joined.ini, just rename that to aimd.ini and copy it into your Red Alert 2 directory to use it.
I've tested running the program on Windows 7 & 10 without problems, but if it doesn't run or you notice any bugs just let me know. The python source code is included and available at
Could be useful if testing individual triggers in a new ai.ini file and later merging it to the main INI.
For understanding, will use key or index for left of = and to the right side of = will use value or ID.
Cross referencing IDs causes the complexity when merging two of these game files. I also thought of a tool to merge 2 maps but had to drop the plan because of this, maps have far more complex cross referencing.
If the same TeamType/ScriptType/TaskForce or even the AITriggerTypes is used in both INIs, with case of IDs being same or case of IDs being different but content of the sections being same, processing is like the added one gets new ID and its references are changed. This results in duplicates. There is no way to know whether the user wants to use a common section or different.
Check if any of following duplicate handling is needed and is covered for your tool within a single INI:
- List duplicates (TaskForces, ScriptTypes and TeamTypes) are ignored by the game if either index or ID matches
- Index duplicates in AITriggerTypes are ignored (should be, need to test)
- For the remaining, section duplicates are overwritten
- Within a section, values of index/key duplicates are overwritten
- TaskForces, ScriptTypes and TeamTypes can't have same IDs, those should be unique
- AITriggerTypes index which looks like ID can be same as any IDs from TaskForces, ScriptTypes and TeamTypes
- Sections with IDs which are not in lists are useless, can be removed, this could be done after merging the contents
Others:
- Could use some other method to get the input files. When people make backup, they use Ctrl+c and Ctrl+v which results in a copy of the file with same extension in the same folder.
- Instead of random ID generation, a fixed number could be used to start with and then increment it, so that consecutive entries are close by. Or even prefix the existing IDs like AI01- etc. if length permits.
- TeamTypes index could also start with 0 instead of 1
- Could use logging to the console or to a file to inform of any errors or duplicates. QUICK_EDIT
I fail to see the utility of this tool, once you have tested your special case trigger/script, you should understand how it works without needing to merge it with a full AI.
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum