
OK, time to confess, in 25 years of editing Doom, I have never managed to get a clear picture in my head about how weapon offsets work. Back in the days of putting things in with command line tools like DEUSF.EXE, I would resort to a batch file that would insert the graphic into a WAD with command line parameters for the offsets that I provided, start the game (so that I could check what it looked like) and then, when I quit the game I could change the parameters and re-run the BAT file until I eventually got something that looked right. However, it was always trial and error and my understanding really hasn't improved much since then.
So, I'm looking for some help to finally get this concept tied down in my head.
By way of a trial, I just picked a random image that I could easily set to be quite high in the screen and set the offsets in BHS' GrabPNG:

I checked it in slade, and it shows a similar setup:

In both cases, the weapon is displayed in a nice helpful 320x200 box. I deliberately placed it so that the bottom of the arm was well above the bottom of the box.
I naively assumed that the box represented the default view area of the game and that the weapon would appear in the same position in game as it does in the box (i.e. it would be very high on screen and I would see the bottom of the arm graphic). I assumed that where the blue lines meet in the middle of the 320x200 box would be the centre of the game screen and I also assumed that the area at the bottom (in the BHS shot, below the green line) was the area occupied by the status bar. All of these assumptions seem to be wrong. On calling the sprite PISGA0 (to replace the Doom pistol) I got this:




Turns out the green line is the bottom of the screen in full screen mode and none of the lines come particularly close to the top of the status bar in BHS' tool (though it looks like one of the Slade lines will) and the bottom blue line is... anyone's guess. It seems that the 320x200 doesn't really relate to the screen area at all. The top and bottom of the 320x200 box are well below the top/bottom of the screen. As a result, the sprite was nowhere as high as I expected.
Just by way of a double check I tried other games:
Replacing the Strife punch sprite:


Yup, basically the same deal.
Then I (foolishly) replaced the Heretic gold wand and the Hexen Mage wand.




Oh ma heid! That's different! Assuming that there was some special positioning of weapons in Heretic/Hexen (I vaguely remembered that there was), I tried an experiment: I replaced the Mage Wand graphics, and then gave it to myself in Doom.


OK, so at least that's cleared up. The Raven weapons have some special positioning stuff going on, even when used in Doom.
So, anyway, back to the question in hand (pun not intended): what gives? If I want to place a weapon sprite so that it sits exactly at the bottom of the screen with no possibility of the gap below the weapon being seen, what do I aim for? It looks like the green line in GrabPNG does that for me (and I know that there is no easy formula because weapons are positioned from the top so how far they extend down is dependent on the image in question).
But why does the 320x200 box in commonly used tools not seem to correspond to the screen area (or if it does, how does it)? What is that area really trying to show? Why not show a box that can contain the image in exactly the way that the sprite will appear on screen?
And most importantly, how do I get this right as close to first time as possible without having to constantly fiddle around with offsets for ages until it looks right in game?
Any help gratefully received.
