Lower unpegged lower wall textures displayed wrong (may be Image Heavy))

Status
Not open for further replies.

glaber

Emblem Radar Ready
Recently I had thought that this was a zone builder bug as when I went in to my stage Emerald Flower, certain lower wall textures with lower unpegged on them showed up wrong in game.
This is how the linedefs showed up in zone builder's visual mode
20160530163639_1.jpg

and this is in SRB2 2.1.15 Software mode
20160530163731_1.jpg


It wasn't until early today when I went into one of my level packs I noticed something was off with the texture alignment in Green flower from Demo2/ Beta Quest. It too had the same vertical Horizontal alignment error.

Here's how it showed up in zone builder visual mode:
20160608020300_1.png


How it showes up in 2.1.14 software mode:
20160608020448_1.png


And 2.1.15 Software mode:
20160608020320_1.png


When discussed in the zone builder topic, it was said that Zone builder and 2.1.14 were displaying it wrong.
But if this is true, Then Even Doom 2 should show the texture the same way right?

GZDOOM Opengl
Screenshot_Doom_20160608_105105.png


Zdoom Software
Screenshot_Doom_20160608_183547.png


Zdoom Opengl
DOOM0155.png


Doom Legacy Software
doomlegacy.png



Apparently not.
 
Last edited:
The problem is the slopes-friendly version of the texture pegging handler assumed the common belief that "Lower Unpegged" means that the texture starts rendering from the lower (front) floor height. This is listed everywhere; our wiki, the Doom wikia, you name it. However, that's not how the original texture pegging worked.

Doomwiki.org has the actual original behavior documented; it positions the lower texture based on the front ceiling height, so that a texture with both Upper and Lower Unpegged renders identically to a one-sided linedef's main texture if you put the two next to each other in the same sector. (I only looked this up very recently, but it explains a lot of texture alignment headaches I used to have because the behavior everyone else explained was fucking wrong)

Fixing the newer pegging code to have a consistent behavior is obviously the way to go if we like the original behavior, but... I'm iffy on it. The new behavior makes more sense for skewed slope textures based on the old community expectation of how pegging works, so um... maybe it can be used only when texture skewing is on? I dunno.
 
The new behaviour makes more sense in general, several internal maps have been aligned to that standard, and Nev3r went "fucking finally" when he found out it'd been changed, so this should probably not be reverted for nonslopes. It's inconsistent behaviour with earlier versions of the game but it's better over-all.
 
Would it be possible to change it so it's displayed correctly in Zone Builder?
 
The new behaviour makes more sense in general, several internal maps have been aligned to that standard, and Nev3r went "fucking finally" when he found out it'd been changed, so this should probably not be reverted for nonslopes. It's inconsistent behaviour with earlier versions of the game but it's better over-all.
How does it make sense this new way? As I've seen through out all the SRB2 Official and addon level, Lower unpegged is most commonly used to attach mid textures to the highest floor that the linedef touches. The results for non-sloped linedefs should not be what 2.1.15 is doing.

Edit: I just found out about peg mid texture. Was this where the old behavior went?
 
Last edited:
It makes more sense because it's symmetrical to the upper unpegged flag this way, and matches the bottom of the sector. It's possible we could change it back for 2.1.16 for backwards compatibility reasons, but 2.2, not likely at all.

The peg midtexture flag only changes the midtexture, not the lower texture. It is unlikely to be a direct replacement but is likely useful in similar circumstances.
 
Well ok, but I'm still finding that the old behavior is the better one when it come to vertical alignment for the lower texture. Especially since it can't be adjusted separately from the mid texture (hence the problem)
 
Eh, I'm more of the mind that it should accurately reflect what it does in every other implementation of the Doom engine. Changing the flag to mean something entirely different while keeping the same name would be rather annoying for anyone who routinely edits for both games.

I will ask this - if you lower the back sector, does the lower-unpegged texture stay in place?
 
I will ask this - if you lower the back sector, does the lower-unpegged texture stay in place?

Should do, whether you meant back floor or back ceiling. Lower unpegged lower textures are drawn relative to the front floor as of 2.1.15 at least, only moving that matters as far as I know.
 
Lower unpegged also snaps the mid texture to the highest floor for both the front and back sectors. Outdoor style maps usually use it this way to snap GFZGRASS. It's the easiest way to get the mid texture down from the ceiling and on to the floor and keep the lower wall aligned. Or was.
 
