Yeah, when you program using as little memory as possibleyou will start thinking in terms of "how to make the most of n bytes".
So if certain bits are used for what is known as a "bitmask" (encoding a bunch of -usually true/false- properties about something using bits) and the rest is a unqiue identifier... 31 which is (2^5) -1, makes a lot of sense. One byte (which is by convention usually 8 bits), of which the 3 most/least significant bits can be used to encode culture, for instance (there being exactly 7 cultures or (2^3) -1). Simple, huh?
EDIT: This is not to say one byte signifying a faction also signifies its culture in RTW. I have no "proof" for such a claim as I do not have reverse engineered the save file for instance. Who knows what other memory requirements make 31 a useful hardcoded limit to prevent a complete re-write of the memory management code (which is likely in part a residu of RTW itself, seeing both games use the same basic engine) ?
Bookmarks