Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: heavygunner on October 31, 2019, 01:25:19 AM

Title: How Idle games handle big numbers like 1e+300 ?
Post by: heavygunner on October 31, 2019, 01:25:19 AM
Hello !

I am prototyping an idle game. When I try to input 1e+39 playMaker showing that value to 3.402823e+38. I just searched and found max value in float is limited to +38

Then, how other Idle games like Cash Inc and Adventure Capitalist are supporting even big number like 1e+300 ?

How can i go even more ?

Thanks
Title: Re: How Idle games handle big numbers like 1e+300 ?
Post by: djaydino on October 31, 2019, 09:37:10 AM
Hi.
Long time ago i worked on a idle and to tackle this i used multiple floats.

i checked if greater than for example 1.000.000 when greater deduct 1.000.000 to float 1 and add 1 to float 2. do the same on float 2 to float 3.

But i am not sure if it can handle up to 1e+300.

Also starting @ 0.000001 but displaying it as 1 could increase the limit.

another possibility is to use some sort of levels. if you reach a certain amount per level for example 1.000.000
Start doing 1000 per second and display it as 1M/1,001M/1,002 and so on.

When player purchase something and comes below 1M, show some random numbers (from lower to higher of course else its obvious) as this would show only a split second.
This way player never notice that the counting is not 100% accurate.