noshutdown Posted April 7, 2015 according to various sources including doomwiki and bfg faq, a bfg shot has 40 traces. and for each trace, a pseudo random number between 1 and 8 is generated and repeated 16 times. This makes the total damage vary from 16 to 128, with an average of 72. due to the pseudo random number generator of Doom, the damage is limited to the range of 49 to 87. however according to the sourcecode listed in the bfg faq, damage of each trace is calculated in this way: damage = 0; for (j=0;j<15;j++) damage += (P_Random()&7) + 1; isn't the last line executed for 15 times instead of 16? when the value of j is 0, 1, 2... 14, but not executed when j is 15. 0 Share this post Link to post
Foxpup Posted April 7, 2015 noshutdown said:isn't the last line executed for 15 times instead of 16?True. Never_Again said:It's 0, 1, 2... 15 because of j++. False. That doesn't even make sense. 0 Share this post Link to post
Quasar Posted April 7, 2015 Yes, that is 15 iterations. So the damage values and histograms on DoomWiki.org are incorrect? 0 Share this post Link to post
Xeriphas1994 Posted April 7, 2015 Regarding the wiki histogram, the "source" is obfuscated, but I believe it uses 15 iterations (Mathematica has a very similar loop construct). So it's only the text that says 16; interestingly, the Hit point article says 15 instead. Those stats sections have needed sprucing up for years, so it wouldn't exactly be shocking if someone did find an error like that. 0 Share this post Link to post