bspsrc
bspsrc copied to clipboard
MAX_MAP_BRUSHSIDES, MAX_MAP_PLANES and other brush face count problems when decompiling Black Mesa maps
I've been doing a project involving modification of Black Mesa's maps and this error has been plaguing my progress. Deleting func_brush's and func_detail's did the trick but that'd render the map unrecognizable. There's nearly no difference between brushes from decompiled maps and officially released vmf's so I am completely lost on how to resolve this issue.
I have same problem in some CS:GO maps. I add literally nothing to map. I get MAX_MAP_PLANES error. When I delete some brushes or use nodraw to optimize map it compiles without errors.
I had this problem with high detailed maps as well. I don't quite know what causes it but my guess would be it's because of floating point math/rounding errors.
For MAX_MAP_BRUSHSIDES the wiki states:
Hammer/Compiled brushsides discrepancy
The term "brush sides" is a bit misleading, if you've paid attention to your brush sides in hammer before, you may have noticed the compiled result was higher.
This is because when compiling, it includes the bounding box of a brush, which can be up to an additional 6 brushsides per brush. If a face is lined up with the edge of the bounding box(meaning not angled in any way) it will not add an additional brushside.
In other words, a cube for example only has 6 brush sides. However, if the cube has only the slightest rotation around one axis, suddenly 4 faces don't align with the bounding box anymore. Consequently, this means that now an additional of 4 brushsides are counted towards the MAX_MAP_BRUSHSIDES limit.
When bspsrc decompiles the map, floating point math could cause brushsides to be slightly angled compared to how they were in the original vmf.
Some time ago I already though about ways of fixing this but only came up with vague concepts and never actually implemented anything. So I guess you're sadly out of luck with this problem, as there is currently no fix for it.
This can possibly be fixed by rounding brush coordinates to the nearest integer if the distance is less than some small number like 0.01.
I'd like to bump it up again. Since some of the highly detail maps (like Danger Zone maps and some Vindictus maps) can not be compiled with the decompiled vmfs. Will be very appreciated if @rihi can take time to take a look in it and fix it on 1.4.5