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

Tiles are seemingly randomly resetted in the editor #73674

Closed
MarcusRiemer opened this issue Feb 21, 2023 · 34 comments
Closed

Tiles are seemingly randomly resetted in the editor #73674

MarcusRiemer opened this issue Feb 21, 2023 · 34 comments

Comments

@MarcusRiemer
Copy link

MarcusRiemer commented Feb 21, 2023

Godot version

Initially, 4.0.rc2, last seen on 4.0.rc6

System information

  1. Linux, Integrated Intel Graphics, Vulkan Backend
  2. Linux, Nvidia Graphics with proprietary drivers, Vulkan Backend

Issue description

"Something" in Godot 4 RC2 keeps removing properties I have set on tilesets not only during editing runtime, but also on disk. I didn't perceive this behavior earlier and I started working with Godot 4 around Beta 14.

Steps to reproduce

  1. Create a tileset with a terrain set that has two terrains.
    image

  2. Paint some of the tiles properly.
    image
    image

  3. Do some work in the editor / restart the editor. Neither triggers the problem with 100% certainty, but "often". I usually recognize this problem once the "Terrain" Tile Map painting tool shows nothing but the "Connect Mode" and "Path Mode" options for a certain terrain.

  4. So suddenly all bits except for the center bit are lost. This also applies to e.g. physics layer properties, they are just gone. If I saved in the meantime, checking the changes in git reveals that these properties have indeed been deleted from the files.
    image
    image

Minimal reproduction project

godot-v4-tile-painting-repro.zip

@groud
Copy link
Member

groud commented Feb 22, 2023

Could you check if this is still happening on RC3? We believe it might have been fixed.

@MarcusRiemer
Copy link
Author

There is still something odd going on here, after updating to RC3 it suddenly added physics properties that I'm quite certain to never have touched while editing my tileset:

image

I also again lost some terrain bitsets, but I can't say with 100% certainty that this happened with the RC3. Will keep you posted either way, I sadly still haven't found a proper way to reproduce this. At this point I can't even say for sure that it is related to me actually using the tile editor.

@MarcusRiemer
Copy link
Author

MarcusRiemer commented Feb 25, 2023

I'm now on RC 5 and I can't quite tell whether this is related, but suddenly the first load of a tile set seems to fail all the time:

image

If I load a second tileset and then switch back everything seems to be in order again. The errors in the output seem unrelated, although I don't have any plugins currently activated 🤔

Godot Engine v4.0.rc5.mono.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
  modules/gltf/register_types.cpp:70 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started ---
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.
  editor/editor_node.cpp:8152 - Condition "plugins_list.has(p_plugin)" is true.

@MarcusRiemer
Copy link
Author

The previous comment was edited, it contained a stupid mistake on my side 😳 The described behaviour of mismatched terrains was a case of PICNIC.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 26, 2023

@MarcusRiemer Do you have up-to-date reproduction project?
I tried the one you provided and can't reproduce any of the issues you described here.

I only found a very minor bug where TileMap tab does not appear if it's selected right after opening scene (due to being scene root in this case), caused by #72420

@groud groud moved this to To investigate in Tiles, Tiles, Tiles Feb 27, 2023
@YuriSizov YuriSizov modified the milestones: 4.0, 4.1 Feb 27, 2023
@MarcusRiemer
Copy link
Author

I sadly didn't manage to replicate it in the sample project either, but the bug occurred again yesterday evening in my "production" project. But this time I saw when it happened: I had moved the window focus away from Godot 4.0.rc6.mono (yes, I started experimenting with C# in the meantime) and the moment I re-entered the mouse and Godot regained focus all tiles were reset to the "middle only" state. The attached screenshot had correct terrain assignments just seconds before:

image

Thankfully I had saved before, so I could revert to a previous state by closing Godot and re-starting it. I didn't find a way to force reloading a resource other than a scene, so restarting Godot was the only thing that came to my mind.

@MarcusRiemer MarcusRiemer changed the title Godot 4 RC2 Tiles are seemingly randomly resetted Godot 4 RC6 Tiles are seemingly randomly resetted Feb 28, 2023
@SqueakyThePig
Copy link

