blackears / cyclopsLevelBuilder

A Godot plugin to let you block in levels inside the Godot editor.
MIT License
1.04k stars 43 forks source link

UID warnings at runtime #127

Open steamknight opened 8 months ago

steamknight commented 8 months ago

When the plugin is added to the res://addons folder and installed as described, there are a bunch (at least 24 from my testing) of invalid UID warnings at runtime.

For example: load: res://addons/cyclops_level_builder/materials/grid.tres:3 - ext_resource, invalid UID: uid://bnlqi20ay4vs1 - using text path instead: res://addons/cyclops_level_builder/art/textures/grid_cell2.png

I tried a clean installation and a brand-new empty project, but the issue persists. Closing and reopening the project several time also had no effect.

Repro Steps:

  1. Create a new project
  2. Install Cyclops as per instructions
  3. Create an empty 3d scene and set it as default
  4. Run game
  5. Look at Errors window.

Thanks

blackears commented 8 months ago

A few people are having installation issues. I'm not sure why since this isn't happening on my machine. I hope to look into this soon, but I won't be able to get to it until I get some free time.

steamknight commented 8 months ago

Totally understandable. I feel your pain, it's so frustrating getting bug reports that you can't repro.

If it helps, I have attached a minimal project that repros the issue 100% of the time (on my machine, your mileage may vary). Just open the project and run.

As I said, the errors happen when running the game. The tools are installed and function great. CyclopsTest.zip

Thanks again for making this awesome project!

blackears commented 8 months ago

I opened the project using v4.3.dev2.official [352434668] on Windows 10. I did not get any errors. The test.tscn file seemed to be empty - is this as it should be? I did get some errors once I created a cube and started using the tools, but its the usual ones about invalid array lengths which I think is related to how the viewport is being drawn.

benliew68 commented 8 months ago

I got these invalid UID errors too, but they went away after manually saving each resource/scene mentioned in the error log. Off the top of my head the majority of the warnings were referring to the .tres files in the data folder having incorrect UIDs. Using v4.2.1-stable on Windows 10.

i.e. For grid.tres, open up res://addons/cyclops_level_builder/materials/grid.tres in the inspector and click the save button.

image

blackears commented 8 months ago

I'm not sure what to say. I've tried this a couple of ways on both my Windows and Mac machines, but am not getting the issue at all. Your work around should work, though. Those resource files are just used to make things visible in the editor.

steamknight commented 8 months ago

Sorry I didn't reply sooner. Yes, the scene is empty on purpose. It wasn't what's in the scene that's important, just running it caused the warnings.

I'll try loading and saving the resources as suggested above and see if that removes my warnings.

KenyaAdams commented 8 months ago

Just want to echo that going into the resources giving the UID error and manually saving fixes things for me as well. Upgrading an empty project from 1.0.1 to 1.0.2 also prevents errors.

PangolinMontanari commented 8 months ago

I thought I was having this problem, but then I realized I was missing this step in installation:

image

I also had to enable the plugin, then close Godot, then reopen it to get it fully working.

Dekimori commented 5 months ago

Same here reproduced. Manualy saving materials/scenes from debugger errors works fine. Close?

ashelleyPurdue commented 5 months ago

Reproduces on my machine as well.

I'm not sure what to say. I've tried this a couple of ways on both my Windows and Mac machines, but am not getting the issue at all. Your work around should work, though. Those resource files are just used to make things visible in the editor.

The only thing I can think of is that you're not testing this with a totally-clean slate. Are you sure you're running @steamknight's example as-is, and not, like, importing it into your own project or something?

This bug only occurs when it's installed into separate project. It doesn't occur when running inside this repo's project

ashelleyPurdue commented 5 months ago

I think I figured out the problem. The release archive doesn't have any .import files! When users install this plugin in their own project, the Godot editor reimports all of the resources with missing .import files, regenerating their UIDs in the process. Since UIDs are nondeterministic, they end up not matching the UIDs found on this repo---hence the warnings.

That might also be why you're struggling to reproduce this on your own machine. You're probably copying the addon folder straight out of your working repo, instead of grabbing it from the release archive like a user would.

My guess is the problem is in create_addon_archive.py; I don't see ".import" in the big list of file extensions that it copies over.