team-eternity / eternity

The Eternity Engine
http://eternity.youfailit.net/wiki/Main_Page
GNU General Public License v3.0
230 stars 36 forks source link

Something got wrong with slope below sector-portal after last DRD-devbuild 1361. #627

Closed Meerschweinmann closed 2 weeks ago

Meerschweinmann commented 2 weeks ago

Hello again :)

Here is something not so fine i has noticed with the EE i had build this evening. With the last DRD-devbuild 1361 everything was fine, but something that happened after that build made problems with the slope below the sector portal, you can see in the screenshots.

After_DRD1361 DRD1361 UDB

Meerschweinmann commented 2 weeks ago

Update:

looking at the slope directly, without looking through a portal, everything is fine with the newest selfmade build.

etrn01

Meerschweinmann commented 2 weeks ago

Update 2:

Even the small slopes left and right on that black "roof" get errors when flying in the portal above their sectors and looking on them through a sector portal.

etrn02 etrn03

Meerschweinmann commented 2 weeks ago

Here is a test-map i made some time ago. I added a little ramp with two slopes as start. When trying to look at that ramp from above the tower or using the fly mode, the latest EE crashes or the ramp slopes are not showing correctly.

When using DRD-devbuild 1361 everything is fine.

EE_portal_multifloor-lift.zip

Altazimuth commented 2 weeks ago

Note: 1361 is b340ea2d6. The last DRDTeam devbuild before that is at 01b5c5e44.

Altazimuth commented 2 weeks ago

OK the rendering error is introduced by b0888fae1f60f03f2054d1e002bf46f7729190df. It appears present when you view the slopes for a different portal layer. I can't repro a crash but, yeah. It looks like forcing P_GetSlopedSectorBaseDelta to return 0 fixes the rendering issue for these slopes at least. No idea what sort of crash this could cause. What type of crash are you getting? Straight crash to desktop or an I_Error message?

Poking further it looks like extremum is set to D_MAXINT (2147483647) initially, but is never overridden in the loop. Perhaps there should be some sort of handling if it never gets set? The reason why it's never set is because of this:

   seg.frontsec = R_FakeFlat(viewpoint, seg.frontsec, &tempsec, tempslopes,
                             &floorlightlevel, &ceilinglightlevel, false);   // killough 4/11/98

   // ioanch: reject all sectors fully above or below a sector portal.
   if(portalrender.active && portalrender.w->portal->type != R_SKYBOX &&
      ((portalrender.w->type == pw_ceiling &&
        R_getSlopeBaseHeight(*seg.frontsec, tempsec, surf_ceil) <
...

seg.frontsec is tempsec, and then in P_GetSlopedSectorBaseDelta it iterates over the 0 lines that tempsec has so, yeah, the sloped sector base delta is very incorrect.

Meerschweinmann commented 2 weeks ago

Hooray, the new fix works flawless in my first posted map and the here uploaded test-map. Thanks you.

The crashes happened in total two or three times on both maps i tested. It seemed turning around the DOOM guy, near the slope in the above Portal sector flying, to view the glitching slope does the crash

Getting the slope glitching from distance and then flying to it did not crash. It seemed to me that it happened when the whole glitching slope came instantly and nearly flying on screen by turning the flying DOOM guy. But i don't get it how to surely reproduce.

I had tested the glitching slopes many times, so two or three crashes were not the majority behavior.