[Not a bug] A_SpawnItemEx spawning inside walls

Bugs that have been investigated and resolved somehow.

Moderator: Developers

A_SpawnItemEx spawning inside walls

Postby Xtyfe » Sat Aug 18, 2012 8:36 pm

Discussed on IRC...

[21:30:51] <Xtyfe> A_SpawnItemEx, is it normal for it to spawn monsters inside walls even if the SXF_NOCHECKPOSITION flag is not used
[21:31:23] <@Kate> No.
[21:31:36] <@Kate> that means collision checks are failing somewhere
[21:31:41] <Xtyfe> :O
[21:32:00] <Xtyfe> so that would be a bug
[21:32:12] <@Kate> well actually does it have +SOLID? I think it only checks if it *can* collide with something, though I'm not entirely sure
[21:32:43] <@Kate> though either way it should work since nonsolid things can still collide with walls...
[21:33:02] <Xtyfe> yes, it has the monster flag set
[21:33:16] <@Kate> then this is probably a bug
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_SpawnItemEx spawning inside walls

Postby randi » Wed Aug 22, 2012 6:23 pm

Hast thou an example?
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: A_SpawnItemEx spawning inside walls

Postby Xtyfe » Wed Aug 22, 2012 6:30 pm

Indeed good sir.

Here is a simplified version of the pain elemental I use that spawns lost souls using A_SpawnItemEx, a good map to test this on is community chest 1 map06, there is a pain elemental before the first keyed door that always seems to spawn at least one in a wall close to where it spawns when it dies.

Code: Select allExpand view
Actor XtPainElemental replaces PainElemental
{
MONSTER
+FLOAT
+NOGRAVITY
+DONTFALL
+QUICKTORETALIATE
+DONTHARMSPECIES
+DONTGIB
//+TELESTOMP
Radius 31
Height 56
//Height 66
Mass 250
Health 175
PainChance 96
Speed 8
MinMissileChance 128
Species "PainElemental"
SeeSound "pain/sight"
ActiveSound "pain/active"
PainSound "pain/pain"
DeathSound "pain/death"
States
   {
   Spawn:
      TNT1 A 0
      PAIN A 1 A_LookEx (0, 0, 0, 0, 0, "Chase")
      Loop
   Chase:
      PAIN A 2 A_Chase ("", "")
      PAIN AA 2 A_Chase ("", "Missile")
      PAIN B 2 A_Chase ("", "")
      PAIN BB 2 A_Chase ("", "Missile")
      PAIN C 2 A_Chase ("", "")
      PAIN CC 2 A_Chase ("", "Missile")
   Missile:
      PAIN DE 5 Bright A_FaceTarget
      TNT1 A 0 A_PlaySound ("pain/attack", CHAN_VOICE, 1, 0)
      TNT1 A 0 A_SpawnItemEx ("LostSoul", 64, 0, 0, 0, 0, 0, 0, SXF_SETMASTER|SXF_TRANSFERPITCH)
      PAIN F 5 Bright A_FaceTarget
      Goto Chase
   Pain:
      PAIN G 5
      PAIN G 5 A_Pain
      Goto Chase
   Death:
      PAIN H 5
      PAIN I 5 A_Scream
      PAIN J 5 Bright
      PAIN K 5 Bright
      TNT1 A 0 A_SpawnItemEx ("LostSoul", 64, -64, 0, 0, 0, 0, 0, SXF_SETMASTER|SXF_TRANSFERPITCH)
      TNT1 A 0 A_SpawnItemEx ("LostSoul", 92, 0, 0, 0, 0, 0, 0, SXF_SETMASTER|SXF_TRANSFERPITCH)
      TNT1 A 0 A_SpawnItemEx ("LostSoul", 64, 64, 0, 0, 0, 0, 0, SXF_SETMASTER|SXF_TRANSFERPITCH)
      PAIN LM 5 Bright
      Stop
   }
}
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_SpawnItemEx spawning inside walls

Postby randi » Thu Feb 21, 2013 10:22 pm

