WildTangent Orb Forum

Welcome Guest ( Log In | Register )

5 Pages V   1 2 3 > »   
Closed TopicStart new topic
 FATE's "Magic Number", a Detailed Explanation
FATE's "Magic Number", a Detailed Explanation
Yes [ 12 ] ** [100.00%]
No [ 0 ] ** [0.00%]
Total Votes: 12
  
iubigler
post Jul 24 2007, 11:26 PM
Post #1


Joined: 27-December 05



yes, that's handy info, although it might be a bit much for a newer person it fills in some gaps, although, someone had said on the forums that it was a signed integer instead of unsigned, so I guess they were mistaken then, that was a long time ago though. I voted yes, just cuz it will be handy to point people to this when they ask why they fall over dead....LOL.
Go to the top of the page
 
+Quote Post
Nambi
post Jul 25 2007, 03:38 AM
Post #2


Joined: 13-October 05



Great job, Nick!
I actually understood your explanation. Please 'sticky' this thread.


--------------------
Go to the top of the page
 
+Quote Post
dragon20002
post Jul 25 2007, 05:03 AM
Post #3


Joined: 25-January 07



This needs sticked.
Go to the top of the page
 
+Quote Post
Professor
post Jul 25 2007, 07:27 AM
Post #4


Joined: 29-August 06



Not a sticky of its own - just add it to one of the FAQs. I don't need a half page of stickies every time I see the threads page.


--------------------
PostCount = PostCount + 1
Go to the top of the page
 
+Quote Post
MasterGamer2
post Jul 25 2007, 09:07 AM
Post #5


Joined: 12-June 07



Great work Nick! I vote yes!:agreement: This is very helpfull. I agree with Iubigler, though. Mabey you should add a paragraph with a simple, general idea of this for the technically challenged. This is great info, but some people might not want to read through the whole thing if they're new.

Thanks again!
Go to the top of the page
 
+Quote Post
surdin
post Jul 25 2007, 10:19 AM
Post #6


Joined: 20-January 06



Finally makes sense to me... definately deserves a sticky... much easier to find when someone asks. :wink:
Go to the top of the page
 
+Quote Post
FreeBird
post Jul 25 2007, 10:25 AM
Post #7


Joined: 15-January 07



That was VERY cool!!! Clear and concise, so much so that I understand it and that's something. Like I keep telling people, I'm not stupid, just slow!:agreement:
Go to the top of the page
 
+Quote Post
Nick C
post Jul 25 2007, 04:30 PM
Post #8


Joined: 5-April 07



I'm glad you all liked it! I agree that there should probably be a short, simple summary at the top (I tried to cheat by telling people they could skip the first 5 paragraphs). I'll add this in, and sticky it. Thanks again for all the feedback :-P


--------------------
WildTangent Customer Support
Forum Administrator
Go to the top of the page
 
+Quote Post
Grey_DawnIII
post Jul 31 2007, 01:37 PM
Post #9


Joined: 30-July 07



If it's a 64bit computer can the numbers go up to 9,223,372,036,854,775? I don't know if such things exsist though
Go to the top of the page
 
+Quote Post
candace
post Jul 31 2007, 01:46 PM
Post #10


Joined: 30-July 07



:confused: Okay so I dont think that I understand this magic number thing all that well can anyone explain it a little better for me?
Go to the top of the page
 
+Quote Post
MasterGamer2
post Jul 31 2007, 02:42 PM
Post #11


Joined: 12-June 07



Hey, it got stickied! Nice work on that "In Short" paragraph Nick! It looks great!
Go to the top of the page
 
+Quote Post
surdin
post Jul 31 2007, 03:36 PM
Post #12


Joined: 20-January 06



(Grey_DawnIII)
If it's a 64bit computer can the numbers go up to 9,223,372,036,854,775? I don't know if such things exsist though


In theory, yes... however, though the computer and operating system may be capable of 64 bit calculations, Fate, itself, is not... so the magic number remains the same.
Go to the top of the page
 
+Quote Post
Spock
post Jul 31 2007, 06:33 PM
Post #13


Joined: 12-July 07



(candace)
... can anyone explain it a little better for me?


I'm not sure if I can do any beter but I will make an attempt.

Modern digital computers work using the binary system rather than the decimal system. In the Decimal system (base 10) there are 10 single digit numbers; 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. In the Binary system (Base 2) there are only 2 single digit numbers; 0 and 1.

Binary digits are also known as Bits. 4 Bits make a Nybble and 2 Nybbles or 8 Bits make a Byte. The Byte is still the defacto standard for the ASCII (American Standard Code for Information Interchange) character set which is composed of 256 defined characters from Decimal zero (0) to Decimal 255.

Creating a small table to display numbers in each system side by side displays the following:

D - B
00 - 0000
01 - 0001
02 - 0010
03 - 0011
04 - 0100
05 - 0101
06 - 0110
07 - 0111
08 - 1000
09 - 1001
10 - 1010
11 - 1011
12 - 1100
13 - 1101
14 - 1110
15 - 1111

You should notice that each column repeats regularly, that to display single digits up to decimal 7 require 3 binary digits (which lead to the adoption of the Octal numbering system) and when all 4 binary digits are "1" 16 decimal numbers have been represented (which lead to the development of the Hexadecimal system).

If we were limited to only 4 bits and wanted to display both positive and negative numbers the easiest way would be to define a positive number as having a zero in the most significant bit, therefore, 0 - 7 would indicate positive numbers and 8 - 15 would indicate negative numbers.

This leads directly to the first problem. Is there such a thing as a negative zero!? Using the above numbering scheme, it is possible unless the roll over point is artificially re-defined as going from the most positive directly to the smallest negative or a -1. This would make Decimal 8 (Binary 1000) a negative one (-1).

