0 votes

I am working on a Tycoon game and in such games, it is possible to earn a lot of money until more than decillion. The positive limit of the 64-bit integer is 9.223.372.036.854.775.807 and that is way too small. So can I go a different way or even change the limit which is what I prefer?

Godot version 3.2.3.stable
in Engine by (377 points)

3 Answers

0 votes
Best answer

You have a few choices:

  • If you're using C#, you could use the Big Integer type
  • Maybe try this big number asset for gdscript (I've never used it)
  • Roll your own big int handler (probably a bad idea)
by (10,884 points)
selected by

I've also seen the asset but the website looked unserious to me but now, after I've read the description, I think that this is exactly what I want. Thank you!

0 votes

The only thing you can do is change the type of "bool" to " int " or something like that. How much the variable allows you to fit in itself, so much and can, no more. If the maximum number is exceeded, then the count starts from the minimum possible number in the variable or from zero.
Of course, there may be ways, but I have not yet met this...

by (149 points)
+1 vote

A couple possibilities:

  1. Dollars works up through the end of the quadrillions. Use one var for dollars and another for quintillions.
  2. Round and change the unit. E.g., 7,341,345,663,167,842,342,654,571,001,453,251 could be represented as 7,341 nonillion dollars; possibly 7,341.345 under the hood. By the time you're player is up in this range, they're not likely to care about a measly quintillion or two.
by (18 points)

It is done in the asset which was linked in the answer by jgodfrey.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.