Xtyfe wrote:there is a pain elemental before the first keyed door that always seems to spawn at least one in a wall close to where it spawns when it dies.

In a wall or beyond a wall?
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: A_SpawnItemEx spawning inside walls

Postby Xtyfe » Thu Feb 21, 2013 11:45 pm

Beyond I think? the lost soul is able to move in the void outside of the map. Its been awhile so I can recheck again if you want and take a screenshot
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_SpawnItemEx spawning inside walls

Postby randi » Fri Feb 22, 2013 11:24 am

In that case, it's not a bug. It's not spawning inside a wall; it's spawning beyond a wall. Boom added a function for the Pain Elemental that specifically handles this case.
User avatar
randi
Site Admin
 
Joined: 09 Jul 2003

Re: A_SpawnItemEx spawning inside walls

Postby Xtyfe » Fri Feb 22, 2013 1:55 pm

Wait what? Handles it being in a wall or beyond a wall? What function is that then since I seem to missing it.
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_SpawnItemEx spawning inside walls

Postby Graf Zahl » Fri Feb 22, 2013 2:09 pm

A_PainShootSkull checks if there's a blocking wall between the Pain Elemental and the newly spawned LostSoul.

Code: Select allExpand view
   FBoundingBox box(MIN(self->x, x), MIN(self->y, y), MAX(self->x, x), MAX(self->y, y));
   FBlockLinesIterator it(box);
   line_t *ld;

   while ((ld = it.Next()))
   {
      if (!(ld->flags & ML_TWOSIDED) ||
         (ld->flags & (ML_BLOCKING|ML_BLOCKMONSTERS|ML_BLOCKEVERYTHING)))
      {
         if (!(box.Left()   > ld->bbox[BOXRIGHT]  ||
              box.Right()  < ld->bbox[BOXLEFT]   ||
              box.Top()    < ld->bbox[BOXBOTTOM] ||
              box.Bottom() > ld->bbox[BOXTOP]))
         {
            if (P_PointOnLineSide(self->x,self->y,ld) != P_PointOnLineSide(x,y,ld))
               return;  // line blocks trajectory            //   ^
         }
      }
   }
User avatar
Graf Zahl
 
Joined: 19 Jul 2003
Location: Germany

Re: A_SpawnItemEx spawning inside walls

Postby Xtyfe » Fri Feb 22, 2013 2:14 pm

I figured as much, It's part of A_PainAttack and A_PainDie then. Well there is a reason why I wasn't using those. I don't suppose such a function would be added to A_SpawnItemEX? It sounds like it needs it
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_SpawnItemEx spawning inside walls

Postby Gez » Fri Feb 22, 2013 2:19 pm

It should be done unless SXF_NOCHECKPOSITION is set, IMO.
Gez
 
Joined: 06 Jul 2007

Re: A_SpawnItemEx spawning inside walls

Postby Graf Zahl » Fri Feb 22, 2013 4:22 pm

No, it shouldn't. Careless changes like that are the biggest compatibility problem an engine can develop.
User avatar
Graf Zahl
 
Joined: 19 Jul 2003
Location: Germany

Re: A_SpawnItemEx spawning inside walls

Postby Xtyfe » Fri Feb 22, 2013 7:55 pm

Figures. :roll:

Anyways, I gave up on this months ago and it seems it was the right move. When it gets to the point where you need to use a hack to work around another hack, its time to throw in the towel.
Xtyfe
 
Joined: 14 Dec 2007
Location: Kitchener, Ontario

Re: A_SpawnItemEx spawning inside walls

Postby Xaser » Fri Feb 22, 2013 9:27 pm

As a for-the-record, because someone's likely to ask, doing a "don't spawn if in the void" check isn't easy since there's really no such thing as "in the void" as far as the engine is concerned; even when outside the boundaries of the map, the player still "exists" in a sector.

Or so I presume. Correct me if I'm wrong and there's some alternative method. ;)
User avatar
Xaser
secretly a supercomputer being a government
 
Joined: 20 Jul 2003
Location: .plɹoʍɹǝʌǝu.


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests