Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompiling Half-life 2 OG XBOX maps results in incorrect textures on some surfaces. #160

Open
LittlePlanetCD opened this issue Dec 24, 2022 · 1 comment

Comments

@LittlePlanetCD
Copy link

Okay, so, this is a lot to explain.

There's something going on with the decompiler, where decompiling XBOX HL2 maps makes different textures appear on parts of brushes.

Most notably, you can decompile d1_transtation_05 from the XBOX port and you'd notice that the area where breen is has a LOT of the faces in the area covered by metaltruss textures, for no reason.

It's a very strange issue... I don't know why it happens. These textures cause vbsp to report leaks, so is it possible for this to get fixed, somehow?

@rihi
Copy link
Collaborator

rihi commented Mar 29, 2024

I've had a look at the map and it seems like XBOX HL2 does some things different with how texture infos are compressed. Sadly, in this case, I'm not sure if there's a way to identify these faces which should be nodraw. So for now don't expect any fix soon.

For people interested in the details and for future reference:
Normally faces touching the void will get NODRAW and NOLIGHT surface flags applied. Later, vbsp compresses the texture info array by removing unnecessary textures. Those texture are, I believe, the ones marked with NODRAW. It will select the first texture which has NODRAW and replace every other occurrence of another texture which also uses NODRAW with this one. This effectively reduces the size of the texture info array, as less unique texture need to be stored.
This is also the reason, why we do tooltexture fixing, as tooltextures also have NODRAW and get optimized subsequently. However, because surface flags and brushflags remain untouched, we can sort of recover (guess) the original texture.
In the case of XBOX HL2 this however doesn't seem to be the case for void touching surfaces? In d1_trainstation_05, void touching surfaces only had the SOLID brush flag an no surface flag, allowing for no recovery of the texture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants