Duke's Big Numbers 1.0
C++ and Blueprint libraries for performing math, analysis, and formatting with really large numbers (>10e308).
|
In case of corrections and errata, the most up-to-date on-line version of the documentation for this release of DBN is available at https://smilingcatentertainment.com/api/docs/DukesBigNumbers/1.0.
In case of new releases, the most up-to-date on-line version of the documentation for the most current release of DBN is available at https://smilingcatentertainment.com/api/docs/DukesBigNumbers/current.
Duke's Big Numbers (DBN) is a C++ code plugin for Unreal Engine (UE) with Blueprint support that enables calculation, storage, and formatting of VERY LARGE integer numbers with full precision.
Games increasingly require calculations using very large and precise integers. This is especially true of incremental games, where numbers can range well beyond 101,000. This type of game needs to not only be able to handle numbers very large in scale, but also have calculations that lose no integral precision at those very large scales.
Operation on numbers of this scale also needs to be as fast as possible, leaving as much frame time as possible for other game concerns.
Math on numbers of this scale also needs to be allocation-friendly, so that memory management artifacts such as garbage collection do not adversely affect performance.
Standard unsigned integral types in UE top out at around 18.4 quintillion (1.84e19) for uint64. Only signed integral types are available to Blueprints, further reducing the numerical range available to Blueprints to about 9.2 quintillion (9.2e18) for Integer64.
Floating point types allow calculation beyond the bounds of standard integral types, but quickly lose precision. Single-precision floating point values go up to 3.4e38, but begin losing integral precision at around 16.8 million (1.68e7). Double-precision floating point values go up to 1.8e308, but begin losing integral precision at around 9.0 quadrillion (9.0e15).
What is needed is a data type and library that can store multiple-precision integers and perform efficient calculations on them.
DBN is presented as a solution to the challenges of calculating, storing, and formatting very large integers.
DBN allows storage of full-precision integers of arbitrary scale. See {BigIntegerLimits} below.
DBN is focused on performance and continual performance improvement. All core functionality is implemented in C++. Over the course of future development, measured changes will be made in order to ensure that the best possible game performance can be achieved.
DBN allows large integers to be treated as a quasi-immutable type for cognitive convenience. However, when every allocation matters, operations have versions exposed that will mutate rather than copy values, if possible.
DBN offers a wide range of calculation functions, with more slated to be added with each release.
DBN has a plethora of formatting options tailored to games that can be customized to individual project needs.
In summary, DBN is a full solution to the need for very large integers in games made using UE.
The minimum amount of memory used by a FBigInteger increases by 4 bytes every time the scale of the number increases by 2^32. Naturally, it follows that the larger the number, the higher the memory and performace cost of working with the number, until that cost becomes intolerable.