Jump to content

Unused/unknown 1 and 2 in DEHACKED


Recommended Posts

What do these fields actually correspond to in the code? I can't find any documentation on it. All it seems to be able to do is center the weapon sprite if you enter (1, 32), or maybe offset the sprite in another way, but why? What do these numbers mean?

Share this post


Link to post

They are the sprites' X and Y offsets. This is only relevant to HUD sprites, and it was unused in vanilla Doom (as well as in Heretic, and in Strife -- Hexen made use of them, though).

 

MBF added some codepointers that use these fields as parameters, so you can use up to two custom values for some functions. An example of use is Valiant, in how the arachnotrons in that mod have a chance of spawning an arachnorb when they die: both the random chance and the spawning are made with these MBF functions that use the misc/unknown values.

Share this post


Link to post

Is it true that these can be used to speed up the weapon change time in vanilla Doom? I’ve heard that but haven’t been able to achieve it yet.. Something about having more open space around the sprite causing it to come up faster. It’s an awesome idea, especially for Deathmatch where weapon changing is a leading cause of death.

Share this post


Link to post

As I read the DOOM source, they are not completely unused, the code in p_pspr.c does use those fields in one place: P_SetPsprite, and I think Doomkid is right in that when lowering weapons (via A_Lower) the current Y offset is decremented until the weapon is below the screen, so you can fool that logic to make weapon changing near instantaneous.

Share this post


Link to post
7 hours ago, Doomkid said:

Is it true that these can be used to speed up the weapon change time in vanilla Doom? I’ve heard that but haven’t been able to achieve it yet..

Yes, provided you have at least 2 unused states/weapon.

Edited by TheNoob_Gamer

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...