View Single Post
Old 12-07-2021, 04:21 AM   #2
CM Hooe
Dead!
 
CM Hooe's Arena
 
OVR: 45
Join Date: Aug 2002
Location: Culver City, CA
Posts: 20,967
Re: Coach win glitch in CFM after 250 wins Madden 22

This is an overflow error, which is uncommon (but not rare) in the statistics tables in Madden NFL.

Based on the information provided, Tiburon uses an unsigned byte to store the number of wins for a coach. An unsigned byte is represented in computer memory with eight bits; a bit is either 0 or 1. The minimum value of an unsigned byte is 0 (represented in binary as 00000000) and the maximum value of an unsigned byte is 255 (represented in binary as 11111111).

Adding 1 to an unsigned byte holding 255 will cause an overflow error. Adding 1 to 11111111 causes all eight bits to roll over to 0, and since there is no ninth bit to carry to (which would then represent 256), the carry value is lost the value stored in memory is instead 00000000, which as previously stated represents zero. From there the game adds to the value as if it were zero. You actually have 264 total wins.

Madden still using small primitives such as ushorts to hold statistics is likely a holdover from when the game was built on consoles with extreme RAM limitations (unclear which generation, though; the Sony Playstation only had 2 MB RAM, the Nintendo 64 bested it with 4 MB RAM, and the Sega Genesis only had a paltry 64 KB RAM). To fix this error, Tiburon must upgrade the backing data type for coach wins to a primitive which can store a greater maximum value, such as an unsigned short (max value: 65535) or an unsigned integer (maximum value: 4294967295).

Overflow errors in Madden are easy to spot when you exceed 127 interception return yards or 127 fumble return yards with a single player in a single game; the value instead rolls over to -128, since the backing data type is a signed byte (as opposed to an unsigned byte which cannot hold a negative value).
CM Hooe is offline  
Reply With Quote