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

Tileset tiles outside texture cannot be removed #85661

Open
Lunarexxy opened this issue Dec 2, 2023 · 3 comments
Open

Tileset tiles outside texture cannot be removed #85661

Lunarexxy opened this issue Dec 2, 2023 · 3 comments

Comments

@Lunarexxy
Copy link

Lunarexxy commented Dec 2, 2023

Godot version

4.2.stable

System information

Godot v4.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 (NVIDIA; 31.0.15.3667) - 11th Gen Intel(R) Core(TM) i7-11700KF @ 3.60GHz (16 Threads)

Issue description

It's possible for a tileset to end up with tiles outside of the texture when the Separation and Margin values are changed. This is fine temporarily, the user might want to tweak the settings until everything lines up.

But, if those tiles are stuck outside of the texture when the user is done, there is no quick way to remove them. The drop-down button for removing tiles outside the texture is always greyed out. The button above it does not affect invalid tiles. Tiles outside the texture cannot be selected or erased.

image

The only quick ways to remove the invalid tiles, are to:

  • Remove the spritesheet from the tileset and try again, setting the proper values before creating any tiles.
  • Reload the project and reopen the tileset. Errors are printed to Output about invalid tiles. The option to remove invalid tiles is now enabled, even though the invalid tiles do not show up visually. Click it, save, and the issue is resolved.

Possibly an issue with #77986 not detecting these invalid tiles, and enabling the drop-down button when atlas settings are changed.

Steps to reproduce

Assuming you're using the provided spritesheet: (spritesheet.zip)

  • Create a spritesheet with separated tile sprites, or with margins around the edges
  • Create a tileset, and pull the spritesheet into it
  • Agree to the automatic tile creation (this can happen with manually created tiles too, this is just for speed)
  • Set Margin and Separation X/Y values to 32

You will end up with invalid tiles outside the texture that cannot be removed, until the project is reloaded

Minimal reproduction project

A project reload detects the invalid tiles and hides (but does not actually remove) them, so a full project MRP is not really useful for clear, accurate reproduction.

You can use the spritesheet below for testing, though. The tiles are 64x64, with a 32px margin and 32px separation.

spritesheet.zip

@KoBeWi
Copy link
Member

KoBeWi commented Dec 2, 2023

That button is active when there are tiles outside the texture (you should also be getting errors in the output). Seems like in this case these tiles are not detected as such.

@Lunarexxy
Copy link
Author

Lunarexxy commented Dec 2, 2023

Yup. The issue is that the button remains greyed out until a project reload. The Output errors will also only appear after a project reload has happened, when the tileset gets fully reloaded.

Presumably the fix is to just run the check for invalid tiles whenever margin/separation values are changed in the tileset atlas settings. I don't know if there are other settings that risk moving tiles to invalid positions, but if so, those should run the check too.

@Drachenbauer
Copy link

In my case it started working after test-run the project.

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

4 participants