Facepunch / garrysmod-requests

Feature requests for Garry's Mod
86 stars 24 forks source link

Increase `MAX_MAP_PRIMINDICES` in VBSP #2239

Open wrefgtzweve opened 11 months ago

wrefgtzweve commented 11 months ago

Details

Currently the limit is 65536 which is a major headache for a lot of mappers as VBSP will use this limit during t-junction cleanups, you'll get the issue Too many t-junctions to fix up! (2353 prims, max 32768 :: 65754 indices, max 65536) if you use "too many" func_details which in reality sadly isn't that many.

Now i am not sure if it's possible to increase but if its possible it'd be a great improvement for mappers, after seeing that some other mods have been able to up the limit without any issues i feel like it might be worth a try.

image

Example of it being increased: https://github.com/wouterpleizier/source-sdk-2013/blob/fd7af5392809c7b8c47f6a05e937a4ef4c709a3a/mp/src/public/bspfile.h#L148

robotboy655 commented 8 months ago

This would not be possible without modifying the BSP file format.

brandonsturgeon commented 8 months ago

Forgive me if it's a stupid question, but is that a problem?

BSPs already have a version flag, could that be incremented and parsed differently without breaking older maps?

I guess I mean to ask: is this a problem of work required, or compatibility?

robotboy655 commented 8 months ago

Not directly, but that would mean GMod maps are not going to be usable in any other Source game. It would also mean slightly higher memory usage across the board, even for old maps.

Nalo12 commented 8 months ago

But who is using a Gmod map for an other Source game ? (they can take the vmf and compile the map for their game) it would be huge for mappers if we can get this upgrade with the MAX_MAP_VERTS too

https://github.com/wouterpleizier/source-sdk-2013/blob/fd7af5392809c7b8c47f6a05e937a4ef4c709a3a/mp/src/public/bspfile.h#L124

Kefta commented 8 months ago

Even if the map version is bumped for gmod, if people want to use map versions that work in other Source games, they can use a different Hammer to make them, or additionally, add a feature to GMod's hammer to target earlier BSP versions with their own restrictions entailed.

inkoalawetrust commented 5 months ago

Not directly, but that would mean GMod maps are not going to be usable in any other Source game. It would also mean slightly higher memory usage across the board, even for old maps.

I don't really see how that is a problem. As others have said, it's already not a total dealbreaker that GMod won't "automatically" work on other branches, since you can for example just recompile the VMF project files and make any necessary changes. And besides, I'm pretty sure GMod has already added at least a few features that would prevent a map from just working outside of GMod itself.

As for the memory usage, how big do you guess it would be? Because IMO if it's less than like 40MB. I think the benefits of a new BSP version like the one Strata uses would far outweigh the downsides, allowing for way more detailed maps in general. Or for that matter, to increase the maximum map size limit from ~600 meters up to around 2500 meters. You also already increased a bunch of these limits around last year.