
With this format, the size of the game's assets can be reduced. With the XML format, a lot of information is repeated in various places. Script Files are effectively compiled (XML files/data tables). These work through a 'Spoofing' system which will show default items for peers that do not have the added content, but will show the correct item if they do have it.

These exist for items such as Masks all the way to Weapons.

Through the module system, modules for the 'adding' of content have been created. Some may seem pretty basic, such as the 'LocalizationModule' but in practice is very helpful. The module system works as a way of allowing mods to have particular features without a lot of manual implementation. If a mod has setup a particular Script File to be modified/replaced/added then that will happen when the game attempts to retrieve data from that file.Ĭurrently, BeardLib supports a lot more than what I mentioned above, it is now a mod framework through the use of the 'Module System!'. This is achieved through intercepting the 'PackageManager:script_data' function which the entire game uses to obtain lua tables from a particular Script File. The original version primarily included support for 'replacing' Script Files at Runtime through LUA. When you do math on these repeating decimals, you end up with leftovers which carry over when you convert the computer's base 2 (binary) number into a more human readable base 10 number.The purpose of BeardLib is to provide tools for modders to create quality and more advanced mods without repetitive implementation of basic or advanced features. So 0.1 and 0.2 (1/10 and 1/5) while clean decimals in a base 10 system, are repeating decimals in the base 2 system the computer is operating in. While, 1/5 or 1/10 would be repeating decimals. In binary, 1/2, 1/4, 1/8 would all be expressed cleanly as decimals. So you can only express fractions cleanly which only contain 2 as a prime factor. In binary (or base 2), the only prime factor is 2. In contrast, 1/3, 1/6, and 1/7 are all repeating decimals because their denominators use a prime factor of 3 or 7. So 1/2, 1/4, 1/5, 1/8, and 1/10 can all be expressed cleanly because the denominators all use prime factors of 10.

When you have a base 10 system (like ours), it can only express fractions that use a prime factor of the base. Why does this happen? It's actually pretty simple. This representation comes with some degree of inaccuracy. Computers can only natively store integers, so they need some way of representing decimal numbers. Your language isn't broken, it's doing floating point math.
