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

Performing edit on VoxelTerrain that hasn't loaded yet silently fails #661

Open
Piratux opened this issue Jun 13, 2024 · 6 comments
Open

Comments

@Piratux
Copy link
Contributor

Piratux commented Jun 13, 2024

Describe the bug
Performing edit (for example using do_sphere) on VoxelTerrain or VoxelLodTerrain that hasn't loaded yet silently fails as opposed to printing an error in console.

To Reproduce
Steps to reproduce the behavior:

  1. Add do_sphere in _ready() script of parent VoxelTerrain.
  2. See no edit being performed, and no error printed to console.

Expected behavior
Some sort of error in console, saying that edit could not be performed.

Environment

  • OS: Windows 10
  • Graphics card: GTX 650 Ti
  • Godot version: 4.2.2 stable
  • Module version: 1.2.0
  • Renderer: Forward+

MRP
Test silent edit fail on terrain on ready.zip

@MGilleronFJ
Copy link

MGilleronFJ commented Jun 13, 2024

That was intended. Only some VoxelTool implementations used to print errors when partially out of bounds, but then I got reports that didn't want errors to be printed. Now no implementation print anything by default. If you want to be notified of that, something should print if you enable verbose stdout in Godot's debug options (or command line -v).

@NuclearPhoenixx
Copy link

IMHO, if a dev does something unsupported or unexpected with the module like that, there should at least be some warning or a notice or something. Instead of suppressing or outright removing the warning, it would be better to address the issue directly and don't try to edit terrain that is not loaded.

@Piratux
Copy link
Contributor Author

Piratux commented Jun 13, 2024

That was intended. Only some VoxelTool implementations used to print errors when partially out of bounds, but then I got reports that didn't want errors to be printed. Now no implementation print anything by default. If you want to be notified of that, something should print if you enable verbose stdout in Godot's debug options (or command line -v).

If that's intended, then perhaps return value of do_* methods could be used to indicate whether edit was successful?
For example, instead of do_sphere returning void, it could return bool value, where true means edit was successful, and false unsuccessful?

@Zylann
Copy link
Owner

Zylann commented Jun 13, 2024

I could bring back the log as a warning instead of only when verbose output is enabled?

I don't really like the idea of having every single edit method return a result like that... that's a lot of methods to modify, in some cases there is already a return value, it breaks compatibility in some cases, and it's going to be either ignored most of the time (which might in turn trigger warnings along the way for "unused return value"), or you'll have to put an if or assert when calling every function, which in script-land is just annoying/inefficient. And that would not even cover the case where you were expecting to be able to edit, but failed and will still not print anything.

@Piratux
Copy link
Contributor Author

Piratux commented Jun 13, 2024

Ah, you're right, didn't think about warnings of ignoring return value, that could be annoying indeed.

I think warning or error by default should be better choice here as opposed to silent fail.
If one wants to avoid warnings, one can always use VoxelTool.is_area_editable().

@Zylann
Copy link
Owner

Zylann commented Jun 14, 2024

Changed to warnings in 3a9f3d1

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

No branches or pull requests

4 participants