Curve Builder dropping my foundations by half

@rosso135 Hey man, I wondered if you could shed some light on what's happening here. So I'm making a structures mod, and one of the inspirations was being able to make fine curves by adding smaller versions of walls and foundations.... Anyway, I just decided to test whether curve builder works and i'm getting the attached problem. Happens with any blocks that must be designed in half above and half below the plane in the blender. So the walls don't suffer this problem, as walls are designed along the top of the plane in blender. My blocks are snapping and zooping correctly to all the other blocks. Tested by blocks ability to snap with vanilla, Foundations Plus and Structural Solutions... they work correctly in every situation... So I can't fathom why they drop by 50% when used with Curve Builder.
No description
32 Replies
Fish Face
Fish FaceOP2w ago
If the blocks showed signs of problems in other areas, then I might have an idea of what to do... but as far as I can tell, they're working correctly everywhere but with Curve Builder.... So any changes I might think of making to fix the problem in Curve Builder, would just end up breaking my shapes elsewhere
rosso135
rosso1352w ago
This was one of the earliest issues I had making the mod. Never fully understood it but my best guess is it’s to do with the anchor point of each individual object. Different buildables seemed to have different offsets. I ended up applying manual offsets which may be causing it? How are you spawning your structures? The weird thing was when I had that issue before it just looked goofy in the hologram preview but when you actually built the structure it was in the correct position
Fish Face
Fish FaceOP2w ago
oh, i never actually clicked, you're right, it does build them in the right place, it's the hologram that's wrong so, if i shift the anchor points up it might fix it? i'm very new to all this, never made a mod before... so maybe this is a dumb question, but does changing the anchor point cause problems? Structural Solutions and Foundations Plus both snap exactly the same way my shapes snap... but they don't exhibit this problem so they've got something that i dont
rosso135
rosso1352w ago
Is it only happening when you cry use curve builder with your structures? I’ve never actually used extra structure mods
Fish Face
Fish FaceOP2w ago
No description
Fish Face
Fish FaceOP2w ago
yea, I can zoop fine that's Foundations Plus
rosso135
rosso1352w ago
Oh interesting
Fish Face
Fish FaceOP2w ago
No description
Fish Face
Fish FaceOP2w ago
that's my foundations being zooped only happens when curving
rosso135
rosso1352w ago
I don’t know how the other mods do it but if the custom structures inherit from the foundation hologram class my code will auto apply an offset for that foundation Are yours custom classes from scratch or do they inherit?
Fish Face
Fish FaceOP2w ago
oh god no, I can't make hologram classes 😂 They're Holo_Foundation and Holo_Ramp
rosso135
rosso1352w ago
I’m not at my pc just now but when I get a chance I’d be happy to send over the code I used for offset calculations, but as I say im sure there’s a much better way of doing it with unreal, I just didn’t know enough about how the object placement worked Oh interesting in that case I’d have expected it to work The joys of modding huh 😂
Fish Face
Fish FaceOP2w ago
hmmm.... could be that my parent class is "FGBuildable Foundation" rather than "FGBuildable Foundation Lightweight"?
rosso135
rosso1352w ago
I don’t touch lightweight stuff at all in mine
Fish Face
Fish FaceOP2w ago
My blocks have lightweight configured to them so it doesn't matter from that point of view parent or not, they have lightweight data added so, you're just reading the hologram class parent data shouldn't matter I'll keep comparing my blocks with the Gingerbread blocks and see if I can spot any differences Okay, I think I have the solution The problem comes from the location of the Mesh on the plane All of my foundation and ramp meshes are designed in Blender to be at the correct height along the plane (which is half above and half below) to be able to snap and zoop correctly in accordance with the vanilla holograms. But, Curve Builder wants the mesh to be sitting on top of the plane, rather than dipping below it by 50% So, I need to reimport all my meshes with +50% to the Z location so that the mesh file is now sitting directly on top of the plane with nothing sitting below the plane. Then I need to go in to each of my Buildable files, and change the location transform to be -50%. This will put the core mesh file in the right place for Curve Builder, and it will put the actual world placement in the right place for snapping and zooping with other structures. That will be tedious, i've got about 190 shapes to update Main mesh file made in blender must be on top of the plane for Curve Builder Buildable file in UE5, must transform each mesh down 50% to allow correct snapping for the hologram classes.
Fish Face
Fish FaceOP2w ago
For clarification, what the game devs and modders are doing, is designing their shapes to sit on top of the plane like so.
No description
Fish Face
Fish FaceOP2w ago
and then when making buildables from the mesh, they transform the height down by 50%. So this is an 8x8x8 ramp, meaning it's 8m tall. So it should be transformed -400 on Z
No description
Fish Face
Fish FaceOP2w ago
What I did, was I designed my meshes to already by 50% lower, so I didn't need to waste time transforming them in UE5 This explains why you had the problems you had making Curve Builder, and why I had my problems using Curve Builder.
DoctorMonocular
not sure if it helps, but just chiming in to say that one thing I've noticed about this curvebuilder bug is that it only happens with dissimilar parts. Eg. if I'm making a curve with foundations then I want to continue the curve using ramps, I snap the ramp to existing foundation to continue the curve, and I hold CAPS to make the first one also angled, and depending on the part it'll either be offset on Z or maybe rotated incorrectly or both. However, if I set things up to continue the curve snapping from an identical part -- like continuing a ramp from an existing identical ramp--then the bug doesn't show up at all, it just works correctly. This seems like evidence that a naive offset will not be enough to fix the bug because it's not just about the local mesh coordinates of the part, it's some calculation involving both the transform of the part-to-be-curved, and the part it's snapping to. Shooting from the hip, I were to try to debug this I'd start by looking for calculations of transforms that incorrectly use local space vs world space or that use a mesh transform instead of an object transform
Fish Face
Fish FaceOP2w ago
No description
Fish Face
Fish FaceOP2w ago
I did a bit more testing and found that Curve Builder is using the location of the original mesh file to find it's location it doesn't use the co-ordinates in the buildable, it's using the co-rdinates in the orginal mesh alot of the buildables have had thier Z axis offset from the original mesh file So, because curve builder is using the original mesh file to assign co-ordinates, it also needs to apply the same offsets that the are assigned in the buildables the offsets being used by Curve Builder could be removed, if it were to pull from the buildable file and not the mesh file. this would remove the chance of problems for modders who use irregular offsets
DoctorMonocular
yess, nice find also pretty pleased with myself that I called it without looking at the code at all, haha don't mind me, just dickhead things
Fish Face
Fish FaceOP2w ago
Ideally, curve builder would get it's location data from the lightweight instance... And then modders could remove the static mesh configuration from their mods. I don't know how or if any of that is possible... These are just observations from someone who's only been doing this for 2 weeks 😅 I've managed to adjust all my buildables to work with Curve Builder now anyway
DoctorMonocular
I don't know the technical details exactly, but I do know that the mesh will have an independent transform from the object, as you've discovered, and that generally speaking external callers like the curve builder mod should be looking at the object's transform and letting the mesh transform be the object's problem. My guess is that they were looking through the UE api or properties they had available on the objects in the editor and saw the mesh tranform and it basically kinda worked so they called it good without realizing they should have been lookikng at the object's transform instead
Muppet Burrito
It's more like the way foundations are done now has changed. It used to be that grabbing it from the static mesh would've been correct, however as all foundations are now lightweights it should probably grab from the lightweight component now instead. I suspect that this could also be related to why Curve Builder is crashing with SS pieces, because you're meant to remove the static mesh component when changing foundations etc to be lightweights and Curve Builder is trying to call a static mesh component that no longer exists on SS pieces. I found when migrating my foundations to lightweights that I had to keep the static mesh component in order for my foundations to still work with Curve Builder, instead of nulling them out like we're supposed to do
DoctorMonocular
ohh, I never thought that my bug could be related to this bug, but it makes perfect sense I wonder if some version of this mesh BS is the culprit behind the emissive beam dismantle crashes
Muppet Burrito
I don't think so unfortunately, it seems more related to how lightweights interact with lumen on dismantling, which is a different issue entirely. The game has to turn lightweight objects back into non-lightweight objects on dismantling but something about that process isn't working when nanite/lumen is enabled
DoctorMonocular
do you think that's just some old cruft because eg the dismantle shader happens to needd to attach to a "real" object to work, or do you think it fundamentally needs to work that way? Asking because if it's just a legacy code issue they might patch it at some point just for a performance/uobject efficiency gain if they were to make a lightweight object that uses nanite/lumen they would dhave to fix it for all of us too 🙂 I can't think of any current vanilla lumen things that are lightweight, eg signs are not
Fish Face
Fish FaceOP2w ago
While I was doing some research on lightweight objects and static mesh objects.... I found that static meshes are always needed when nanite is being used.... But, the static mesh only needs to contain the components necessary to overlay the nanite effects on to the lightweight object So, the main object is rendered via lightweight, and the static mesh only contains the nanite stuff. You aren't duplicating the lightweight object in the static mesh component
Muppet Burrito
I've got both in my emissive beams (so they still work with Curve Builder) and they still crash the clients on dismantling when playing on Linux dedi (which is when all of the emissive lightweights crash)
DoctorMonocular
I haven't tried yours, but the SS ones crash my girlfriend when she's logged into my game. Weirdly it used to be that she crashed herself when dismantling, but I could dismantle them without issue. I could happily build/dismantle with them while she did something else, and occasionally I'd dismantle one for her, but in the last few days if I dismantle any emissive, even if I'm the one who built it, she crashes. the difference may be that I was building in a different area of the map from her, whereas lately we've been working on the same building, so probably it's about the emissive being in range of her
Muppet Burrito
I had to disable nanite for my entire project to build a version of Lights + with emissive beams that don't crash. Which is a far less than ideal solution

Did you find this page helpful?