etlegacy / etlegacy

ET: Legacy is an open source project based on the code of Wolfenstein: Enemy Territory which was released in 2010 under the terms of the GPLv3 license.
https://www.etlegacy.com
GNU General Public License v3.0
587 stars 93 forks source link

Clip/trigger/slick drawing for debugging purposes #1893

Open Aciz opened 2 years ago

Aciz commented 2 years ago

I've ported over clip/trigger/slick drawing from oDFe to ET:Legacy. The current implementation is working as following:

I've put the code up in a branch over at my fork here: https://github.com/Aciz/etlegacy/tree/clip-trigger-slick-drawing

We've had some discussions about this feature in the past, and while something like this might seem very odd, it is an extremely valuable tool for mappers. It can be used to easily spot areas which are badly clipped for example, or quickly see if you've made some surfaces too steep. However the implementation is not currently something I'd consider "production ready" as it as some issues.

Firstly, this is not aware of PVS. It is drawing every single clip/trigger/slick in the map, even if the surfaces are not currently in your PVS. This is because it's initialized in CL_CM_LoadMap, so it's just using the collision model to "detect" things.

image

Which leads to the second problem...

It's not aware of gamestate. Anything that's being adjusted in runtime displays incorrectly. For example, clipping for constructible objectives is always drawn, regardless of the state of the objective. Again, this is because of the initialization happening in CL_CM_LoadMap, it has no idea what's happening in game code.

image

Third issue is that the current limits for r_maxPolys and r_maxPolyVerts are too low for this, however I believe they should be fine once the PVS issue is fixed.

Once these issues are fixed, we could perhaps consider adding this to the engine. I however don't really know how to even begin fixing these issues, which is why I'm creating a ticket for this, so maybe someone else can take a look and try to fix these issues.

x0rnn commented 2 years ago

Does ETL support func_fakebrush in mapscripts too? Would be nice to see those too. Edit: now possible with https://github.com/etlegacy/etlegacy/pull/2194

And the mins and maxs for TOIs too, but I guess I'm pushing it too far.

ensiform commented 2 years ago

I don't think it can unless they are in the bsp for the purpose of rendering these. As map scripts loads entities etc later.