How many extra pixels to the bottom/sides of HUD sprites?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
How many extra pixels to the bottom/sides of HUD sprites?
Here's a question to modders who are used to making weapon mods. How many pixels would you "spare" that extend to the bottom to make sure it's bobbing friendly, and also to the side, so that it is widescreen friendly?
Re: How many extra pixels to the bottom/sides of HUD sprites
I'd say about 32 pixels extra height wouldn't hurt, since we aren't really striving for 5 MB-max nowadays.
As for width, that's a tough one. But if we're talking about weapons that fit in 320x240, then I'd say around 120 pixels. (Probably way, way too much.)
As for width, that's a tough one. But if we're talking about weapons that fit in 320x240, then I'd say around 120 pixels. (Probably way, way too much.)
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: How many extra pixels to the bottom/sides of HUD sprites
For bobbing it doesn't matter. It never passes above the baseline. However, add some extra image below if you'd like some room to play with offsets a bit.
If the sprite meets the top of the screen, make sure it's got a few pizels above.
To be widescreen friendly, give each side an extra 16 pixels for the screen space, and another 16 to account for bobbing.
384x200 is the minimum space. Expand in total to about 400x240 for lots of room to throw the image around in.
Once you're lined up to the center point in the screen preview, in whatever wad editor you use, make sure to bump it upward by another 32 pixels. (The bottom of the screen in a full screen mode will be at the "Status bar" line. Yes it's stupid, but blame Id.)
If the sprite meets the top of the screen, make sure it's got a few pizels above.
To be widescreen friendly, give each side an extra 16 pixels for the screen space, and another 16 to account for bobbing.
384x200 is the minimum space. Expand in total to about 400x240 for lots of room to throw the image around in.
Once you're lined up to the center point in the screen preview, in whatever wad editor you use, make sure to bump it upward by another 32 pixels. (The bottom of the screen in a full screen mode will be at the "Status bar" line. Yes it's stupid, but blame Id.)
Re: How many extra pixels to the bottom/sides of HUD sprites
Actually, bobbing does matter because I need to know how far down to render the hands. For the top, this is easy, just render all the way up.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: How many extra pixels to the bottom/sides of HUD sprites
I've encountered some problems from scaling inaccuracy at the top, so the sprite needs to extend a ways above to prevent gaps.
Classic bobbing only goes down, left and right, so your graphic won't be moving any higher unless you offset it.
Classic bobbing only goes down, left and right, so your graphic won't be moving any higher unless you offset it.
Re: How many extra pixels to the bottom/sides of HUD sprites
Ahh I see. Thanks for clarifying the bobbing pattern.
Re: How many extra pixels to the bottom/sides of HUD sprites
In the super shitty shooters I ripped from flash games, I've noticed that the angled weapons tend to get cut by bobbing motion. The moral of the story is that centered weapons rule.
Anyway, you should include quite a bit since you have to account for both widescreen and bobbing.
Anyway, you should include quite a bit since you have to account for both widescreen and bobbing.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: How many extra pixels to the bottom/sides of HUD sprites
Hey Gez, since you're here, I'd love to have an alternate version of Slade 3's "HUD" view that takes the 32 Y adjustment into account. 

Re: How many extra pixels to the bottom/sides of HUD sprites
Relevant to thread:
This constant is used as a cap to player weapon bobbing.
Relevant to last post: what do you mean by that exactly?
Code: Select all
// 16 pixels of bob
#define MAXBOB 0x100000
Relevant to last post: what do you mean by that exactly?
-
-
- Posts: 3212
- Joined: Wed Nov 24, 2004 12:59 pm
- Operating System Version (Optional): Kubuntu
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Contact:
Re: How many extra pixels to the bottom/sides of HUD sprites
Don't forget that the 5:4 ratio (tallscreen) has additional space at the top of the screen. About 14 pixels IIRC, but I could just be pulling that number out of thin air.NeuralStunner wrote:If the sprite meets the top of the screen, make sure it's got a few pizels above.
Re: How many extra pixels to the bottom/sides of HUD sprites
I think it was 16 pixels for 5:4, last I remember when I tried to account for it when drawing my fullscreen graphics...