Jump to content


Photo

Maximum notes


Best Answer mountbara , 14 August 2018 - 12:14 AM

Bad programming then, they could cap it at that and allow no more notes to be added. But, a definitive answer, thank you Capt :)

 

That number is 2^31-1.  It actually has an interesting history, it was discovered to be a prime by Euler, and for quite a long time was the largest prime number known.

 

Here's the technical details about what is actually happening.  I may get some of the exact details wrong, but the gist is: If you make a signed integer too big, it rolls over to zero.

 

A computer using 32-bit integers, 2^31-1 is represented as 01111111111111111111111111111111.

If you add one to that, you end up with 2^31, or 10000000000000000000000000000000.

 

The problem is, how is that number interpreted? My guess is that notes are stored in a 32 bit signed integer. That means the first digit is actually a sign bit.  It tells if the integer is negative or positive. So, 2^31-1 is a positive 2.1B notes, but 2^31 is a treated as a negative zero. Positive or negative though, zero is zero... so you just lost your 2 years of saving notes.

 

Don't do it. Buy skills before then.

 

(This is also the result in Hero Zero.)

Go to the full post


  • Please log in to reply
26 replies to this topic

#1 mountbara

mountbara

    Advanced Member

  • Members
  • PipPipPip
  • 934 posts
  • World:US2
  • Character:Mountbara
  • Studio:Angels on US2 Busty Spiderbabes on NU French Touch on UK2






Reputation: 473

Posted 07 August 2018 - 01:39 PM

As mentioned in hero zero  (same game engine and company as BBE) 2.1 billion notes is the maximum we can have. At current pace, we have several that will reach this in a couple of months. Normally with "buy sp" temples, this is not an issue. Did they extend the maximum notes allowance, and if not, can they at least let us know what it is?


  • Lizbeth likes this

#2 Lizbeth

Lizbeth

    Advanced Member

  • Members
  • PipPipPip
  • 171 posts
Reputation: 173

Posted 07 August 2018 - 06:54 PM

Closing in on a billion now. I would love a definitive answer to this question some day :)


  • mountbara likes this

#3 mountbara

mountbara

    Advanced Member

  • Members
  • PipPipPip
  • 934 posts
  • World:US2
  • Character:Mountbara
  • Studio:Angels on US2 Busty Spiderbabes on NU French Touch on UK2






Reputation: 473

Posted 08 August 2018 - 01:28 AM

I saw it on hero zero forum, so thought I would put it out here again

Closing in on a billion now. I would love a definitive answer to this question some day :)



#4 cumdump69

cumdump69

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • World:NU1
  • Character:cumdump69
  • Studio:Fun Blonde Good Times
Reputation: 118

Posted 08 August 2018 - 08:10 PM

Why is there even a max?



#5 mountbara

mountbara

    Advanced Member

  • Members
  • PipPipPip
  • 934 posts
  • World:US2
  • Character:Mountbara
  • Studio:Angels on US2 Busty Spiderbabes on NU French Touch on UK2






Reputation: 473

Posted 08 August 2018 - 08:15 PM

coding issues.It's a real problem. I just want verification on what the max is and what happens when we reach it. hero zero they were rolled back to 0

Why is there even a max?



#6 CaptC

CaptC

    Advanced Member

  • Members
  • PipPipPip
  • 1,239 posts
  • LocationHouston near my Baby
  • World:NU1
  • Character:CaptC
  • Studio:Member emeritus of Busty Spiderbabes
Reputation: 545

Posted 13 August 2018 - 08:37 PM

I am told 2,147,483,647 is the maximum number of notes.

 

This is the same limit as Hero Zero.


Edited by CaptC, 13 August 2018 - 08:39 PM.

  • mountbara likes this
I have retired from the game, but not from life.
In love with my Baby.

#7 dranyam00

dranyam00

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts
  • World:US2
  • Character:jma
  • Studio:Angels
Reputation: 24

Posted 13 August 2018 - 09:30 PM

That seems like a totally random number. lol

#8 mountbara

mountbara

    Advanced Member

  • Members
  • PipPipPip
  • 934 posts
  • World:US2
  • Character:Mountbara
  • Studio:Angels on US2 Busty Spiderbabes on NU French Touch on UK2






Reputation: 473

Posted 13 August 2018 - 10:34 PM

Now the other part of the question is, what happens when you reach that number? I had assumed it was 2.1 billion based on game engine, what what posted on their forum is that it resets to zero. I would like to know the answer on this long before I get there.

 

I am told 2,147,483,647 is the maximum number of notes.

 

This is the same limit as Hero Zero.



#9 mountbara

