[SOLVED] Maximum score in Gdevelop

What is the maximum score that can be calculated in Gdevelop?

I noticed when one reaches a mark around 1.2 billion, the score will start to count backwards.

In my game “the score” represents the amount of distance that is traveled in space, so I was planning to get to score up into the trillions and further.

Thanks in advance

Never mind…
i used the trunc function in ToString(trunc(Variable(DistanceScore)))

For some reason the added up score starts to count backwards at around 1.2 billion

But when i replace trunc with round, the problem disappears.

There must be some logical reason for it, but for me the problem is solved.


The biggest usable number is 9007199254740991, a number above this cannot be handled normally by Javascript, the underlying programming language. This is because when a computer wants to remember something, it has to put it in RAM. The software needs to know what portion of the memory is the number though, to know what memory corresponds to what, so the amount of memory for each variable has to be fix. JavaScript decided to use the Double-precision floating-point format (float 64), which uses 64 bit of RAM, which should be enough for most uses, while not taking too much memory for something this basic. Once there is no more possible combinations of the 64 bits being 1 or 0 though, you run out of possibilities, there is only so much of a value you can put is so little storage.