Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

voxel blocky library - going over hard limit causes infinite loop #644

Open
QueenTurtle opened this issue Jun 5, 2024 · 3 comments
Open
Labels
Reproduction needed Cannot be fixed until a minimal test project or precise steps that reproduce the issue are provided

Comments

@QueenTurtle
Copy link

Describe the bug
Despite being able to set the bit depth to 32bit or higher through the voxelviewer; the library in the mesher seems to have a hard limit and the game will lock up if you try to place any more models in it.

To Reproduce
Create a voxel blocky library
Create a for loop with 70000 iterations
Use libary.add on a new voxel blocky model

It gets stuck here possibly due to the constants in voxelblockylibarybase which only seems to support 16 bit

Expected behavior
We really would like to use more 65k voxels as we are working on something quite specialised and it is likely that we will need close to a million in any case it probably shouldn't get stuck

Environment

  • Os: Pop_os! (Linux)
  • Graphics card Nvidia geforce rtx 2070
  • Godot version [e.g. 4.2.2]
  • Module version (or commit hash if you got it from Github directly) 1.3.0
  • Renderer used compatibility
@Zylann
Copy link
Owner

Zylann commented Jun 5, 2024

set the bit depth to 32bit or higher through the voxelviewer

I'm not aware of ways to use VoxelViewer to do that 🤔 viewers just tell where to load things, nothing to do with blocky mesher. I guess you did that in a custom generator?

the library in the mesher seems to have a hard limit

It does, it's documented here: https://voxel-tools.readthedocs.io/en/latest/api/VoxelBlockyLibraryBase/#constants

It gets stuck here

Stuck how?
Looks like the code is lacking checks to prevent you from going over the limit, it's quite an old area. But no idea what gets stuck there. Probably some checks need to be added to prevent lockups.

We really would like to use more 65k voxels

This is quite an insane amount already. It sounds like you're trying to do something or workaround something, that is simply not the right approach here. And even then, the mesher won't work on 32-bit, it only has cases for 8 and 16.

we will need close to a million

This is way too much. You're not using the right tool here. This is going to use gigabytes of JUST models data... I'm not really willing to add that to the module at the moment, but maybe you could do some changes on your side. Though still, it really sounds like you aren't using the right system.

@QueenTurtle
Copy link
Author

Sorry I mistyped...I meant the voxelbuffer instead of the voxelviewer. It has the depth enum which seems to imply you can set it all the way up to 64bit

When I say it gets stuck I mean the for loop never finishes.

@Zylann
Copy link
Owner

Zylann commented Jun 5, 2024

It has the depth enum which seems to imply you can set it all the way up to 64bit

Yes you can set it to higher depths, but that doesn't mean the rest of the module is tuned to use every possible depth everywhere. Meshers generally don't use 64 bits at all, and some dont use 32 either because it's beyond common/reasonable use cases. It also depends on the channel. I'm actually wondering if I should even keep 64, as I never had any use for it.

When I say it gets stuck I mean the for loop never finishes.

I just tested this:

extends Node

func _ready():
	var library := VoxelBlockyLibrary.new()
	for i in 70000:
		var model := VoxelBlockyModelEmpty.new()
		library.add_model(model)
	print("Loop finished")

It prints Loop finished. Not getting stuck.

@Zylann Zylann added Needs more info Couldn't repro / more info needed Reproduction needed Cannot be fixed until a minimal test project or precise steps that reproduce the issue are provided and removed Needs more info Couldn't repro / more info needed labels Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reproduction needed Cannot be fixed until a minimal test project or precise steps that reproduce the issue are provided
Projects
None yet
Development

No branches or pull requests

2 participants