my profile | search | faq | forum home
 » The Azure Heights Forum   » Main Campus   » Sakaki Tower   » How do you...

Author Topic: How do you...
 Rahajamati Orangutan Spouse Member # 399 Rate Member posted 06-02-2000 02:47 PM                     How do you figure health when changing genes?I kinda need a very good description because I didn't understand it on that Sharkery page. ------------------This space for rent From: The Moon | Registered: May 2000  |  IP: Logged
 cfalcon OLDNBLD Member # 19 Member Rated: posted 06-02-2000 11:18 PM                     Ok, first you need to realize that everything is in binary.Reread that first line until you're ok with it. You don't need to understand binary, though it would be nice.Ok, here we go:There are 16 bits that are randomly generated when a monster is caught. Each bit can contain two values. If you had a penny, it could be heads or tails. If you had a penny and a nickel, however, you have four states:Penny: HNickel: TPenny: HNickel: HPenny: TNickel: HPenny: TNickel: TNow, genes range from 0-15. That is 16 possibilities. How many bits is this? Well, if you had a penny, a nickel, a dime, and a quarter, you would have 2*2*2*2 =16 possibilities.So you need four bits. Picture yourself as a Game Freak designer. You need twenty bits (5 stats * 4 bits), but have only 16 without writing a couple extra lines of code and wasting a precious byte of save ram on each monster. Add an extra byte, and players can store less monsters, or less items, or something. So you save the byte. Here's how:The 16 bit value is broken into 4 groups. Each means, in order, attack, defense, speed, and special. Hitpoints is constructed from the last bit of each value. In base 10, if a number ends in 0 it is divisible by 10. In base 2, if a number ends in zero it is divisible by 2. So for a hit point gene of 15 (max) all values need to end in 1 aka be odd numbers. The odd numbers are 1,3,5,7,9,B,D,F. (B=11, D=13, F=15).If you want a specific number, you have to realize that it is binary. Here is the simple way:HP gene= 8*W + 4*X + 2*Y + ZW = 1 if attack is odd, 0 if even.X = 1 if defense is odd, 0 if even.Y = 1 if speed is odd, 0 if even.Z = 1 if special is odd, 0 if evenHope this helps,-cfalcon From: 39°45' N, 104°52' W | Registered: Feb 2000  |  IP: Logged
 Rahajamati Orangutan Spouse Member # 399 Rate Member posted 06-04-2000 09:12 AM                     Thanks you for your help!!!------------------This space for rent From: The Moon | Registered: May 2000  |  IP: Logged

 All times are ET (US)
 Printer-friendly view of this topic Hop To: Select a Forum: Category: Welcome Center -------------------- Information Booth Complaints Dept. Category: Main Campus -------------------- Research Lab Muk Center Auditorium Oddish Memorial Lecture Hall Omanyte Historical Foundation Sakaki Tower Kabuto Archaeological Society Category: Onix Annex -------------------- Azure Arena Arbok's Internet Cafe Azure Pokemon Center Category: The Courtyard -------------------- Karp Park