(Apologies if this is not formatted correctly, this is my first post.)

I can confirm I am having this issue as well. It happens fairly consistently for me, but I can't seem to figure out the exact trigger. It happens consistently enough that I cannot make progress on my project as my tileset changes are deleted within minutes.

All of the painted data I save for the Tileset is removed, including collision masks and terrain details. Normal tile information, including tile animation, seems to save correctly.

image
image

I've attached a two screenshots of an example terrain painting being reset. In this particular instance, I clicked on a different window on my other monitor, and when I clicked back into Godot the error occurred, resetting the tiles as in screenshot two.

image

The tileset editor also slows down slightly, which I assume has to do with the mass amount of errors that begin generating in the output. I took a screenshot (screenshot three) of the error messages, which took several minutes to load since Godot generated more than 200k of them in seconds.

Extra details:

  • This is the latest stable release of Godot 4.0
  • Windows 10 System
  • One of my tiles is animated, the rest are static.
  • Problem seems to occur more when rapidly switching between editing the tileset and editing the tile map, or possibly when switching between windows / when Godot loses focus. However I cannot confirm a one-to-one trigger.
  • When the issue occurs, I can also no longer paint anything on the tiles, nor can I paint tiles onto the tilemap.
  • Eventually Godot crashes due to the flood of errors.

@Zireael07
Copy link
Contributor

Can you attach your project?

@SqueakyThePig
Copy link

Tilset Issue Project.zip
Absolutely! The tilemap I'm editing is in Farm.tscn/TileMaps/Back, and the tileset is called BackSpring.tscn.

@KoBeWi
Copy link
Member

KoBeWi commented Mar 5, 2023

Thanks, I was able to reproduce the issue.
It happens when a TileData points to a TileSet that does not exist, but I don't know what causes this.

@Loufe
Copy link

Loufe commented Mar 7, 2023

Hi everyone, I cannot provide any test data as I'm unsure what exactly is causing it, but I'm wondering if my project is suffering from this issue as well. For whatever reason, the Physics Layer 0 property is occasionally completed wiped from a tileset. ALL other properties are conserved, for what that's worth. Here's an example, where the Z index values were preserved but not the physics layer 0:
image

image

I saw a spam of red lines. Unfortunately I didn't have logging enabled and I took no screenshots, so I can't confirm if we're suffering the same problem as PrinceOfCanada

@sgt
Copy link

sgt commented Apr 2, 2023

I encounter this too (4.0.1). Haven't noticed what triggers this, but at some seemingly random moments my tileset (saved as a .tres resource) loses both the collision markup in the physics layer and the terrain markup as well. If I find out more, I'll report.

@sgt
Copy link

sgt commented Apr 2, 2023

I tried to localise the bug and found out it's happening when the Dialogue Manager (v2.14.0) plugin is present (this might also be the case with @SqueakyThePig 's project that uses it as well). My knowledge of Godot is limited and I couldn't find what causes this, but since this sometimes crashes the whole editor, maybe it's not just a problem with the plugin? Here is a sample project to reproduce this (Windows 10, Godot 4.0.1.stable):

tileset_troubles.zip

  1. Click on TileMap node and open the TileSet Paint interface, selecting Terrain paint property, notice the painted terrain on top of the tilemap.
  2. In Inspector, add new terrain for the existing terrain set, press ctrl-S to save.
  3. Press Alt-Tab to switch focus to another app, then again to switch back.
  4. Notice the terrain markup is lost (or sometimes Godot just crashes).

The error messages:

--- Debug adapter server started ---
--- GDScript language server started ---
Add Autoload
  editor/editor_node.cpp:8238 - Condition "plugins_list.has(p_plugin)" is true.
Add element to property array with prefix terrain_set_0/terrain_.
  drivers/gles3/storage/mesh_storage.cpp:487 - Condition "!mesh" is true. Returning: 0
[^^^ tons of those ^^^]
Attempt to disconnect a nonexistent connection from '<Object#0>'. Signal: 'property_list_changed', callable: 'Object::notify_property_list_changed'.
  scene/resources/tile_set.cpp:5408 - Condition "!tile_set" is true. Returning: false
  scene/resources/tile_set.cpp:5403 - Condition "!is_valid_terrain_peering_bit(p_peering_bit)" is true. Returning: -1
