Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

He wonders why the score shows up as 266 when it should be 262.

Well, 262 % 256 = 6. So if you have very old scoring code that expects the score to fit in an unsigned byte, it's going to think the score is 6.

So that explains the 6 in the ones column. The 6 in the tens column, well, that I can't explain.



I can't possibly believe something like a game's score would be recorded in an unsigned byte. The last time I saw an unsigned byte in use in a game was in the original Starcraft, which tracked number of kills per unit with a single byte, so if a unit killed more than 255 enemies, it stopped incrementing.


Don't miss this comment from a person who worked there:

https://news.ycombinator.com/item?id=7159513


Apparently this limitation shows up elsewhere in the game, suggesting it might be a problem of too few bits, indeed: "Peterson actually rushed for over 1,100 yards, but once again, the game stopped counting at 1,023. I'm guessing that this is because only 1,024 values can be represented by 10 binary switches in a computer system, and the game's developers (understandably) never would have guessed that another set of switches would be necessary." -- http://www.sbnation.com/2013/10/2/4784946/breaking-madden-in...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: