playMaker

Author Topic: High precision numbers with PlayMaker  (Read 7382 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: High precision numbers with PlayMaker
« Reply #15 on: January 05, 2018, 10:22:49 AM »
Quote
Hi! I want to store numbers greater than 2147483647 in PlayerPrefs or just need to Add/Subtract/Multiply/Divide.  But currently, its not possible, as you may already know the reason why!

I got the same problem with the score in my game. INT has a limit of numbers. I use FLOAT for my score. Problem solved. :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Sunny

  • Playmaker Newbie
  • *
  • Posts: 12
Re: High precision numbers with PlayMaker
« Reply #16 on: January 08, 2018, 08:44:29 AM »
Hi,

 ok, there is a miunderstanding here, the number I see in your screenshots are totally fine as regular ints... I am not sure you are going in the right directions with doubles.

int range in c#: -2,147,483,648 to 2,147,483,647

2 billion is fine right for scoring no? I strongly advice you cut down on the scale of your score so that it fits 2 billion, I don't think it make sense to have such large numbers for a game score.


Bye,

 Jean

Hi!
I have really tried to cut down the highest scores as much as possible, the game is already very tough, and players would have played very hard to get those high scores, still the player is able to reach the max. The game is very much and strictly precision based, and using float or reducing the max high scores will make the game less playable.

Yes, I agree those high scores really don't make sense, but believe me, I didn't had any other options left. The game is now getting good hits, so I'm stressed about what to do next. And actually there is no way, I could reduce the max scores down.

I have only two options left now, either to switch to the float or end the game at some point.  :'(

Thanks for your help Jean!! :D

Sunny

  • Playmaker Newbie
  • *
  • Posts: 12
Re: High precision numbers with PlayMaker
« Reply #17 on: January 08, 2018, 08:58:27 AM »
Moving to a float would also get you a higher value allowable.
int = 2.1e+09 or 2,100,000,000
float= 3.4e+38 or 340,000,000,000,000,000,000,000,000,000,000,000,000

Converting float to string with a format 0 will remove the decimal places from showing. You can also format the string to allow the number to more human readable.

eg. 3 Billion -> 300 billion -> 3 trillion etc. instead of 3,000,000,000 -> 300,000,000,000 -> 3,000,000,000,000

If you are tracking scores above a trillion I, personally, wouldn't be too concerned that float may not give the precision you need as you are getting into massive numbers that start to lose meaning. Not a lot of people even know what comes after a Trillion  :)

Thanks

Hi!
The game is strictly precision based, so using float would not be useful in this case. I wish I could use floats, but sadly it looses lots of numbers in the long run.

(In the pic, the last 1 is just vanished, and in my case, the game will suffer if that happened!!)
But, I will definitely give it a try, as you have suggested, and will notify you if it works for me too!!

BTW the player's won't even notice or care, where the last 1 went!! Haha..  ;D

Thanks so much!!

Sunny

  • Playmaker Newbie
  • *
  • Posts: 12
Re: High precision numbers with PlayMaker
« Reply #18 on: January 08, 2018, 09:00:57 AM »
Quote
Hi! I want to store numbers greater than 2147483647 in PlayerPrefs or just need to Add/Subtract/Multiply/Divide.  But currently, its not possible, as you may already know the reason why!

I got the same problem with the score in my game. INT has a limit of numbers. I use FLOAT for my score. Problem solved. :)

Hi Rabagast!!

I am really excited to use the float in my game too!! I just hope it works in my case too!!  ;)

Thanks very much!!

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: High precision numbers with PlayMaker
« Reply #19 on: January 09, 2018, 08:10:40 AM »
Quote
I am really excited to use the float in my game too!! I just hope it works in my case too!!  ;)

Good luck!  :D
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no