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

Getting Data on Modified Voxels #591

Open
JohnDoneth opened this issue Jan 12, 2024 · 1 comment
Open

Getting Data on Modified Voxels #591

JohnDoneth opened this issue Jan 12, 2024 · 1 comment

Comments

@JohnDoneth
Copy link

I'm working on a project where I'm attempting to have mine-able terrain that can be gathered based on the texture ID using the smooth voxel terrain however I'm not certain how to figure out what and what amount of voxels have been gathered.

It would be nice if the do_sphere or other modification functions could return a diff of some sort of the voxel buffer before and after being modified so I can see what materials (just voxels with a specific texture in my case) have been removed or changed. That way once my player has gathered a certain amount of material they can receive an item.

I have considered taking a snapshot of the area before and after using voxel buffers and creating the diff myself but since it would have to be iterated in GDScript I figured that might not be ideal and could warrant some discussion here where it could be implemented more efficiently in C++ where the diff information could be gathered while performing the voxel modification. Maybe I'm missing another way it could be done already as well.

@Zylann
Copy link
Owner

Zylann commented Jan 12, 2024

I thought of that a few times and I plan to add something to do this, I just didn't come to do it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants