Closed MountainLabsYT closed 5 months ago
I'm not exactly sure how you would reproduce the bug, but if there's no simple solution, I'll get recreate the bug in a minimalist project and link it. But I hope thats not the case.
Go to '...' Click on '....' Scroll down to '....' See error
Why are you copying the issue template without filling it in? I read the whole thing only to realize it was all the issue template and nothing written by you :(
if there's no simple solution, I'll get recreate the bug in a minimalist project and link it. But I hope thats not the case.
That's actually what I preferably expect by "minimal project" in the issue template. Making a minimal project might help you find out what's happening, and it helps me to not waste my limited time through all the noise of a complete project.
From what you described, you seem to be going through quite a roundabout way to get voxel trees to generate. I'm not sure if that's reliable, but I dont see why your instancer wouldn't spawn things. I'm a bit confused at what I'm looking at in the screenshots. What are those cubes in the air? Are they debug cubes to see your spawners? Are they supposed to be floating? (Are they floating?) What generates in the editor should generate the same in game. Is that their absence you're showing in the second screenshot? Any errors? Anyways, as I said I can't help you more than that without a test project.
I'm sorry I believe I misunderstood why there was a template, I thought I was supposed to fill it in. which is what I did, I left out the parts that I didn't know how to properly fill out, for example I didn't know how to fill out the "steps to recreate" without just recreating the whole project, Afterall to get a specified recreation of a bug, one must at least partially understand said bug.
That's actually what I preferably expect by "minimal project" in the issue template. Making a minimal project might help you find out what's happening, and it helps me to not waste my limited time through all the noise of a complete project.
I was hoping listing a demo project could be a last resort. not the first thing I do, if this was a serious bug I'd be more willing, but I got the feeling it had something to do with my setup, and was hoping you had encountered the bug before, and could therefore tell me what I was doing wrong.
What are those cubes in the air?
A visualisation of the tree spawners.
Are they debug cubes to see your spawners?
Yes.
Are they supposed to be floating?
No. I assume that to be a byproduct of the placing algorithm.
Is that their absence you're showing in the second screenshot?
Yes. I'm sorry if that was unclear, I was rushing.
Any errors?
No, that's my problem, no errors = no obvious problems (at least with my code.)
From what you described, you seem to be going through quite a roundabout way to get voxel trees to generate.
Do you have any recommendations? You know the module best.
Thanks for responding.
Although keeping the original template is probably confusing and I'm sorry about leaving it in there.
I usually use VoxelInstancer for its initial purpose, which is to scatter details on top of voxel meshes so I use multimeshes, rarely scenes and basically never used a script on such scenes (though it should work like any other scene), so I can't say that I've seen that often.
In fact VoxelInstancer was initially made for smooth terrain with LOD, and only got adapted to VoxelTerrain
after being requested.
That makes me think that your cubes are not actually floating, they are generating out of bounds instead. That's because the default LOD index
of library items is 2, which can't work with VoxelTerrain
because it has no LOD. So you get this weird positionning as a result. You should use LOD 0 instead.
But why you don't see anything at all in game, that's maybe a side-effect of LOD index too? In editor, configuration changes trigger a re-scattering of instances, which for some reason spawns stuff at LOD 2 (but probably shouldn't because things are off due to lack of LOD), while in game it's already setup. But because VoxelTerrain has no LOD, it never spawns meshes with LOD 2, so your scenes never spawn.
Okay, You were correct about the floating cubes. setting the LOD to 0 fixed it. But you mentioned that using the instantiater was inefficient. So what would you have me do instead? if I were to use code, how would I make new tree's generate per chunk? I'm not super familiar with the documentation.
To generate trees made of voxels, you would have to do that in a VoxelGeneratorScript
or VoxelGeneratorMultipassCB
. These are invoked to generate voxels. Doing it with VoxelInstancer
kinda works and ignores a bunch of situations you'd have to account for, until you start editing those chunks, and it's overall a bit of a roundabout approach bevause it exploits a system that was never meant to achieve this goal. It's also making your trees generate in the main thread, triggering extra remeshing after the initial meshing. You could have done that listening to mesh signals, though it has the same drawbacks.
So is a VoxelGeneratorScript a way of custom generating the whole world, or a structure? or just any voxels period?
Any voxels. You're given a chunk and you set each of them. It is also multi-threaded. It's all in the docs and there are demos.
Well thanks for the help :) I appreciate it.
I have a Voxel Terrain node with a Voxel Instancer child node, the Voxel Instancer instantiates Node3D's that then spawn tree's using the VoxelTool, The Node3D's (named "TreeGenerator") do not exist in the game. The TreeGenerator's work perfectly fine if I drag and drop them into the scene, but when created by the voxel instancer they do not exist anymore.
I expect to have a TreeGenerator node spawn at a location picked by the VoxelInstancer node
Screenshots As you can see, In editor it shows the spawners. And now, ingame, they aren't there.
Environment