Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Properly handling numeric values in infinite progression games.

Discussion in 'Game Design' started by Christian-Tucker, Jan 25, 2015.

  1. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    376
    When it comes to an infinite progression game, the main issue that I've ran into was figuring out how to properly handle the numerical representation of data, while the Integer/Long data-types will certainly hold up for a little-while, they are by no means infinite, and will eventually be surpassed.

    I'm trying to think of ways to properly create a system in which infinite numerical progression is possible, probably using letters of the alphabet.

    So far my current idea was to use the standard integer values, but convert them into "Characters". For example, I would have to write an entire math class focuses around this.

    Basically, I would have an integer for the amount of currency stored, then convert it into an alphabetic format whenever possible, for example when you get 1000 points, it will be removed from the integer, and you will receive "One 'k'". This ofcourse will continue on, where as 1000k will be equal to 1m, and 1000m would be equal to 1b, -> 1t -> 1a -> 1c -> 1d all the way to z, then continue with things like "1aa, 1dd"

    What are your ideas? I'm interested. I have my entire game prototyped and ready for initial launch, but because of the fact that it's meant to be an infinite game and isn't "infinite" it's really depressing.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    This is a well-known problem, and C# has a built-in solution (the BigInteger class).
     
    theANMATOR2b and Kiwasi like this.
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    So totally missed this class last time I needed it. Will tuck that away for later.