[^^^ tons of those ^^^]

@Loufe
Copy link

Loufe commented Apr 2, 2023

@sgt I can confirm that we're also using Dialogue Manager, you're on to something.

Anything I could help with?

@KoBeWi
Copy link
Member

KoBeWi commented Apr 2, 2023

The MRP from #73674 (comment) where I confirmed the issue also has this addon 🤔

EDIT:
Disabling the plugin fixes the issue.

@nathanhoad
Copy link
Contributor

The Dialogue Manager doesn't have any actual references to Tileset stuff so I'm not sure how it would be related yet. I'll have a look at that example project when I get a chance and see if I can work out what's up.

@KoBeWi
Copy link
Member

KoBeWi commented Apr 2, 2023

It doesn't need to be related to TileSet. It might be e.g. wrong use of _handles() method or some UndoRedo shenanigans (AFAIK TileSet editor uses it in some unique way). I checked the plugin.gd and didn't find anything suspicious.

@sgt
Copy link

sgt commented Apr 2, 2023

I have localised the problem further. The TileSet reset is triggered when the plugin calls get_editor_interface().get_resource_filesystem().scan() on focus change (and then proceeds to update its own json configs -- I tried to disable the handler code, the problem is still there). My (uneducated) guess is that the TileSet somehow doesn't survive the scan() call for reasons unaffiliated with the plugin.

The call in question is at main_view.gd:262

@nathanhoad
Copy link
Contributor

@sgt I think you're right about there being an issue with calling scan(). Replacing it with a call to reimport_files(open_buffers.keys()) seems to work and doesn't seem to crash in that test project any more (for me anyway). I have a bit more testing/optimisation to do but if that works then I'll make the change to Dialogue Manager and do a version bump.

@Loufe
Copy link

Loufe commented Apr 3, 2023

Thank you both very much for your hard work on this, @nathanhoad @sgt , it's very much appreciated!

Nathan please feel free to reach out if you'd like any help testing

@nathanhoad
Copy link
Contributor

I've released Dialogue Manager v2.14.1 which should work around whatever is happening in EditorFileSystem.scan().

@HelpfulFerret
Copy link

I'm seeing the same (or a variant, at least) issue on Godot 4.0.2 without any plugins installed or running. I have one TileMap whose tileset collision changes aren't propagating to the terrain created with it. I am also unable to add or remove atlases from the tileset, the remove/add buttons are outright disabled now, and so are the Paint, Eraser and the 3 dots options.

I then created a new TileMap (thinking perhaps having created the original in 4.0.0 that some corrupted data had been present in it that might be resolved in a fresh 4.0.2 node) I was seeing a swarm of errors when I Erased some tiles, then undid it (though this one I cannot reproduce, it seems to work at the moment).

The repeating error thrown is
editor/editor_node.cpp:8243 - Condition "plugins_list.has(p_plugin)" is true.

@Lertos
Copy link

Lertos commented Apr 10, 2023

I am having the same issue as @HelpfulFerret. No plugins installed, using 4.0.2. I have tried having the TileSet saved as a separate resource, as well as making it unique. Seems to randomly clear my physics layer values - it doesn't get rid of the layer, just all the saved collision layers (so that the player doesn't collide anymore).

EDIT: Also seems to get rid of any terrains I've created. Trying to redo the terrains, my output tab is spammed with thousands of these errors:

scene/resources/tile_set.cpp:5403 - Condition "!is_valid_terrain_peering_bit(p_peering_bit)" is true. Returning: -1
scene/resources/tile_set.cpp:5408 - Condition "!tile_set" is true. Returning: false

@kvognar
Copy link

kvognar commented Apr 15, 2023

This happened to me as well. I've updated my Dialogue Manager plugin so hopefully it won't happen again, but just want to throw my vote in for this as too.

@PrinceMerluza
Copy link

So I can't follow all the technical details but the fact that a plugin is causing the completely unrelated behavior is still a bug right and should be fixed on Godot side?

