printz Posted February 2, 2016 I've discovered that old vanilla "self-referencing sector" hacks will not work properly in maps with linked portals. For those who don't know: self-referencing sectors are made by creating a polygon inside a larger sector, and making both sides of the polygon lines point to the inner sector. This is used to make deep water or invisible platforms in vanilla Doom. It has since been superseded by Boom's transfer-heights special (242) on both accounts. Why they don't work with linked portals: the self-ref sectors have no linedefs with sides pointing to other sectors, i.e. they're isolated. They get excluded from grouping into layers. So it means that when you're inside them, your logical coordinates will be shifted far away, and physics will be broken. 0 Share this post Link to post
Graf Zahl Posted February 2, 2016 That problem should be solvable, shouldn't it? I've been thinking about this, too, for other reasons, in GZDoom. Since I use GL nodes there it was relatively simple, but if you can't rely on those my idea would have been to use P_PathTraverse to see what these self-referencing sectors actually connect to. That would involve to actually group all areas that are not connected to portals as well, starting at any one-sided line in an ungrouped sector, until no more sectors with one-sided lines can be found. What's left must be self-referencing in some way but since everything else has been grouped, just doing a single P_PathTraverse from one of the lines of such a sector should be enough to eventually find something that has been grouped before. Such an approach would possibly catch 99% of all self referencing sector setups, if not all, provided these aren't caused by actual mapping bugs. 0 Share this post Link to post
Gez Posted February 2, 2016 Given the existence of the Boom transfers, I think it's perfectly fine to have this limitation. 0 Share this post Link to post
Graf Zahl Posted February 2, 2016 That may be, but if it can be addressed - why not? 0 Share this post Link to post
printz Posted February 15, 2016 Graf Zahl said:That may be, but if it can be addressed - why not? Addressed how? By using P_PathTraverse to scan the map until encountering the first valid linedef? It sounds like a hack meant to work around another hack that's even replaceable. The problem is that the self-referencing sector problem described here is insidious. No warning appears and you might only see the bug in some situations. 0 Share this post Link to post
Graf Zahl Posted February 15, 2016 I'm going to try something this evening, if it works you may have it if you want. 1 Share this post Link to post
Graf Zahl Posted February 15, 2016 No actual handling of self-referencing sectors but doing this should at least print some messages about them: // mark everything that connects to a one-sided line for (int i = 0; i < numlines; i++) { if (lines[i].backsector == NULL && lines[i].frontsector->PortalGroup == 0) { CollectSectors(-1, lines[i].frontsector); } } // and now print a message for everything that still wasn't processed. for (int i = 0; i < numsectors; i++) { if (sectors[i].PortalGroup == 0) { Printf("Unable to assign sector %d to any group. Possibly self-referencing\n", i); } else if (sectors[i].PortalGroup == -1) sectors[i].PortalGroup = 0; } Which, considering that they produce serious glitches, is important. 0 Share this post Link to post