Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Nootrac4571

BFG tracer damage

Recommended Posts

I'm slightly confused about how much damage BFG tracers do. The wiki (and the BFG FAQ) states:

 

"To determine the damage of a BFG tracer, a random number between 1 and 8 is generated and repeated 16 times."

 

But looking at the source code, the relevant part of A_BFGSpray (in p_pspr.c) is this:

 

damage = 0;
    for (j=0;j<15;j++)
        damage += (P_Random()&7) + 1;

 

So - isn't that 15 times, not 16? The loop exits when j==15, so it iterates from j==0 to j==14 inclusive. Am I being dense?

Share this post


Link to post

I have so many questions:

 

Does that mean that pretty much every resource on how the BFG works - including the seminal BFG FAQ - is wrong?

 

How did that happen? And why is it still a thing? - was the BFG FAQ the original source of the error, and if so, how is it still being quoted as gospel 20+ years later?

 

And do any current source ports use the wrong number of iterations?

Share this post


Link to post
1 hour ago, Nootrac4571 said:

How did that happen? And why is it still a thing? - was the BFG FAQ the original source of the error, and if so, how is it still being quoted as gospel 20+ years later?

The original BFG FAQ was written before Doom's source code was released, so it was done via testing and statistical analysis, and margins of error were introduced. It typically doesn't get used these days, but sometimes people make the same mistake you yourself did and confuse old resources as relevant ones.

 

1 hour ago, Nootrac4571 said:

And do any current source ports use the wrong number of iterations?

No. No source ports were made before the source code was released, so such a sequence of events had no chance of manifesting.

Share this post


Link to post

1-to-8 times 15 is 15-to-120 theoretically.

 

So I've set up a spreadsheet with the Doom RNG as column A, the computation (A & 7) + 1 as column B, got the first 14 values to be repeated at the end (so B257 is equal to B1, and B270 is equal to B14, to make things easier for me), and as column C I got the sum of column B values for the next cell and the 14 lowers (so C1 is SUM(B1:B15) and so on). Finally on column D I got just two cells to show me the minimum and maximum from column C. Since there aren't intermediary calls to P_Random(), it should be accurate.

 

The results, drumroll please: 49-87, aka what the wiki is saying. Everything is right, the mistake is in the description but not in the computations.

Share this post


Link to post
13 minutes ago, Edward850 said:

The original BFG FAQ was written before Doom's source code was released, so it was done via testing and statistical analysis, and margins of error were introduced. It typically doesn't get used these days, but sometimes people make the same mistake you yourself did and confuse old resources as relevant ones.

 

Is that true? The BFG FAQ I've been reading (http://www.gamers.org/docs/FAQ/bfgfaq/) is dated August 1999, long after the source code was released. It directly quotes A_BFGSpray, and doesn't use any statistical analysis.

 

Regardless, the point I'm trying to make is that - assuming Carmack's public domain source code is accurate - BFG tracer damage is calculated as the sum of 15 psuedo-random numbers from 1-8. rather than 16, which means that the BFG FAQ is wrong, and both wikis are wrong, and every single resource I've ever found regarding BFG tracer damage is also wrong.

 

It's not a huge error, but it is an error, which seems to have persisted for at least 20 years so far.

 

18 minutes ago, Edward850 said:

sometimes people make the same mistake you yourself did

 

Please let me know what mistake I've made - I'm genuinely interested.

Share this post


Link to post
10 minutes ago, Nootrac4571 said:

Is that true? The BFG FAQ I've been reading (http://www.gamers.org/docs/FAQ/bfgfaq/) is dated August 1999, long after the source code was released. It directly quotes A_BFGSpray, and doesn't use any statistical analysis.

Strange, I must be thinking of something else then. A critical misreading of the code is the only logical answer in that case. 

10 minutes ago, Nootrac4571 said:

and both wikis are wrong

We only have one real wiki, and it says 15 https://doomwiki.org/wiki/BFG9000#Notes

Share this post


Link to post

Amusingly, the wiki had been correct about the 49-87 range from the start (borrowed from Wikipedia at the time). The number of rolls for each tracer, though, was added later.

 

There some weird errors added and the "16 rolls" was added a first time in 2005 before being removed unceremoniously. It was added back in later and then partially fixed in a different section but that fix was removed later.

 

It's amusing to see how some of the sentences haven't changed since it was copied from Wikipedia...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×