#How Idle Games Handle Huge Numbers?

1 messages · Page 1 of 1 (latest)

pale plover
#

Hello, does anyone know how, idle games handle huge numbers in their game?

Do they uses BigInteger all the time?
Or they use a technique called offset & bucket? (idk how it works)
Or they uses floating number?

cursive pebble
#

Yes they use libraries/types similar to BigInteger

#

Many use BreakInfinity

#

Which is a compromise

pale plover
whole trout
#

There is also the possibility to use exponent and removes non significative numbers.

#

You do not want to use floats number as those will be less precise the greater they are.

gray viper
#

They're slower, but you don't have that many numbers

pale plover
#

Thanks alot guys, really helped me. Just gained new insights 😃 👍

gray viper
#

I'm guessing "offset and bucket" is basically what goes on in a big integer library

#

breaking a number into several pieces

cursive pebble
subtle bay
#

is offset and bucket like treating a number as a*b+c (or a<<x|c)?
i see c# uses an uint array to store all the bits after the number is converted to binary(?)