PDA

View Full Version : My habitat is producing negative coins...



sweetdeda
01-06-16, 05:26 AM
27457
This habitat is producing negative coins and every second the coin count goes down. Anyone ever see this happen before? What would cause this?

sweetdeda
01-06-16, 05:31 AM
27458
Here is another doing it and if I tap it like to collect coins it takes away the amount from my total. Looks like I have several others doing this also, what is going on?

ogreve
01-06-16, 06:04 AM
Well that is ONE way to have a destination for our millions of coins. :) :) :)
More seriously though: this just has to be some bug: it's best to report it asap to support and in the bugs forum.

sweetdeda
01-06-16, 06:17 AM
Lol that's what I thought "well this is one way to use my coins". It seems to have corrected itself. That was just odd.

Sandybellee
01-06-16, 08:10 AM
There was a similar question on the DS forum not long ago. The answer given there was that the player had too many coins for the game to count or something like that.

Found it! The thread is called Losing coins. Here is the thread: http://forums.storm8.com/showthread.php?86552-Losing-coins!!

Here is what Elsa answered in that thread:


Elsa;1207849']A negative Coin balance means you've collected more Coins than the game (or any game) is able to display. It looks like it's going down for you, but on the server side it's still adding to the balance.

Kooky's advice is correct, please emails support@storm8.com for assistance and private message me the ticket number.

ogreve
01-06-16, 09:26 AM
For those who don't understand how a "very large positive number can certainly become a negative one", you may find it of interest to Google a bit on "integer overflow".

It's been many a moon since I had to mess with this, so the following part may be off a "bit" (pun intended), but basically here is what is the situation:

