It has been a while since my last journal. I've mostly just been busy with work and being exhausted and had all my project on hold except for my part in this year's Ragemap (a mapping collab for Sven Co-op).
I brought up the fact that func_illusionary will produce cliphulls came up earlier today when helping Sassy Boy with advice on reducing clipnodes, which came as a surprise to some. Understandable, it's always non-solid so why would func_illusionary need cliphulls for in the first place? I thought a journal might be a tidier format for talking about this.
So the thing is, the CSG compiler that comes with the HL SDK makes no classname checks, it's pretty much entity-agnostic in this regard. So the compiler generates clipnodes on all HULLs for func_illusionary just as it does for any other brush entity. It doesn't become non-solid until it's spawned in-game and the game code gives it
pev->solid = SOLID_NOT
.
Big waste of clipnodes if you ask me.
Surely those who've worked on ZHLT and VHLT would have thought about this too and made sure to skip cliphull generation for func_illusionary. I opened up the source code for VHLT v34 and searched for "func_illusionary" and just as I expected I found a conditional checking for that classname and flagging those entities as "noclip" (which will make them skip cliphull generation). Though then I remembered I had this habit of adding
zhlt_noclip 1
to func_illusionary in my FGDs, and I was pretty sure that even in VHLT the entity will still have cliphulls generated by default.
What better way to check than testing it?
So I set up a basic room. That's 6 faces with a clipnode each, times the 3 clipping HULLs, for a total of 18 clipnodes for the room itself.
A box is created and tied to func_illusionary. 6 faces on that one as well, so we can expect an additional 18 clipnodes if the generation isn't skipped. Run compile, and...
We have 36 clipnodes total, what we expected if func_illusionary's cliphull were generated after all.
Doing another test with
zhlt_noclip 1
on the func_illusionary, and without the entity at all, as controls we get the total of 18 clipnodes we expected to see if it was skipped.
So this confirms that func_illusionary
does produce clipnodes in both the HL SDK CSG and VHLT v34's CSG.
But
why?
Unfortunately I do not have that answer yet, but I'm curious about finding that out and so I started looking into it today.
I tested the conditional in VHLT's CSG where it checks the classname in isolation and it worked, so that can be ruled out.
I'll be sure to update this journal if I find out more, and if anyone reading this happens to know anything about it, please let me know!
Update:
Oxofemple brought to my attention that the
-clipeconomy
must be on to skip generating cliphulls for func_illusionary (and similar entities).
This was strange to me as I was sure it should be on by default, which used to be the case for ZHLT. Solokiller helped me confirm that the flag was changed to be off by default for whatever reason somewhere early in the VHLT branch.
So to sum it up it's not a bug but rather a change in default behaviour from earlier versions.