It's the easiest way to get the mid texture down from the ceiling and on to the floor and keep the lower wall aligned. Or was.
No. Under the old system, Lower Unpegged changes the lower texture's alignment from the back floor to the front ceiling. The reason both alignments look the same in the examples you provided is because the height difference between the back floor and the front ceiling just so happens to evenly divide the texture's height. But that's not necessarily always the case, and if it isn't, the texture will become misaligned.

The actual easiest way to get the middle texture down to the floor while keeping the lower texture in place is to check the Peg Midtexture flag.
 
Hate to tell you this, all my examples use lower unpegged. I didn't exactly mean keep it aligned with the normal walls beside it. I mean aligned with the other linedefs beside it that also use lower unpegged. Though to be honest, I've never used it with uneven ceilings before today.

I suppose I should have said earlier that lower unpegged was the easiest under 2.1.14 and under, Doom, Hexen, and Heretic. peg mid texture never existed for them.

As you can see in the second picture (First post), all the lines using lower unpegged have a messed up alignment, but in the first picture, From zone builder, they're aligned just fine. What apparently isn't pictured is that the ceiling is even across the whole room. Even the Green flower pictures have a even sky/ceiling.

Why don't I show you another example of how 2.1.15 has messed things up with lower unpegged following this?

I created a small example map to show how lower unpegged worked in game in 2.1.14 and 15.

All are in software mode. all have the linedef's front facing outwards.
2.1.14 Lower unpegged
srb20074.png

Showing with ceiling and floor uneven, ceiling even with floor uneven, and Ceiling uneven with floor even.
2.1.15 Lower Unpegged
srb20021_1.png


As you can see with 2.1.14 Lower unpegged is able to work as expected with an even celing, but with 2.1.15 it's the opposite where it only seems to work almost as expected with an even floor, and that's exactly where the problem comes in.

When designing levels for SRB2 we are more likely to have uneven floors next to lower unpegged linedefs than uneven ceilings as shown not just by my example level, but by Green Flower and my pictures from Emerald flower too.

In these new levels that take the new behavior into account, how even are the ceilings next to the lower unpegged line? How even are the floors?
 
Last edited:
I'm not 100% sure I understand what the issue is that you're trying to point out, but it seems your objection is that if you have lower textures with the Lower Unpegged flag and the floor below those textures is uneven, the textures will be misaligned because they're pegged to that floor. Whereas in 2.1.14, they would be pegged to the ceiling, so at long as the ceiling is even, they would be aligned correctly.

What I don't understand is why you would want to give the linedefs Lower Unpegged in the first place if you don't want them to be pegged to the lower floor. That's what the flag is there for.
 
I also have this 'problem' not on custom maps but i do see this in vanilla maps.

This maybe a long shot but what if it has to do with the users systems?
 
