Bad clipping after LevelCompatibility.SetVertex

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
gramps
Posts: 300
Joined: Thu Oct 18, 2018 2:16 pm

Bad clipping after LevelCompatibility.SetVertex

Post by gramps »

Here's a quick test that rotates doom2 map01's vertices 180 degrees around 0,0.

Code: Select all

version "3.8"

class SetVertexTest : LevelCompatibility
{
	protected void Apply(Name checksum)
	{
		// The map's checksum. 
		'3C9902E376CCA1E9C3BE8763BDC21DF5'; // DOOM2.WAD map01
		
		console.printf("Initializing...");
		
		// rotate entire map 180 deg. around 0,0
		for (int i = 0; i < level.vertexes.size(); i++) {
			let p = level.vertexes[i].p;
			setVertex(i, -p.x, -p.y);
		}
		
	}
}
Things aren't moved, but you'll still spawn on the map. The map will look fine, but wall clipping is screwed up, like it's trying to clip against the old map geometry.

Does something get pre-computed before LevelCompatibility runs and not updated afterward?

(This is tested in a recent DRD build that works for me, gzdoom-x64-g3.8pre-62-g23146f1af.7z... nightlies from the past day or two don't seem to be working right now).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Bad clipping after LevelCompatibility.SetVertex

Post by Graf Zahl »

The compatibility handler was never made to alter a level in this way. It has to recalculate the line delta if vertexes get moved around.
gramps
Posts: 300
Joined: Thu Oct 18, 2018 2:16 pm

Re: Bad clipping after LevelCompatibility.SetVertex

Post by gramps »

Awesome, thank you for fixing this! I thought it might be those deltas.

I know LevelCompatibility was never meant for this, but hooking into level init is really super useful for doing some mapping stuff programmatically, like setting up static portals -- just rotating some vertices and using static portals avoids a huge pile of other hacks needed to get much use out of regular portals.
Post Reply

Return to “Closed Bugs [GZDoom]”