@nathanhoad
Copy link
Contributor

Yeah the issue isn't technically a Dialogue Manager thing - as far as I can tell it's a problem with scanning in EditorFileSystem. The changes to Dialogue Manager just worked around the issue.

@Proggle
Copy link
Contributor

Proggle commented Apr 22, 2023

I can confirm this is happening to me even in the latest unstable build without any plugins, having entire physics layers get wiped for my tilesets makes this sort of unusable.

@cpuccino
Copy link

cpuccino commented May 17, 2023

Keeps happening on 4.0.2 stable (with dotnet) - although i'm not using dotnet on my code base. Goes back to normal once I re-open the engine tho.

 0:4/0/terrain_set = 0
 0:4/0/terrain = 0
 0:4/0/probability = 20.0
-0:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
-0:4/0/physics_layer_0/angular_velocity = 0.0
-0:4/0/terrains_peering_bit/right_side = 0
-0:4/0/terrains_peering_bit/bottom_right_corner = 0
-0:4/0/terrains_peering_bit/bottom_side = 0
-0:4/0/terrains_peering_bit/bottom_left_corner = 0
-0:4/0/terrains_peering_bit/left_side = 0
-0:4/0/terrains_peering_bit/top_left_corner = 0
-0:4/0/terrains_peering_bit/top_side = 0
-0:4/0/terrains_peering_bit/top_right_corner = 0
 1:4/0 = 0
 1:4/0/terrain_set = 0
 1:4/0/terrain = 0
 1:4/0/probability = 5.0
-1:4/0/physics_layer_0/linear_velocity = Vector2(0, 0)
-1:4/0/physics_layer_0/angular_velocity = 0.0
-1:4/0/terrains_peering_bit/right_side = 0
-1:4/0/terrains_peering_bit/bottom_right_corner = 0
-1:4/0/terrains_peering_bit/bottom_side = 0
-1:4/0/terrains_peering_bit/bottom_left_corner = 0
-1:4/0/terrains_peering_bit/left_side = 0
-1:4/0/terrains_peering_bit/top_left_corner = 0

@MewPurPur
Copy link
Contributor

This just happened to me in 4.1.dev4, just confirming that we haven't accidentally fixed this yet. (vanilla Godot, no mods)

@akien-mga akien-mga changed the title Godot 4 RC6 Tiles are seemingly randomly resetted Tiles are seemingly randomly resetted in the editor Jun 22, 2023
@akien-mga
Copy link
Member

While this is a nasty issue, it's unlikely to be fixed for 4.1-stable as we're now in release freeze, and any change to this logic might risk introducing other regressions. As soon as a potential fix is PR'ed, we'll assess it for cherry-picking to 4.1.x (and possibly 4.0.x if the fix seems safe enough).

@akien-mga akien-mga modified the milestones: 4.1, 4.2 Jun 26, 2023
@groud
Copy link
Member

groud commented Jun 26, 2023

While this is a nasty issue, it's unlikely to be fixed for 4.1-stable as we're now in release freeze, and any change to this logic might risk introducing other regressions. As soon as a potential fix is PR'ed, we'll assess it for cherry-picking to 4.1.x (and possibly 4.0.x if the fix seems safe enough).

I recently made those two PRs: #78477 and #78561. They might have fixed the issue, but it is hard to know without reliable reproduction steps. Please let me know if anyone still experience the bug in the next release.

@sgt
Copy link

sgt commented Jul 7, 2023

Well, I tried out the reproduction steps I listed previously and the problem doesn't seem to occur now.

@Proggle
Copy link
Contributor

Proggle commented Nov 3, 2023

I will say it hasn't happened to me since the update, so to me at least it seems like it's fixed and can be closed.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 3, 2023

Closing then. Please comment if you still manage to reproduce in 4.2 beta4 or newer.

@KoBeWi KoBeWi closed this as completed Nov 3, 2023
@github-project-automation github-project-automation bot moved this from To Assess to Done in 4.x Priority Issues Nov 3, 2023
@github-project-automation github-project-automation bot moved this from To investigate to Done in Tiles, Tiles, Tiles Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Done
Development

No branches or pull requests