Though we know enough about startpos, there are large areas unexplored which prevent us to improve modding abilities. In CAI area for example there are records partly meaningful, like the sections for factions, regions, slots, etc. But there are also big parts that we cannot handle at all since we know almost nothing like CAI_INTERFACE_MANAGERS , CAI_BDI_POOL , or CAMPAIGN_PATHFINDER.
As you know an element of the game, like a faction, has a record in [...]\CAMAPIGN_MODEL\WORLD\FACTION_ARRAYS and another in [...]\CAMAPIGN_MODEL\CAI_INTERFACE\CAI_WORLD\ CAI_WORLD _FACTIONS. Some stuff from WORLD like Id's are changed in saves and that means in every turn of the game. Those of CAI_WORLD do not. In CAI_WORLD also are included the relations and connections among the game elements and the way AI realize them. The most complex parts are no doubt CAI_INTERFACE_MANAGERS and CAMPAIGN_PATHFINDER.
Some guys in forum have asked to help in this search but that is difficult due the nature if the these files and the available tools. I've started this thread trying to coordinate searching efforts using the same tools available for the same files. This is important if we want to decode records like CAI_INTERFACE_MANAGERS or CAMPAIGN_PATHFINDER. They are full endless lists with a variety of unknown numbers. Existing EsfEditors could not help much to search these areas. EsfEditor 1.5 beta of Erasmus and mainly Taw's esf2xml increase our searching abilities. I've already started exploring CAI_INTERFACE_MANAGERS and I feel as being in a deep dark labyrinth.
This task can have some chance of success if we gather the efforts of the many. So here it is for anybody who likes to take part. Attached you'll find some useful stuff to help you. Using it we will also make sure that we are working on the same startpos file.
The target:
The first thing is to find some normality in those areas, similarities, repeating patterns or/and expressions, etc. For example you will see that there are so many CAI_INTERFACE_MANAGERS as the faction are. In CAI_INTERFACE_MANAGERS\CAI_FACTION_MANAGERS first line is cai faction Id so it is easy to find which one belongs to what faction. In CAI_INTERFACE_MANAGERS\CAI_BDI_POOL are contained the Beliefs, Desires and Intentions of the Ai about the specific faction. If you open the CAI_BDI_POOL\ CAI_BDI_POOL_BELIEFS you'll see that they have a number like Belief ID (first one is 326, then 336 and so on) which are common to all Beliefs in all factions. That similarity probably means that there are certain type of Beliefs (326, 336, etc.)which we should try to decode.
The arsenal
On the attached folder there are:
1. Alpaca's searching tool
2. Erasmus EsfEditor 1.5 beta
3. A starrtpos.esf file
4. A startpos.esf converted in xml
5. Notepad++
6. Python
Alpaca's tool does not need any installation. But you have to install Python before you can uses it. After installing python you are ready to find where numbers are located in an esf file. To do that place your file in Alpaca's folder. You can search any esf file but you have to rename it in startpos.esf. Open a cmd window by entering cmd in START\RUN and point to Alpaca's folder. Alternatively hold shift and right click in an empty (white) area in Alpaca's folder. Let's say you want to search where the number 58283483888 is in startpos. Enter the command:
Code:
python main.py 58283483888 myfile.txt
The utility will create a txt call myfile and there you will see all the paths in startpos that this number is met. You can try any number and you can give any txt file name.
Erasmus EsfEditor 1.5 beta is used basically just to see info. It has labels like 1.4.5 and you can navigate fast in startpos when you know the paths from Alpaca's searching utility. Use it to find some info only and not to edit startpos as it has many bugs and is not reliable at all in saving.
Notepad++ is a very good txt editor which handles and xml files, so it is good solution tofor handling Taw's xmls.
How work it out?
Well there is not a certain way of searching, it is a search after all! Personally I follow deferent approaches. I open a xml with CAI_INTERFACE_MANAGERS and I try to track down where the numbers link using Alpaca's utility to get the paths and then EsfEditor. Another way is to compare records and see if there are nay similarity, repeating pattern, etc. It all depends on the mood and the inspirations you have at that moment. It is not an easy task and needs some time to get used startpos lists. But I strongly believe that we can get some light in these dark areas of startpos improving the current modding abilities. Please concentrate on areas that we do not know yet. If you have doubts post a question.