by Gez » Tue Sep 08, 2020 3:03 am
The offset of a sprite is the coordinate of its pivot point, relative to the origin of the sprite image. As you know, the origin is the reference point for coordinates, and in computer graphics it is typically the upper left corner. The pivot point is the point of the sprite image that is positioned at the exact coordinates of the in-game actor. For example, if you have an imp at map coordinates 512, -128, 32, this is the coordinates of a single point, and the imp's collision box is obviously larger than that. It has a radius and a height. But these are projected from this single coordinate. The coordinate +/- the radius to give the horizontal limits of the collision box, and the coordinate + height for the upper vertical limit, while the lower vertical limit is at the coordinate. (I simplify a bit here, because there are special cases where the behavior differs, but we'll ignore them to keep things simple.)
So from this you should be able to guess that the pivot point of the sprite should correspond to a place that is in the center of the sprite horizontally, and at the bottom vertically, if you want the graphics of the sprite to more-or-less match the physicality of the actor's collision box.
Now the default value for offset positions, like most default values, are 0. And, well, 0, 0 is the origin point, by definition. Which means the upper left corner. And that really doesn't match the collision box since we want the bottom middle instead.
When you look at sprites in SLADE 3, you can see their offset values, and change them. They're in little boxes below the image display.
Now when we're talking not about sprites, but about shooting projectiles, the offsets are an entirely different thing. It's now the coordinates at which to spawn the projectile, relative to the default projectile spawning point, which is IIRC the center of the shooter's collision box. As in, same horizontal coordinates, and vertical coordinate + half the actor height. This is why, for example, a cyberdemon appears to shoot rockets from its crotch instead of from its rocket launcher arm. Or why a mancubus' fireballs both come from its fat belly instead of its arm-cannons. You can adjust the position left and right and up and down (but not fore and aft). This can allow to get the projectiles to spawn more visibly from where they're supposed to spawn, and it was used mostly in Hexen (look at Korax's six-armed spell attacks) and Doom 64, but not in the original PC Doom (hence the issues with cybies and mancs).