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

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.

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
×