Jump to content

Is the player radius increased in PSX Doom?


VGA

Recommended Posts

I am playing through it and it seems maybe I am getting hit by projectiles just a little bit too easily. Also, getting caught in walls. Of course, it may just be the collision code being different.

 

Does anyone have concrete info?

 

@intacowetrust ?

Share this post


Link to post

From looking at the Greatest Hits (v1.1) binary of PSX DOOM the player radius at least appears to be the same as Linux Doom. The radius is 16.0 units and height 56.0 (both in fixed point). Not sure about the collision code, I haven't gone through that in detail yet.

Share this post


Link to post

If you encounter anything interesting, let us know. Maybe I am wrong about the projectiles but I have also noticed the Demons can more easily chomp on the player. In DOS Doom it seems any small gap keeps you out of reach.

Share this post


Link to post

Will do! Another thing which could be a factor also is that the game renders to a 256x240 framebuffer which gets stretched out to approximately 293x240 on the display. That would make horizontal distances and gaps seem larger than they are on PC and might make the hit detection seem a little more eager than it was before.

 

I don't know if that would account for all the differences you described but it's definitely a thing. It's also responsible for the more 'flattened' look of PSX Doom with regards to sector heights.

Share this post


Link to post

Just on the melee range stuff as well, it seems as though you may be correct @VGA. The following definition can be found in Linux Doom:

 

#define MELEERANGE        (64*FRACUNIT)

On Jag Doom and PSX it's this instead (extending the maximum allowed melee reach by 6.0 units):

 

#define    MELEERANGE        (70*FRACUNIT)

To add to this further the PC version of 'P_CheckMeleeRange' appears to shorten the allowed range by 4.0 units, by subtracting 20.0 units and then adding the player's radius (16.0 units) to the range:

 

boolean P_CheckMeleeRange (mobj_t*	actor)
{
    mobj_t*	pl;
    fixed_t	dist;
	
    if (!actor->target)
	return false;
		
    pl = actor->target;
    dist = P_AproxDistance (pl->x-actor->x, pl->y-actor->y);

    if (dist >= MELEERANGE-20*FRACUNIT+pl->info->radius)
	return false;
	
    if (! P_CheckSight (actor, actor->target) )
	return false;
							
    return true;		
}

Here's the same code from Jag Doom:

 

boolean P_CheckMeleeRange (mobj_t *actor)
{
	mobj_t		*pl;
	fixed_t		dist;
	
	if (! (actor->flags&MF_SEETARGET) )
		return false;
							
	if (!actor->target)
		return false;
		
	pl = actor->target;
	dist = P_AproxDistance (pl->x-actor->x, pl->y-actor->y);
	if (dist >= MELEERANGE)
		return false;
	
	return true;		
}

 

So yeah, it looks like monsters can reach you from an extra 10.0 units away on Jag and PSX Doom - confirming what you suspected.

Share this post


Link to post

That is a significant difference!

 

Another thing I have noticed (playing on an inaccurate emulator) is that the SSG has a bit of a lag before actually firing. Can you check how many gameticks it takes to fire on PSX? In DOS it is a delay of 3 ticks (and the game runs at 35 ticks per second, I think that's 0.086 seconds of delay plus whatever input delay there is)

 

https://zdoom.org/wiki/Classes:SuperShotgun

Share this post


Link to post

Sure thing! Here are the frame states for the super shotgun on PSX that I pulled from the original .EXE, the 3rd column of data is the 'tics' or duration field for the state:

 

8005910C:    u32[7] State_S_DSGUN     = { 6, 0, 1, 80020298, 20, 0, 0  } // 80020298 = A_WeaponReady
80059128:    u32[7] State_S_DSGUNDOWN = { 6, 0, 1, 8002053C, 21, 0, 0  } // 8002053C = A_Lower
80059144:    u32[7] State_S_DSGUNUP   = { 6, 0, 1, 800206B4, 22, 0, 0  } // 800206B4 = A_Raise
80059160:    u32[7] State_S_DSGUN1    = { 6, 0, 2, 0,        24, 0, 0  }
8005917C:    u32[7] State_S_DSGUN2    = { 6, 0, 3, 8002112C, 25, 0, 0  } // 8002112C = A_FireShotgun2
80059198:    u32[7] State_S_DSGUN3    = { 6, 1, 3, 0,        26, 0, 0  }
800591B4:    u32[7] State_S_DSGUN4    = { 6, 2, 3, 8002051C, 27, 0, 0  } // 8002051C = A_CheckReload 
800591D0:    u32[7] State_S_DSGUN5    = { 6, 3, 3, 80021690, 28, 0, 0  } // 80021690 = A_OpenShotgun2
800591EC:    u32[7] State_S_DSGUN6    = { 6, 4, 3, 0,        29, 0, 0  }
80059208:    u32[7] State_S_DSGUN7    = { 6, 5, 3, 800216B4, 2A, 0, 0  } // 800216B4 = A_LoadShotgun2
80059224:    u32[7] State_S_DSGUN8    = { 6, 6, 2, 0,        2B, 0, 0  }
80059240:    u32[7] State_S_DSGUN9    = { 6, 7, 2, 800216D8, 2C, 0, 0  } // 800216D8 = A_CloseShotgun2
8005925C:    u32[7] State_S_DSGUN10   = { 6, 0, 2, 80020480, 20, 0, 0  } // 80020480 = A_ReFire

For reference, here's the actual struct for state_t (7 32-bit words), pretty much the exact same as on PC:

 

struct state_t {
    spritenum_t     sprite;         // Sprite number to use for the state
    int32_t         frame;          // What frame of the state to display
    int32_t         tics;           // Number of tics to remain in this state, or -1 if infinite
    void*           action;         // Action function to call upon entering the state, may have 1 or 2 parameters depending on context (map object vs player sprite).
    statenum_t      nextstate;      // State number to goto after this state
    int32_t         misc1;          // State specific info 1: appears unused in this version of the game
    int32_t         misc2;          // State specific info 2: appears unused in this version of the game
};

 

The state you mentioned which occurs before firing (S_DSGUN1) lasts for 2 tics here on PSX instead of 3 on PC. The timebase on PSX DOOM however is 15 Hz instead of 35 Hz, so that delay amount is 2/15 seconds or 0.1333 seconds - a much longer delay than on PC. So it looks like you are correct again :)

Edited by intacowetrust

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...