Technical reasons for fillType limit?

Your forum for all discussions around Modding.
XPModder
Posts: 80
Joined: Thu Oct 30, 2014 2:45 pm

Technical reasons for fillType limit?

Post by XPModder »

I was wondering if there is any remaining technical reason for limiting the number of fillTypes to 255 in FS22?

I know that originally this was likely done because the game stored something about fillTypes in a single channel of an image file, or the fillTypes were limited like this for parity with something else that was stored that way.
In FS22 however, to my knowledge, fillTypes are never actually stored in any other way then in xml files.
FillTypes only exist in vehicles (or objects like pallets, which are also treated as vehicles by the game) and these are stored in xml files (eg vehicles.xml in a savegame). Internally in the game, fillTypes are stored in lua tables, which can easily hold much more than 255 elements.
In summary, as far as I can tell, the only reason for fillTypes to be limited to 255 is because NUM_SEND_BITS in FillTypeManager is set to 8 in the basegame lua scripts.
Due to the number of fillTypes now included in the base game and dlcs, they are getting close to this limit and a single mod, but especially installing multiple production point mods can easily exceed this limit.
I am working on a map mod and have, using a script, set NUM_SEND_BITS of FillTypeManager to 9, increasing the number of fillTypes to 511 and have so far in testing never encountered any issues.

Does anyone know if there is any remaining technical reason for the limit to be at 255?
Das Universum ist unvorstellbar groß und wir sind im Vergleich dazu winzig.

Daher kann mir jemand der unter uns Winzlingen Unterschiede in Hautfarbe oder Herkunft sucht, nur Leid tun, weil seine Sichtweise so begrenzt ist!

Fremdenfeindlichkeit ist Menschenfeindlichkeit!