The "Magic Number" in my example is 7. If you add 7 + 1 you get 8, which is now a negative number. Fate works the same way, except there are a few more digits to work with. :wink:

Hope that helps a little.
Go to the top of the page
 
+Quote Post
Virtus_Probi
post Aug 1 2007, 12:58 PM
Post #14


Joined: 29-March 07



I see that Nick C is probably not here to reply to this, but I'll post it while it's on my mind, anyway.
Wouldn't there be no rollover to negative problem if FATE were using unsigned integers? You would just roll over to zero after (2**32 - 1)...which, I guess, could still kill you.
Your description of the way negative numbers is treated sounds like a signed integer, either sign-magnitude or two's complement. In sign-magnitude, the MSB (Most Significant Bit) give the sign (0 for positive, 1 for negative...yeah, I know, kinda counterintuitive) and the rest of the bits (31 LSBs for a 32 bit number) gives the absolute magnitude. This gives you the +/- zero problem, which really isn't a big deal. This representation is not nearly as convenient for binary math operations as two's complement, in which the MSB is still a sign bit of sorts, but the magnitude of the negative number falls as you count up, so to speak.
For 4 bit 2's complement numbers,
(binary) (decimal)
0000 = 0
0001 = 1
0011 = 2
...
0111 = 7
1000 = -8
1001 = -7
...
1110 = -2
1111 = -1
When you see a 1 in the MSB of a binary two's complement number, you flip all the bits and add 1 to find the magnitude of the negative number.
1000 = -(0111 + 1) = -1111 = -8(decimal)
1111 = -(0000 + 1) = -0001 = -1(decimal)
The magic of 2's complement is that adding positive and negative numbers is totally seamless.
0111 + 1000 = 1111 (binary)
7 - 8 = -1 (decimal)
Try doing that with sign-magnitude.
I don't know much of anything about coding a uprocessor, so I'm not sure which representation is typically used by a programmer. When I was designing custom DSP circuitry for automotive, we were able to force our users to write 2's complement numbers to our ICs because it saved us the extra step of translating from sign-magnitude, which saved a little bit of money per part and made it worth their trouble. I think that they finally just wrote software to do the translation for them automatically during their code development. It's kind of hard to get used to the idea that what looks like the biggest binary number you can have is actually (-1).
Nick is probably much more of a software guy than me and may need to give me an education in how things are really done in that world, but I just don't think that the use of unsigned integers could be the problem here. The symptoms that we would see would be different then.
Go to the top of the page
 
+Quote Post
sith lord
post Aug 1 2007, 01:26 PM
Post #15


Joined: 22-June 07



(candace)
:confused: Okay so I dont think that I understand this magic number thing all that well can anyone explain it a little better for me?

OK. Look this is what Nick C meant.If any stat goes over the "magic number" it goes negative.It's more or less like One half of the numbers is positive and the other half negative.
Go to the top of the page
 
+Quote Post
Spock
post Aug 1 2007, 04:04 PM
Post #16


Joined: 12-July 07



(sith lord)
... If any stat goes over the "magic number" it goes negative. ...

What he said!

Try not to get all hung up in the mechanics, just try to work with the end product. wink.gif
Go to the top of the page
 
+Quote Post
gamerforever
post Aug 3 2007, 06:12 AM
Post #17


Joined: 2-August 07



This is from the top. Yeah I'm kinda late but whatever. If you wanted to count to 2,147,483,647 and you could count 200 numbers per minute it would take here is how I did it.

=2,147,483,647/200 per minute

=10737418.235 minutes/60 minutes per hour

=178956.97058 hours/24 hours in one day

=7456.540441 days/ 365 days a year

=20.42887792 years which equals about
20 and a half years.

That would take a long time. :shocked: :stunned:
Go to the top of the page
 
+Quote Post
Draco7449
post Aug 3 2007, 08:22 AM
Post #18


Joined: 30-July 07



Did you, or anyone know that when you get 2,147,483,647 gold coins it turns to a negative number and as you continue to gather gold coins it accumulates back to zero and then starts over?


Draco
Go to the top of the page
 
+Quote Post
Professor
post Aug 3 2007, 08:33 AM
Post #19


Joined: 29-August 06



Well, if you didn't know it, then you could have learned by reading, say, I dunno, the first post in this thread?

"FATE doesn’t treat gold values over 2^31 as negatives – it will still show negative values, but it will work just like having more gold than 2^31 (As a caution, if you go over 2^32, your gold will go to 0, and you’ll go from being the richest person in the world to the poorest person in the world)."


--------------------
PostCount = PostCount + 1
Go to the top of the page
 
+Quote Post
Draco7449
post Aug 3 2007, 09:48 AM
Post #20


Joined: 30-July 07



(Professor)
Well, if you didn't know it, then you could have learned by reading, say, I dunno, the first post in this thread?

"FATE doesn’t treat gold values over 2^31 as negatives – it will still show negative values, but it will work just like having more gold than 2^31 (As a caution, if you go over 2^32, your gold will go to 0, and you’ll go from being the richest person in the world to the poorest person in the world)."


Well, Duh, Thomas. I knew that. I read that and I still psoted that silly post....
Told ya I was a dummy........

LOL

Draco
Go to the top of the page
 
+Quote Post

5 Pages V   1 2 3 > » 
Closed TopicStart new topic
4 User(s) are reading this topic (4 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 9th February 2010 - 04:19 AM
Add to Google
Customer Support | About WildTangent | Privacy Policy | Terms of Service
© 2008 WildTangent, Inc. All Rights Reserved.