Lop-sided bossbrain explosions

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Lop-sided bossbrain explosions

Post by Enjay »

I've noticed that the explosions that are generated when the icon of sin is defeated seem to have a bias towards one side (to the right as the player looks at it, or the icon's left side). I'm pretty sure this is not a ZDoom problem because I have noticed it in other ports and, I think, it was also there in the original exe but the lower resolution etc makes it harder to be sure.

Consider the following ZDoom screenshots:
Spoiler:
Those were taken across a few different boss deaths. It's not a strong bias, but it is definitely there and very repeatable.

As I mentioned, it's not just ZDoom.
Spoiler:
However, EDGE seems to have a totally different algorithm for spawning the explosions.
Spoiler:
So, anyway, I assume (always a dangerous thing to do) that the explosions are meant to be properly random and spread reasonably evenly across the icon's face. I know that random is often not as random as you might expect where computers are concerned but I wondered if there a reason in the code that anyone has spotted for this slight bias?
User avatar
NeuralStunner
 
 
Posts: 12326
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Lop-sided bossbrain explosions

Post by NeuralStunner »

I think this is it:

Code: Select all

DEFINE_ACTION_FUNCTION(AActor, A_BrainScream)
{
	fixed_t x;
		
	for (x = self->x - 196*FRACUNIT; x < self->x + 320*FRACUNIT; x += 8*FRACUNIT)
	{
		BrainishExplosion (x, self->y - 320*FRACUNIT,
			128 + (pr_brainscream() << (FRACBITS + 1)));
	}
	S_Sound (self, CHAN_VOICE, "brain/death", 1, ATTN_NONE);
(x - 192) to (x + 320), that would give a definite directional bias.

Maybe the developers expanded the size of the explosion area but forgot to change one of the numbers. Who knows? Too much speculation would make my BrainExplode. :P
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: Lop-sided bossbrain explosions

Post by Gez »

And it seems to have been deliberately fixed in EDGE at some point:

Code: Select all

void P_ActBrainScream(mobj_t * bossbrain)
{
	// The brain and his pain...

	float x, y, z;
	float min_x, max_x;

	min_x = bossbrain->x - 280.0f;
	max_x = bossbrain->x + 280.0f;

	for (x = min_x; x < max_x; x += 4)
	{
		y = bossbrain->y - 320.0f;
		z = bossbrain->z + (P_Random() - 180.0f) * 2.0f;

		SpawnDeathMissile(bossbrain, x, y, z);
	}

	if (bossbrain->info->deathsound)
		S_StartFX(bossbrain->info->deathsound, P_MobjGetSfxCategory(bossbrain), bossbrain);
}
The x values range from -280 to +280, instead of from -196 to +320.
User avatar
printz
Posts: 2648
Joined: Thu Oct 26, 2006 12:08 pm
Location: Bucharest, Romania
Contact:

Re: Lop-sided bossbrain explosions

Post by printz »

Please don't tell me... that explosions are spawning off the map!
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Lop-sided bossbrain explosions

Post by Edward-san »

Interesting...it happens also in chocolate-doom and prboom. DOOM2.EXE?
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Lop-sided bossbrain explosions

Post by Enjay »

Chocolate, PRBoom, yes it seems to be happening in both of them. Vanilla, I think so but can't be sure.
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: Lop-sided bossbrain explosions

Post by Gez »

It's not an error made by the Boom guy and imitated by everybody except EDGE. It's an error made by Id Software and fixed only by EDGE.

Vanilla code:

Code: Select all

void A_BrainScream (mobj_t*	mo)
{
    int		x;
    int		y;
    int		z;
    mobj_t*	th;
	
    for (x=mo->x - 196*FRACUNIT ; x< mo->x + 320*FRACUNIT ; x+= FRACUNIT*8)
    {
	y = mo->y - 320*FRACUNIT;
	z = 128 + P_Random()*2*FRACUNIT;
	th = P_SpawnMobj (x,y,z, MT_ROCKET);
	th->momz = P_Random()*512;

	P_SetMobjState (th, S_BRAINEXPLODE1);

	th->tics -= P_Random()&7;
	if (th->tics < 1)
	    th->tics = 1;
    }
	
    S_StartSound (NULL,sfx_bosdth);
}
So, Choco, PrBoom+, vanilla, Mocha, Doomsday, even Terminal Doom for Doomguy's sake will exhibit the same behavior.
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: Lop-sided bossbrain explosions

Post by Xtyfe »

Interesting, a new vanilla bug has been discovered :D
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: Lop-sided bossbrain explosions

Post by Edward-san »

Someone should make a new thread on doomworld forum! :D
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Lop-sided bossbrain explosions

Post by Enjay »

Presumably whoever changed the code in EDGE already discovered it.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Lop-sided bossbrain explosions

Post by Graf Zahl »

EDGE is not Doom. They changed lots of things and most of the code isn't even recognizable anymore. It wouldn't surprise me the least that they just threw away the old code without ever looking and implemented something different. If you look closer, it's not the only functional difference.

Besides, correct or not, you do not change things like this - in particular you do not call such a change a 'fix'. :mrgreen:
User avatar
printz
Posts: 2648
Joined: Thu Oct 26, 2006 12:08 pm
Location: Bucharest, Romania
Contact:

Re: Lop-sided bossbrain explosions

Post by printz »

Graf Zahl wrote: Besides, correct or not, you do not change things like this - in particular you do not call such a change a 'fix'. :mrgreen:
Well, didn't ZDoom start its lifetime by doing exactly this sort of fixes?
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: Lop-sided bossbrain explosions

Post by Gez »

[wiki=Version history]Not really, no[/wiki].
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Lop-sided bossbrain explosions

Post by Graf Zahl »

printz wrote:
Graf Zahl wrote: Besides, correct or not, you do not change things like this - in particular you do not call such a change a 'fix'. :mrgreen:
Well, didn't ZDoom start its lifetime by doing exactly this sort of fixes?

There were a few of this kind. Fortunately I was able to revert some before they could cause any damage.

I guess the biggest issue in this regard is the plasmabump issue - and that was clearly unintentional.
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: Lop-sided bossbrain explosions

Post by Gez »

I wonder if there would be some merit into making [wiki]A_BrainScream[/wiki] into a parameterized function, so that people can fix this if so they want with a simple actor replacement.

Something like A_BrainScream(distance = 320, left = 196, right = 320, step = 8, heightbase = 128, heightrange = 512, flags = 0, scream = "brain/death"); with flags for relative angle (use actor's facing rather than south) and relative height (instead of absolute values).

Probably not really worth the effort given [wiki]ACS[/wiki] exists.
Post Reply

Return to “General”