On a (for example) 32 bit system, the maximum range of so-called "signed integers" lies between -2^31 + 1 and 2^31 - 1, or in other words, between -2,147,483,647 and 2,147,483,647. The way this works for a computer is that a "binary" representation (i.e. a large number consisting of only the digits 0 and 1) is stored and that the leftmost one (i.e. the so-called "most significant bit) is used as a so-called "sign bit": if the value of that bit is a 0, the rest of the bits are interpreted as a positive number, but if it's a 1, it's interpreted as a negative number.
An example (reduced to 4 bits, so as to not have to type 32 digits here), on a 4-bit system, using signed integers, the number 6 is represented as 0110 and the number 7 as 0111. Now, what happens if you add 1 to it, by trying to represent 8? Well, the binary representation of the number 8 is 1000, and computer systems (i.e. the hardware itself) can store that number too on a 4 bit system. But... the leftmost bit (i.e. the most significant one) is now interpreted as a "sign bit" (so as to be able to use negative numbers too), and now all of a sudden the binary number 1000 is no longer 8, but it is interpreted IIRC as -0 (i.e. 0), or it is seen as a non valid number as 0000 is the proper representation for 0. Either way, when adding one more, the bit pattern becomes 1001, i.e. -1, add another one and the bit pattern becomes 1010, i.e. -2, etc.

The very same happens on 32 bit storage systems: when the number overflows, when using signed integers the number is interpreted as a negative number and hence when adding, the represented amount starts to go down.
When using so-called "unsigned integers" this is not the case. On a 32-bit unsigned integer system, the representable (and "storable") numbers range from 0 to 2^32 -1, or IOW from 0 - 4,294,967,295.
If you try to add 1 more to that number you may run into trouble, as matters depend on how the system handles it.
To illustrate this again using a 4-bit system, but signed this time. The maximum representable number now is 15 (i.e. 2^4 -1), which in binary representation is 1111. If you want to add one, for representing 16, you're one bit short as the binary representation for 16 is 10000, but your device can only (physically!) hold 4 bits, so it overflows. Often, in such situations only the last 4 bits are kept, and you'd find your number then all of a sudden to be set to 0000 (binary) which is 0 in the normal decimal notation.

There are various ways in computer science to handle these overflow issues, I shall not go into that, but I thought that perhaps people would be completely puzzled by just WHY a "very large" positive number can all of a sudden become a negative one. :P

One thing that I don't understand though is why it would happen on a habitat. I can see how this can happen to the total amount of accumulated coins, but not on a habitat, which holds much smaller numbers. It must then be related to the total sum of all coins + the ones in all habitats or so?!?

Anyway, these are some of the fun "challenges" to solve in computer science from time to time, though I must say that nowadays with 32 and 64 bit systems it's been a long time ago since I've ran into such overflow issues. :P

matiasabad94
01-06-16, 10:14 AM
for those who don't understand how a "very large positive number can certainly become a negative one", you may find it of interest to google a bit on "integer overflow".

It's been many a moon since i had to mess with this, so the following part may be off a "bit" (pun intended), but basically here is what is the situation:

On a (for example) 32 bit system, the maximum range of so-called "signed integers" lies between -2^31 + 1 and 2^31 - 1, or in other words, between -2,147,483,647 and 2,147,483,647. The way this works for a computer is that a "binary" representation (i.e. A large number consisting of only the digits 0 and 1) is stored and that the leftmost one (i.e. The so-called "most significant bit) is used as a so-called "sign bit": If the value of that bit is a 0, the rest of the bits are interpreted as a positive number, but if it's a 1, it's interpreted as a negative number.
An example (reduced to 4 bits, so as to not have to type 32 digits here), on a 4-bit system, using signed integers, the number 6 is represented as 0110 and the number 7 as 0111. Now, what happens if you add 1 to it, by trying to represent 8? Well, the binary representation of the number 8 is 1000, and computer systems (i.e. The hardware itself) can store that number too on a 4 bit system. But... The leftmost bit (i.e. The most significant one) is now interpreted as a "sign bit" (so as to be able to use negative numbers too), and now all of a sudden the binary number 1000 is no longer 8, but it is interpreted iirc as -0 (i.e. 0), or it is seen as a non valid number as 0000 is the proper representation for 0. Either way, when adding one more, the bit pattern becomes 1001, i.e. -1, add another one and the bit pattern becomes 1010, i.e. -2, etc.

The very same happens on 32 bit storage systems: When the number overflows, when using signed integers the number is interpreted as a negative number and hence when adding, the represented amount starts to go down.
When using so-called "unsigned integers" this is not the case. On a 32-bit unsigned integer system, the representable (and "storable") numbers range from 0 to 2^32 -1, or iow from 0 - 4,294,967,295.
If you try to add 1 more to that number you may run into trouble, as matters depend on how the system handles it.
To illustrate this again using a 4-bit system, but signed this time. The maximum representable number now is 15 (i.e. 2^4 -1), which in binary representation is 1111. If you want to add one, for representing 16, you're one bit short as the binary representation for 16 is 10000, but your device can only (physically!) hold 4 bits, so it overflows. Often, in such situations only the last 4 bits are kept, and you'd find your number then all of a sudden to be set to 0000 (binary) which is 0 in the normal decimal notation.

There are various ways in computer science to handle these overflow issues, i shall not go into that, but i thought that perhaps people would be completely puzzled by just why a "very large" positive number can all of a sudden become a negative one. :p

one thing that i don't understand though is why it would happen on a habitat. I can see how this can happen to the total amount of accumulated coins, but not on a habitat, which holds much smaller numbers. It must then be related to the total sum of all coins + the ones in all habitats or so?!?

Anyway, these are some of the fun "challenges" to solve in computer science from time to time, though i must say that nowadays with 32 and 64 bit systems it's been a long time ago since i've ran into such overflow issues. :p

uhhh what? :p

[S8] Elsa
01-06-16, 11:41 AM
For those who don't understand how a "very large positive number can certainly become a negative one", you may find it of interest to Google a bit on "integer overflow".

It's been many a moon since I had to mess with this, so the following part may be off a "bit" (pun intended), but basically here is what is the situation:

On a (for example) 32 bit system, the maximum range of so-called "signed integers" lies between -2^31 + 1 and 2^31 - 1, or in other words, between -2,147,483,647 and 2,147,483,647. The way this works for a computer is that a "binary" representation (i.e. a large number consisting of only the digits 0 and 1) is stored and that the leftmost one (i.e. the so-called "most significant bit) is used as a so-called "sign bit": if the value of that bit is a 0, the rest of the bits are interpreted as a positive number, but if it's a 1, it's interpreted as a negative number.
An example (reduced to 4 bits, so as to not have to type 32 digits here), on a 4-bit system, using signed integers, the number 6 is represented as 0110 and the number 7 as 0111. Now, what happens if you add 1 to it, by trying to represent 8? Well, the binary representation of the number 8 is 1000, and computer systems (i.e. the hardware itself) can store that number too on a 4 bit system. But... the leftmost bit (i.e. the most significant one) is now interpreted as a "sign bit" (so as to be able to use negative numbers too), and now all of a sudden the binary number 1000 is no longer 8, but it is interpreted IIRC as -0 (i.e. 0), or it is seen as a non valid number as 0000 is the proper representation for 0. Either way, when adding one more, the bit pattern becomes 1001, i.e. -1, add another one and the bit pattern becomes 1010, i.e. -2, etc.

The very same happens on 32 bit storage systems: when the number overflows, when using signed integers the number is interpreted as a negative number and hence when adding, the represented amount starts to go down.
When using so-called "unsigned integers" this is not the case. On a 32-bit unsigned integer system, the representable (and "storable") numbers range from 0 to 2^32 -1, or IOW from 0 - 4,294,967,295.
If you try to add 1 more to that number you may run into trouble, as matters depend on how the system handles it.
To illustrate this again using a 4-bit system, but signed this time. The maximum representable number now is 15 (i.e. 2^4 -1), which in binary representation is 1111. If you want to add one, for representing 16, you're one bit short as the binary representation for 16 is 10000, but your device can only (physically!) hold 4 bits, so it overflows. Often, in such situations only the last 4 bits are kept, and you'd find your number then all of a sudden to be set to 0000 (binary) which is 0 in the normal decimal notation.

There are various ways in computer science to handle these overflow issues, I shall not go into that, but I thought that perhaps people would be completely puzzled by just WHY a "very large" positive number can all of a sudden become a negative one. :P

One thing that I don't understand though is why it would happen on a habitat. I can see how this can happen to the total amount of accumulated coins, but not on a habitat, which holds much smaller numbers. It must then be related to the total sum of all coins + the ones in all habitats or so?!?

Anyway, these are some of the fun "challenges" to solve in computer science from time to time, though I must say that nowadays with 32 and 64 bit systems it's been a long time ago since I've ran into such overflow issues. :P

Yep, that's the gist of it!

@sweetdeda: If it occurs again for you, please email support@storm8.com and private message me the ticket number so support can sort it for you. You're still gaining Coins, it just appears negative in your game. :)

sweetdeda
01-06-16, 04:06 PM
For those who don't understand how a "very large positive number can certainly become a negative one", you may find it of interest to Google a bit on "integer overflow".

It's been many a moon since I had to mess with this, so the following part may be off a "bit" (pun intended), but basically here is what is the situation:

There are various ways in computer science to handle these overflow issues, I shall not go into that, but I thought that perhaps people would be completely puzzled by just WHY a "very large" positive number can all of a sudden become a negative one. :P

One thing that I don't understand though is why it would happen on a habitat. I can see how this can happen to the total amount of accumulated coins, but not on a habitat, which holds much smaller numbers. It must then be related to the total sum of all coins + the ones in all habitats or so?!?

Anyway, these are some of the fun "challenges" to solve in computer science from time to time, though I must say that nowadays with 32 and 64 bit systems it's been a long time ago since I've ran into such overflow issues. :P

I had read a post before regarding total coins going negative, but it just really baffled me that it was happening to my habitats. I know there are players with more total coins than me, so me experiencing this was a surprise.
Thanks for the computer science explanation, Ogreve, it was interesting, way beyond my computer knowledge.
If it happens again I will email support and let you know kooky. Not to worried about the coins, I have plenty.

ogreve
01-07-16, 02:57 AM
I had read a post before regarding total coins going negative, but it just really baffled me that it was happening to my habitats. I know there are players with more total coins than me, so me experiencing this was a surprise.
Thanks for the computer science explanation, Ogreve, it was interesting, way beyond my computer knowledge.
If it happens again I will email support and let you know kooky. Not to worried about the coins, I have plenty.

You're most welcome. I hope my explanation can be understood but upon reading it back I fear one easily gets lost in it when not knowing how binary numbers work. Anyway, the key in the entire explanation is the way how the device and/or the applications interpret the binary representation of a very large decimal number. For the interested reader I'm sure that for example on Wikipedia the matter of the various effects of "integer overflow" are explained far better and/or more clearly than I did.

[nerd mode on]
Because of stuff like this (and binary representations in general), those of us who are into Computer Science often tend to have a "soft spot" for seeing numbers that are powers of 2 in normal real life situations. I admit, this is nerdy, but I can't deny having that twist a bit too. The funniest time was when I was taking a small drive with a person next to me who was interested in buying my car and when I at one moment stopped to make a picture of my odometer as it read 124816. That guy just couldn't understand why the heck I took that picture, but fortunately he bought the car anyway. ;). Later I sent that picture and the accompanying story to some mates of mine who are into CS too and they all had a good laugh about it. For those who missed what's special about that number, if you read it like this: 1-2-4-8-16, they are the following powers of 2: 2^0, 2^1, 2^2, 2^3, 2^4. :)
[nerd mode off]