...what on earth are you on about MK.exe? The new visual effect for Lower unpegged applies for everyone using 2.1.15 (except those using OpenGL, it wasn't updated for that lol).
 
I've been looking at the documentation on pegging from both the SRB2 and Doom World wikis. As a result, I'm becoming more and more entrenched in my position and convinced that I'm right about this new behavior being wrong.

Let me explain with references.

First off is how we're introduced to using lower unpegged in the first place.
srb2 wiki said:
The way to manipulate middle textures is as simple as checking or unchecking "Lower Unpegged". This is a very useful tool in making maps.
http://wiki.srb2.org/wiki/Lower_Unpegged

At the time this was written, Peg Midtexture did not exist. It didn't need too. But what this did was it told us that this was the easiest way to attach textures like GFZGRASS and the fences from Castle Eggman to the ground.

Next is what the doom wiki is telling us about pegging:
DOOM Wiki said:
Alignment of wall textures is a fairly complex subject. The way textures are aligned depends on the type of line (single or two sided line), the linedef flags controlling pegging, and the sidedef offsets.

  • If a linedef is one sided (a solid wall), the texture is "pegged" to the top of the wall. That is to say, the top of the texture is at the ceiling. The texture continues downward to the floor.
    • If the "lower unpegged" flag is set on the linedef, the texture is instead "pegged" to the bottom of the wall. That is, the bottom of the texture is located at the floor. The texture is drawn upwards from here. This is commonly used in the jambs in doors; because Doom's engine treats each door as a "rising ceiling", a doorjamb pegged to the top of the wall would "rise up" with the door.
    • The alignment of the texture can be adjusted using the sidedef X and Y alignment controls. This is applied after the logic controlling pegging.

What is failed to be mentioned here is that solid walls, or single sided linedefs, use only the midtexture and neither the upper or lower textures.
But due to SRB2's Max speed, we normally can't uses these linedefs as sonic can just thok right through them into the void of endless mass.

This means we have to use double sided linedefs, or thok barriers. Let's see what the doom wiki has to say about these.
DOOM wiki said:

  • If a linedef is two sided, acting as a "bridge" between two sectors - such as a window or a step - the upper texture is pegged to the lowest ceiling, and the lower texture is pegged to the highest floor. That is, the bottom of the upper texture will be at the lowest ceiling and drawn upwards, and the top of the lower texture will be at the highest floor and drawn downwards. This is appropriate for textures that "belong" to the surface behind them, such as lifts or platforms.

This is the normal double sided linedef. so I won't bother explaining it.

DOOM wiki said:
    • If the "upper unpegged" flag is set on the linedef, the upper texture will begin at the higher ceiling and be drawn downwards.
    • If the "lower unpegged" flag is set on the linedef, the lower texture will be drawn as if it began at the higher ceiling and continued downwards. So if the higher ceiling is at 96 and the higher floor is at 64, a lower unpegged texture will start 32 pixels from its top edge and draw downwards from the higher floor.
    • Both forms of unpegging cause textures to be drawn the same way as if they were on a one-sided wall — relative to the ceiling — but with the middle section "cut out". Unpegging is thus appropriate for textures that "belong" to the surface in front of them, such as windows or recessed switches.
    • The alignment of textures can be adjusted with the sidedef X and Y alignment control. This is applied after the logic controlling pegging and affects all textures.
    • If a middle texture is set, it is clipped by the highest floor and the lowest ceiling and follows the same alignment logic as for a single sided linedef, but does not repeat vertically.
http://doomwiki.org/wiki/Texture_alignment

Here's what the SRB2 wiki says
srb2 wiki said:
Most linedefs are two-sided, which means they constitute a border between two sectors. Which textures are rendered and how they are rendered depends on the height differences between the ceilings and floors of the two sectors:

The upper texture is drawn as a solid wall between the two ceilings. By default, it attaches to the lower ceiling and is drawn from the bottom up. If the Upper Unpegged flag is checked, it attaches to the higher ceiling instead and is drawn from the top down.
This is confirmed to be the same still

srb2 wiki said:
The lower texture is drawn as a solid wall between the two floors. By default, it attaches to the higher floor and is drawn from the top down. If the Lower Unpegged flag is checked, it attaches to the lower floor instead and is drawn from the bottom up.

Now this, this where SRB2 is making an error. Earlier this year, the Doom Community finally corrected the wrong info on their wiki to what is now quoted from them above. All source ports and Vanilla Doom Based games have all been using lower unpegged the way it is now documented before it was ever corrected.

Now according to a change log on the DOOM wiki, this description of lower unpegging that SRB2 is now following, was completely wrong.
http://doomwiki.org/w/index.php?title=Texture_alignment&diff=110918&oldid=95552

I don't know why SRB2 would go with a wrong description, but as I've been experiencing, peg midtexture is not really a good replacement.

There is one last line from the Doom wiki's page that I think needs to be quoted:
DOOM wiki said:
Level designers must ensure that textures tile in a consistent and aesthetically pleasing manner, such that the player is unaware that walls, floors and so forth are actually made of repeating textures rather than a single, continuous texture.
The new behavior of Lower Unpegged makes tring to do this that much harder.
 
Have you used it yet? Picture 2 post 1 is the in game result of the new behavior in software mode. complete with uneven floors and a slope all affecting the lower texture's alignment all because their lower floors start at different heights.
 
Last edited:
Have you used it yet?
No, but if "the new behaviour" of Lower Unpegged is sticking the texture to the lower floor, that's a good thing. Now, instead of having to see "alright, how far up to the ceiling, what's the height of this wall, got it, now which do I minus with which", now people just have to see "alright, got it". If you want to align something, just, I don't know, move the texture vertically by however much the floor has changed? Or just don't use Lower Unpegged?
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top