Doom/Heretic/Strife line type 49 - error?

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Doom/Heretic/Strife line type 49 - error?

Post by Gez »

I just noticed that in Doom, linedef type 49 corresponds to [wiki]Ceiling_CrushAndRaise[/wiki]:

Code: Select all

      case 49:
	// Ceiling Crush And Raise
	if (EV_DoCeiling(line,crushAndRaise))
	    P_ChangeSwitchTexture(line,0);
	break;
In Heretic, however, it's [wiki]Ceiling_LowerAndCrush[/wiki]:

Code: Select all

		case 49:		// Lower Ceiling And Crush
			if (EV_DoCeiling(line,lowerAndCrush))
				P_ChangeSwitchTexture(line,0);
			break;
But the xlat file for Heretic does not reflect that change.

But what confuses me is that the DB2 configuration for Doom maps gives it a description that matches Heretic's effect ("Ceiling Lower to 8 above Floor").

Even more interesting is the fact that, testing in vanilla Heretic, it actually doesn't deal crushing damage at all.

Here's basically the same map twice thrice, in the E1M1 slot. Line49d is for Doom, line49h for Heretic. The only change between them is the textures used. Line49s is for Strife and is in the MAP02 slot.

Edit: Added Strife
Attachments
line49.zip
(2.12 KiB) Downloaded 44 times
Last edited by Gez on Sun Oct 09, 2011 10:42 am, edited 1 time in total.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: Doom/Heretic/Strife line type 49 - error?

Post by Gez »

In vanilla Strife, there is no crushing damage either for line type 49.

Another thing I've noticed is that the crusher moves all the way to the bottom in ZDoom, but in vanilla it stops at 8 units from the bottom before going back up.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: Doom/Heretic/Strife line type 49 - error?

Post by Gez »

So, confirmation that in vanilla the ceiling stops 8 units above the floor:

Code: Select all

	  case crushAndRaise:
	    ceiling->crush = true;
	    ceiling->topheight = sec->ceilingheight;
	  case lowerAndCrush:
	  case lowerToFloor:
	    ceiling->bottomheight = sec->floorheight;
	    if (type != lowerToFloor)
		ceiling->bottomheight += 8*FRACUNIT;
	    ceiling->direction = -1;
	    ceiling->speed = CEILSPEED;
	    break;
See how there's no break after the case crushAndRaise: block, so it continues to the case lowerToFloor: block where it gets a bottomheight increased by 8 units.

Same deal in Heretic, except here we start from case lowerAndCrush: so it doesn't get crush set to true and it doesn't get the topheight set.

Code: Select all

			case crushAndRaise:
				ceiling->crush = true;
				ceiling->topheight = sec->ceilingheight;
			case lowerAndCrush:
			case lowerToFloor:
				ceiling->bottomheight = sec->floorheight;
				if (type != lowerToFloor)
					ceiling->bottomheight += 8*FRACUNIT;
				ceiling->direction = -1;
				ceiling->speed = CEILSPEED;
				break;
In order to get that working in ZDoom, I made the following adjustments:
1. Hacked the crushmode parameter for Ceiling_CrushAndRaiseA, in this way:

Code: Select all

FUNC(LS_Ceiling_CrushAndRaiseA)
// Ceiling_CrushAndRaiseA (tag, dnspeed, upspeed, damage, crushtype)
{
	return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg2), arg4&0x80?8:0, arg3, 0, 0, CRUSHTYPE(arg4&3));
}
So if the crushmode parameter has the MSB set (value 128), then EV_DoCeiling is given a height of 8. Crushmode is &ed with 3 so as not to affect its normal operation. This was needed because there was no more room for additional parameters for this function, and crushmode is the closest to a flag parameter.

Then base xlat has the relevant line changed to this:
49 = USE, Ceiling_CrushAndRaiseA (tag, C_SLOW, C_SLOW, 10, 128)
For Heretic, this line is added:
49 = USE, Ceiling_LowerAndCrush (tag, C_SLOW, 0, 2)
For Strife, the line is changed as such:
49 = USE, Ceiling_CrushAndRaiseA (tag, C_SLOW, C_SLOW, 0, 130)

This gets vanilla-accurate behavior for all three games.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Doom/Heretic/Strife line type 49 - error?

Post by Graf Zahl »

Better add a new special 'Ceiling_CrushAndRaiseDist' where you sacrifice one of the speed parameters for a distance value. No hack and added functionality so it's much better.

Also, please no code fragments. Adding those is always a problem. Better provide a patch file.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: Doom/Heretic/Strife line type 49 - error?

Post by Gez »

The code fragments were because I wanted to discuss the issue first.

Not sure how useful a Dist parameter would be... I think the 8 units in Doom and the rest were to avoid pushing the camera below the ground. There's not much need for more or less distance.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Doom/Heretic/Strife line type 49 - error?

Post by Graf Zahl »

I don't care if it's needed or not - but a hack is not a solution if it can be avoided.
User avatar
Xtyfe
Posts: 1480
Joined: Fri Dec 14, 2007 6:29 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: Doom/Heretic/Strife line type 49 - error?

Post by Xtyfe »

I think this affecting map19 of momento mori to the point where the map can not be continued passed a certain point. Can we get a fix for this ASAP so i can continue my game :roll:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Doom/Heretic/Strife line type 49 - error?

Post by Graf Zahl »

If someone gives me a patch with a non-hack implementation, yes.

But I don't have any time to spend on this myself right now (important delivery deadline to meet at work.)
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: Doom/Heretic/Strife line type 49 - error?

Post by Gez »

patch
Attachments
l49.zip
(1.68 KiB) Downloaded 30 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Doom/Heretic/Strife line type 49 - error?

Post by Graf Zahl »

Thanks.
Post Reply

Return to “Closed Bugs [GZDoom]”