mountbara

    Advanced Member

  • Members
  • PipPipPip
  • 934 posts
  • World:US2
  • Character:Mountbara
  • Studio:Angels on US2 Busty Spiderbabes on NU French Touch on UK2






Reputation: 473

Posted 13 August 2018 - 10:36 PM

It's not random at all. It's the same number of maximum gp you can have in runescape and why 200 million is the maximum xp allowed. (the go to the 1/10 point). The coding for numbers higher than that is just not an easy thing.

That seems like a totally random number. lol



#10 hot16

hot16

    Advanced Member

  • Members
  • PipPipPip
  • 124 posts
  • World:US2
  • Character:hot16
  • Studio:FUN BLONDE GOOD TIMES
Reputation: 57

Posted 13 August 2018 - 10:50 PM

I'm gonna buy some skill points before I get there.



#11 CaptC

CaptC

    Advanced Member

  • Members
  • PipPipPip
  • 1,239 posts
  • LocationHouston near my Baby
  • World:NU1
  • Character:CaptC
  • Studio:Member emeritus of Busty Spiderbabes
Reputation: 545

Posted 14 August 2018 - 12:03 AM

That number is 2^31-1.  It actually has an interesting history, it was discovered to be a prime by Euler, and for quite a long time was the largest prime number known.

 

Here's the technical details about what is actually happening.  I may get some of the exact details wrong, but the gist is: If you make a signed integer too big, it rolls over to zero.

 

A computer using 32-bit integers, 2^31-1 is represented as 01111111111111111111111111111111.

If you add one to that, you end up with 2^31, or 10000000000000000000000000000000.

 

The problem is, how is that number interpreted? My guess is that notes are stored in a 32 bit signed integer. That means the first digit is actually a sign bit.  It tells if the integer is negative or positive. So, 2^31-1 is a positive 2.1B notes, but 2^31 is a treated as a negative zero. Positive or negative though, zero is zero... so you just lost your 2 years of saving notes.

 

Don't do it. Buy skills before then.

 

(This is also the result in Hero Zero.)

 

I can't put in pointers to external sites, but look up "Integer overflow" on wikipedia for a more thorough examination of this subject.


Edited by CaptC, 14 August 2018 - 12:13 AM.
reference to integer overflow

  • mountbara and Demonka like this
I have retired from the game, but not from life.
In love with my Baby.

#12 mountbara

mountbara

    Advanced Member

  • Members
  • PipPipPip
  • 934 posts
  • World:US2
  • Character:Mountbara
  • Studio:Angels on US2 Busty Spiderbabes on NU French Touch on UK2






Reputation: 473

Posted 14 August 2018 - 12:14 AM   Best Answer

Bad programming then, they could cap it at that and allow no more notes to be added. But, a definitive answer, thank you Capt :)

 

That number is 2^31-1.  It actually has an interesting history, it was discovered to be a prime by Euler, and for quite a long time was the largest prime number known.

 

Here's the technical details about what is actually happening.  I may get some of the exact details wrong, but the gist is: If you make a signed integer too big, it rolls over to zero.

 

A computer using 32-bit integers, 2^31-1 is represented as 01111111111111111111111111111111.

If you add one to that, you end up with 2^31, or 10000000000000000000000000000000.

 

The problem is, how is that number interpreted? My guess is that notes are stored in a 32 bit signed integer. That means the first digit is actually a sign bit.  It tells if the integer is negative or positive. So, 2^31-1 is a positive 2.1B notes, but 2^31 is a treated as a negative zero. Positive or negative though, zero is zero... so you just lost your 2 years of saving notes.

 

Don't do it. Buy skills before then.

 

(This is also the result in Hero Zero.)



#13 CaptC

CaptC

    Advanced Member

  • Members
  • PipPipPip
  • 1,239 posts
  • LocationHouston near my Baby
  • World:NU1
  • Character:CaptC
  • Studio:Member emeritus of Busty Spiderbabes
Reputation: 545

Posted 14 August 2018 - 11:10 AM

Bad programming then, they could cap it at that and allow no more notes to be added. But, a definitive answer, thank you Capt :)

 

Yes it is. To be fair, it's a flash game, and saving up more than 2B notes is clearly not something they planned for. The fact that the number of notes isn't carried in a 64-bit integer is what boggles me, but it is possible the engine was developed before there was 64 bit flash support.


  • Demonka likes this
I have retired from the game, but not from life.
In love with my Baby.

#14 Kitekat

Kitekat

    Advanced Member

  • Members
  • PipPipPip
  • 467 posts
  • LocationNutaku
  • World:NU1
  • Character:Kitekat
  • Studio:Oxygen



Reputation: 230

Posted 14 August 2018 - 12:16 PM

