Lop-sided bossbrain explosions

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Lop-sided bossbrain explosions

Postby Enjay » Thu Apr 26, 2012 12:27 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Lop-sided bossbrain explosions

Postby NeuralStunner » Thu Apr 26, 2012 1:04 pm

I think this is it:
Code: Select allExpand view
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
User avatar
NeuralStunner
Cuddly but Packin'
 
 
 
Joined: 21 Jul 2009
Location: Indiana, USA
Discord: NeuralStunner#1293
Operating System: Windows Vista/7 64-bit

Re: Lop-sided bossbrain explosions

Postby Gez » Thu Apr 26, 2012 1:42 pm

And it seems to have been deliberately fixed in EDGE at some point:
Code: Select allExpand view
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.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Lop-sided bossbrain explosions

Postby printz » Thu Apr 26, 2012 3:17 pm

Please don't tell me... that explosions are spawning off the map!
User avatar
printz
BOW BEFORE ME!
 
Joined: 26 Oct 2006
Location: Bucharest, Romania

Re: Lop-sided bossbrain explosions

Postby Edward-san » Thu Apr 26, 2012 5:54 pm

Interesting...it happens also in chocolate-doom and prboom. DOOM2.EXE?
Edward-san
Mathematics is the language with which God has written the universe. (Galilei)
 
Joined: 17 Oct 2009

Re: Lop-sided bossbrain explosions

Postby Enjay » Thu Apr 26, 2012 6:02 pm

Chocolate, PRBoom, yes it seems to be happening in both of them. Vanilla, I think so but can't be sure.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Lop-sided bossbrain explosions

Postby Gez » Thu Apr 26, 2012 6:34 pm

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 allExpand view
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.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Lop-sided bossbrain explosions

Postby Xtyfe » Thu Apr 26, 2012 9:25 pm

Interesting, a new vanilla bug has been discovered :D
User avatar
Xtyfe
Neque Deos, Neque Dominos
 
Joined: 14 Dec 2007
Location: The Intertubes

Re: Lop-sided bossbrain explosions

Postby Edward-san » Fri Apr 27, 2012 8:25 am

Someone should make a new thread on doomworld forum! :D
Edward-san
Mathematics is the language with which God has written the universe. (Galilei)
 
Joined: 17 Oct 2009

Re: Lop-sided bossbrain explosions

Postby Enjay » Fri Apr 27, 2012 11:40 am

Presumably whoever changed the code in EDGE already discovered it.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Lop-sided bossbrain explosions

Postby Graf Zahl » Fri Apr 27, 2012 12:35 pm

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
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Lop-sided bossbrain explosions

Postby printz » Fri Apr 27, 2012 3:46 pm

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?
User avatar
printz
BOW BEFORE ME!
 
Joined: 26 Oct 2006
Location: Bucharest, Romania

Re: Lop-sided bossbrain explosions

Postby Gez » Fri Apr 27, 2012 4:12 pm

Gez
 
 
 
Joined: 06 Jul 2007

Re: Lop-sided bossbrain explosions

Postby Graf Zahl » Fri Apr 27, 2012 4:35 pm

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.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Lop-sided bossbrain explosions

Postby Gez » Fri Apr 27, 2012 5:26 pm

I wonder if there would be some merit into making A_BrainScream 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 ACS exists.
Gez
 
 
 
Joined: 06 Jul 2007

Next

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests