Old unions that have been in my game for years also appear to have a TriangleCount of 0.
How often does the bug happen (Everytime/sometimes/rarely)? What are the steps that reproduce the bug? Please list them in very high detail. Provide simple example places that exhibit the bug and provide description of what you believe should be the behavior.
Create a new place
Create a UnionOperation
Save the place file
Close the place
Open the place again
Print the TriangleCount of the union, it will be 0
This bug happens every time.
Where does the bug happen (www, gametest, etc) Is it level-specific? Is it game specific? Please post a link to the place that exhibits the issue.
This is happening in all places on production.
When did the bug start happening? If we can tie it to a specific release that helps us figure out what we broke.
I’m not sure when this started happening. I just found this out while trying to create a plugin that needs to read the TriangleCount of unions.
I noticed it around the 20th (I’m guessing) of Dec. when trying to make a fairly simple Union and looking at the triangle count to find it was 0. Not sure if it was before that or not since I didn’t look for it.
Hopefully this can be addressed soon, I need to be able to read the TriangleCount in order to help keep track of union usage while my game is being built.
It seems to be an issue with both CSGv1 and CSGv2 (I disabled CSGv2, made a new union, quit and reloaded the place, and the TriangleCount was still 0)
It’s like the TriangleCount is only counted if you have seen the unions that make up that union(either by making it in this studio session or deunioning and reunioning). Knowing TriangleCount without any hacks was pretty useful.
@sircfenner made a plugin for reading how many triangles a Mesh takes up. It says it also works for Unions although I haven’t had the time to test it yet I don’t know if it too will just read 0.
I came across this bug as well while working on my incubator project and reported it internally, so it should be brought up to the appropriate parties soon. Don’t know when we’ll see a fix, but TriangleCount is an awesome feature, so hopefully it won’t be too long.
TriangleCount is a horrible feature. It worked using an obnoxious hack, and now some internal changes invalidated this hack and the feature stopped working.
We have two reasonable options:
Deprecate TriangleCount.
Change TriangleCount to a serialized property and teach CSG engine to save it when making a union (this is NOT how it works right now)
In general, I imagine you’d find more developers who would prefer adding features than removing them. It’s less a question of which option is favorable to developers, and more so is there enough reason to continue supporting TriangleCount. What do you need from us to make that decision? More use cases? Numbers on how may developers use TriangleCount?
I’d like to know why it’s important to know the triangle count of a union, given that there’s no information about triangle count of any other part type.
TriangleCount isn’t just useful for unions, but you never saw a feature request for BasePart since we could already hard-code the TriangleCount for primitive part types w/o waiting a month or few for an official feature. There was enough coverage with union-exclusive TriangleCount that developers were mostly satisfied. Some benefits of TriangleCount were exclusive to unions, though only a fraction.
Use case specific to unions:
Unions weren’t always so great with optimizing faces:
I’m not sure how much of an issue this is with CSGv2 and its lower triangle counts, but historically this allowed us to skip union operations entirely without having to wait ~10 seconds to be told the resulting union had too many triangles. Depending on how often developers will encounter the triangle limit with CSGv2, TriangleCount may no longer be needed for this.
All instances in general - level complexity:
If I look at the TriangleCount of instances in my level (actual TriangleCount or hard-coded), I can get a more granular understanding of my game’s memory usage than just knowing the total amount. Knowing my game uses 2 GB of video memory from unions is concerning but not very useful – knowing exactly which unions are responsible allows me to swiftly address the problem without recursively copying/pasting parts of my level into a new file to hunt down the responsible unions.
This is also a problem with meshes, and we have an open feature request (lost Thank Yous in switch to Discourse) in addition to two user workarounds <1>,<2>.
Assuming unions with too many triangles are no longer an issue with CSGv2, I just need some way to determine how complex a union is (or any mesh/BasePart/texture/sound/etc preferably). Having access to the file size of the instance we’re loading into memory would work too – it would be even more convenient actually, but is more specific to this use case than others.
Performance metrics seems like the primary use case though <1>, <2>, <3>, <4>, <5>, <6>, <7>, <8>, <9>, <10> – everything else was really minor – so maybe any potential features only need to address this use case.
A future release of CSGv2 later this year will remove the triangle count limit by automatically simplifying to the target limit, so that won’t be an issue.
The rest of this to me sounds like “we need better tools for understanding which instances take memory/performance” - I don’t think triangle count is a good tool for that (for one, memory impact can theoretically vary ~6x for same triangle count depending on the specific topology, and practically probably ~2x).
Another use case is estimating how important it is to move a union over to a mesh. An example union in our game uses 200 to 600 triangles depending on how it’s built. I can send it to blender and make that number 68.
This issue still seems to occur even with CSG v3. I load up a place in studio, and all the union’s TriangleCount property are at 0. Even when play testing it’s still 0.