--------------------------------------------------------------------
--------------------------------------------------------------------
I know I'm not topping the newest thread here, but "just because something's old doesn't mean you throw it away." (Geordi, "Relics")
This file contains "AI Building Requirements" (hence the name). To prevent the AI from building a covert sensor array in that tiny pop 60 system that just can't make use of it, this file contains some minimum values that a system must provide for each building, before the AI can build it in that system.
In aibldreq.bin there are 77 data groups, each group contains the data for one building. Some buildings are left out (see below). Each group consists of 6 integer values (4 bytes per value), some of them are signed (see below).
1st value (not signed):
Building ID.
The file contains every building with an ID of 0x57 or less, except for shipyards and emergency morale programs. It does contain "Trade Goods".
2nd value (not signed):
Current population that the system must have before the AI can build the building there.
3rd value (not signed):
Maximum population that the system must provide before the AI can build the building there. Planets that have yet to be terraformed are not counted in.
4th value (signed):
Required enery for the building (quite obvious if you look at the values in the file). The AI is able to ignore this value, at least sometimes. At least 2 buildings don't have the correct value by default (Phoenix Facility and Obsidian Order).
5th value (signed):
Unknown.
If the value is set to +100 or less, the AI seems to be able to build the building everywhere (unless another restriction is not fulfilled, of course). If it's set to +101 or more, the building is not built at all.
6th value (signed):
Unknown.
This value does not seem to be used at all. By default, it's +1 for the labor camp, +2 for the forced labor farm and -10 for any other building. I gradually increased this value up to +1280 and also tried changing it to -256, with no effect at all.
As a "side effect" of the tests, I gained some insight into the building behaviour of the AI:
- The AI will rush-buy most buildings. On the other hand systems will often just sit there producing nothing.
- The AI ignores the "once per empire" restriction, instead the restriction is treated as "once per system". Thus, it can (and will) build multiple Great Halls or Genesis Labs, for example. And all of the buildings will have their full effects. To work around this, you could either restrict certain buildings to "home system only", or, if you're playing tech 5 and the respective building is already present in the AI player's home system, then you can use one of the two population-related values in aibldreq.bin and set it high enough that it can't be reached by any system.
- The AI can build Isolinear Scanners without having to build Subspace Scanners or Listening Posts first.
- Among the buildings that are available for a system (and included in aibldreq.bin), the AI will build the building with the lowest ID first, working its way down the list. When the ID 0x12 (trade goods) is reached, the system will explicitly build "trade goods" for one turn, then move on the next building. Other buildings (ID > 0x57) and shipyards can be built in-between when needed, also sometimes a system will just "have a break" and do nothing for one or more turns.
- However, the AI will not build an Orbital Battery when it "reaches" the corresponding ID, instead the OB will just be ignored. The AI will, instead, build one OB per 50 millions of population (rounded down).