Page 1 of 1

A monster has somehow ended up below the floor

Posted: Wed Dec 05, 2018 11:42 am
by Player701
I've been playtesting my mod with Plutonia and on MAP32 an arachnotron has somehow ended up below the floor. I can hear it, and it can apparently see me and shoot at me, but its shots can't hit me. It is possible to hit it with hitscan weapons, however.

My mod has not been released yet, so I'm going to PM it to Graf shortly. The mod doesn't replace arachnotrons and doesn't contain any weapons or artifacts capable of arbitrarily changing a monster's position, so I'm pretty sure it's not an error in the mod.

Unfortunately, I haven't been able to reproduce this so far, so I'm not sure if there is a chance for this bug to be fixed. I do have some additional information on this, however. Technically, the arachnotron is not below the floor, because its Z-position and the floor height of the sector it is in are equal (-32). It is the sector the monster is in that is wrong - debugging shows that the arachnotron is in sector 12 (the green-floored outdoor area), while its position suggests it is actually in sector 72 (the raised walkway on the perimeter of the outdoor area).

I vaguely remember running into a similar issue on the very same map long ago, but I thought it was a mapping error, so I didn't report it. You know, the ubiquitous monsters-pop-out-of-the-floor kind of thing. I thought I had missed a trigger for it or something. But now I see this definitely isn't the case. Maybe it's related to the map structure somehow?

Save file attached. NB: the save file was made with GZDoom g3.7pre-307-gb79e3f890, not sure if it will work in newer builds, but it probably will.

Re: A monster has somehow ended up below the floor

Posted: Thu Dec 06, 2018 9:18 am
by Player701
Yes!!! After countless tries, I've managed to reproduce the bug in vanilla Plutonia and capture it in a demo file. The demo has been recorded with the same version, g3.7pre-307-gb79e3f890. Unfortunately, it desyncs in later builds. Attempts to reproduce the bug in newer builds are currently underway (if it isn't required, please tell me).

I used a special monitoring script to detect arachnotrons in sector 12. The script alerted me that one of them had ended up there when I was shooting the cyberdemon at the end of the "Doom II MAP01"-like corridor. The buggy arachnotron is interacted with towards the end of the demo, where I also demonstrate that it can see me and shoot at me but can't hit me. Then I kill it with the super shotgun.

Demo attached. I hope it will be more useful than a savegame for debugging this... right?

Re: A monster has somehow ended up below the floor

Posted: Thu Dec 06, 2018 10:58 am
by Player701
Sorry for the third post in a row, I thought it was too much information for a single post. If moderators disagree with me, I don't mind if all my posts in this thread are merged into one.

Another update on this. Here is a test sample to reproduce the bug, also attached to this report:

Code: Select all

class TestInv : Inventory
{
    override bool Use(bool pickup)
    {
        Owner.SetOrigin((1152, -832, 64), false);
        Owner.angle = 45;
        
        Spawn('Arachnotron', (1282.4826319990048, -767.99539297481579, 64));       
        return true;
    }
}
Run GZDoom with the following command-line parameters:

Code: Select all

gzdoom.exe -iwad plutonia -file zscript.txt -nomonsters -warp 32 +give TestInv
Then type "use TestInv" in the console. The spawned arachnotron immediately falls below the floor.

Debugging indicates that P_CheckPosition is the culprit - it somehow manages to return the wrong sector. The test sample works in GZDoom g3.7pre-748-gf6561ca23.

Re: A monster has somehow ended up below the floor

Posted: Thu Dec 06, 2018 11:12 am
by Graf Zahl
This is a known issue with one older node builder. They tend to produce some broken zero dimension part of the map and if some actor ends up precisely on that line it will be in the wrong sector. Maps suffering from this are hard to find because it requires very special circumstances to ever result in bad actor positioning. The only known event that can do this is a teleport to a destination right on the line - which essentially is what you are doing here.


Normally this needs to be handled by forcing a node rebuild. Can you verify that this doesn't happen if you set 'gennodes' to 1? If that fixes it, please post the MD5 checksum of the map for inclusion into compatibility.txt

Re: A monster has somehow ended up below the floor

Posted: Thu Dec 06, 2018 11:28 am
by Player701
I can confirm that the problem is gone if "gennodes" is set to 1.

Code: Select all

]mapchecksum map32
D5F64E02679A81B82006AF34A6A8EAC3 // plutonia.wad map32
Graf Zahl wrote:The only known event that can do this is a teleport to a destination right on the line - which essentially is what you are doing here.
Note that in the demo, there is no teleportation involved. Debugging indicates that A_Chase is responsible for moving the arachnotron into the buggy position. So it's not only teleportation that can trigger this.

If I ever encounter anything like this again, should I consider it to be caused by the same problem (bad nodes)? It is not easy to debug these, as you can see.

Upd:
Graf Zahl wrote:They tend to produce some broken zero dimension part of the map
Why not rebuild nodes for every map that has such zero dimension parts? Is it difficult to detect them?

Re: A monster has somehow ended up below the floor

Posted: Thu Dec 06, 2018 11:37 am
by Graf Zahl
Yes, they are not easy to detect. I currently have no idea how to do it. The node loader already performs several sanity checks but these nodes are technically not broken, they just cannot be processed properly.

Re: A monster has somehow ended up below the floor

Posted: Thu Dec 06, 2018 12:58 pm
by Rachael
I've gone ahead and did the fix since it was a quicky.