BCON Limits
There was a discussion on one of the Discord groups I'm a member of about adding extra global BCON resources, and also how many entries you can have in an individual BCON.
There is a lot of "received wisdom" out there, but no hard facts, so I decided to do some digging.
At first glance, it would appear that global BCONs run from instance 0x0100 to 0x0FFF, local BCONs from 0x1000 to 0x1FFF and semi-global BCONs from 0x2000 to 0x2FFF - like BHAVs. And the number of entries in any one BCON from 0x0000 to 0x7FFF.
BUT, BCONs have to be accessed via the "0x0002 - Expression" primitive and that imposes additional restrictions.
There are TWO ways to access a BCON via the "0x0002 - Expression" primitive - "Const BCON:Entry" ...
... and "Const BCON:[Temp X]".
For "Const BCON:Entry", two bits are used to encode the scope - global, semi-global or local - seven bits are used to encode the entry, and seven bits are used to encode the BCON's instance.
This limits the maximum number of entries in a BCON accessed this way to 128 (0x00 thru 0x7F) and the instance values of BCONs to 0x0100 thru 0x017F, 0x1000 thru 0x107F and 0x2000 thru 0x207F.
For "Const BCON:[Temp X]", two bits are used to encode the scope - global, semi-global or local - three bits are used to encode the Temp, leaving eleven bits available to encode the BCON's instance - but not all bits are used.
The maximum number of entries in a BCON accessed this way is 32,768 (0x0000 thru 0x7FFF) - if your code ever gets close to that I suggest you get therapy!
The theoretical instance values for BCONs is then 0x0100 thru 0x08FF, 0x1000 thru 0x17FF and 0x2000 thru 0x27FF, HOWEVER, the game engine limits global BCONs to 0x0100 thru 0x01FF, and only 10 bits are used for local and semi-global BCONs, that is, 0x1000 thru 0x13FF and 0x2000 thru 0x23FF.
Hope these notes are of use to someone. Enjoy!