2³²=4294967296

so you can see they use a signed  32 bit integer

an overflow leads to negative

this they catch and set to zero

very simple doing

if you catch all valid actions correct you can better use an unsigned integer

if not they should at least not doing this setting to zero

better back to the limit and send a message to the user


Edited by Kitekat, 14 August 2018 - 12:20 PM.


#15 CaptC

CaptC

    Advanced Member

  • Members
  • PipPipPip
  • 1,239 posts
  • LocationHouston near my Baby
  • World:NU1
  • Character:CaptC
  • Studio:Member emeritus of Busty Spiderbabes
Reputation: 545

Posted 14 August 2018 - 02:21 PM

I've been there and done that in my career too, Kitekat.

 

Question during design: "Should we add code to check for integer overflow, in case someone saved more than 2.1B notes?"

 

Answer during design: "Naw, back of the envelope calculations say it will take over 3 years for anyone to save that much. If the game is not successful, we won't be in business that long. If the game IS successful, it takes a special kind of nerd to test the limits that way. We probably don't ever need to worry about it."

 

Nerds: "Challenge accepted!"


  • LukeVaxhacker likes this
I have retired from the game, but not from life.
In love with my Baby.

#16 Kitekat

Kitekat

    Advanced Member

  • Members
  • PipPipPip
  • 467 posts
  • LocationNutaku
  • World:NU1
  • Character:Kitekat
  • Studio:Oxygen



Reputation: 230

Posted 14 August 2018 - 04:55 PM

kicher

curios thinking i like to catch all possibilities



#17 CaptC

CaptC

    Advanced Member

  • Members
  • PipPipPip
  • 1,239 posts
  • LocationHouston near my Baby
  • World:NU1
  • Character:CaptC
  • Studio:Member emeritus of Busty Spiderbabes
Reputation: 545

Posted 14 August 2018 - 05:36 PM

I grew up in an era where computers were always short of memory and cycles. You just flat out didn't do stuff you didn't need to, because you needed those resources to get the mission accomplished.

 

Nothing is free. There is time needed to code and debug the checks. There is the operational cost of checking every single change to notes totals, for thousands of players, across millions of missions.

 

With modern computers, perhaps none of that is truly significant. But... that coding effort and operational cost is WASTED - no one playing sanely will ever hit that notes limit. Simple as that.


I have retired from the game, but not from life.
In love with my Baby.

#18 LukeVaxhacker

LukeVaxhacker

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • LocationHappytown
  • World:NU1
  • Character:LukeVaxhacker
  • Studio:Dirty Wife Club - Boss
Reputation: 35

Posted 18 August 2018 - 02:55 PM

I grew up in an era where computers were always short of memory and cycles. You just flat out didn't do stuff you didn't need to, because you needed those resources to get the mission accomplished.

 

Nothing is free. There is time needed to code and debug the checks. There is the operational cost of checking every single change to notes totals, for thousands of players, across millions of missions.

 

With modern computers, perhaps none of that is truly significant. But... that coding effort and operational cost is WASTED - no one playing sanely will ever hit that notes limit. Simple as that.

 

I thought Adobe Flash was the biggest resource hog with both Apple, Microsoft, and Google trying to kill it off. Now every time I run a Nutaku Unity game and see Firefox asking me to stop the page, I see not.

 

I remember on one project arguing with consultants whether to store numbers as 8-bit characters or integers, with Big Endian vs Little Endian (a difference in the way Motorola (Apple's original supplier for CPUs) and Intel). The consultants were pushing for integers to save space in the early 90s when costs were coming down well already.


- Luke Vaxhacker

 

"If you're not getting excited and a little bit nervous, you're probably in the wrong line of work." - Casey McGehee, former SF Giants 3rd baseman


#19 CaptC

CaptC

    Advanced Member

  • Members
  • PipPipPip
  • 1,239 posts
  • LocationHouston near my Baby
  • World:NU1
  • Character:CaptC
  • Studio:Member emeritus of Busty Spiderbabes
Reputation: 545

Posted 15 October 2018 - 01:26 PM

I have first hand proof that 2.15B notes can be done. One of my teammates spent just under that amount on this latest buying temple, and says she has been dawdling for a month rather than roll over the limit.

 

The lesson, of course?  Never challenge nerds.


I have retired from the game, but not from life.
In love with my Baby.

#20 antony

antony

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
Reputation: 6

Posted 15 October 2018 - 01:43 PM

I have first hand proof that 2.15B notes can be done. One of my teammates spent just under that amount on this latest buying temple, and says she has been dawdling for a month rather than roll over the limit.

 

The lesson, of course?  Never challenge nerds.

so, maximum notes is unlimited?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users