Resources seems to be broken after updating to 4.5

Godot Version

4.5

Question

I just did try to update my project to Godot 4.5. After the update it seems like the Resources did change.

I do use a custom resource to hold a set of playing cards, each playing card is a resource as well. Those cards are put together in a deck. That deck is loaded and should be placed on the playing field. With the update to Godot 4.5 the whole deck is empty if I print the content.

I did try to open up the resources, save them and hoped for some changes in the files fixing the issues, but seems like I’m out of luck. I tried to find something on the migration guide, but there’s nothing.

The working 4.4.1 build can be found here GitHub - D-Generation-S/Samory: A Memory like game, written in Godot. Does allow custom card decks to be side loaded.

Any idea what could cause that?

Loading of the resources is done here:

While those are the resources in question can be found here:

named: MemoryCardResource and MemoryDeckResource

Hopefully that information might be helpful.

You might want to scatter some telemetry through that. The questions that come to mind:

  • does the thread actually finish, or is it stuck somewhere?
  • is this a locking problem? I don’t see any locking…

As soon as the code is accessing the deck ressource the return for cards is empty.

As the data aet loaded in that case is something I configured from within Godot the information should be there.

As the whole method is building the deck with an empty card set, nothing is getting placed. The whole code worked with 4.4.1 and stopped working with 4.5 which tells me something within threads or resource handling changed.

Might this be the result of the resource copy which was changed? Is a duplicate preventing resources stored inside an array to be copied as well?

Do resources get copied if used in a thread? Need to check my code if I did that somewhere by accident.

@hexgrid Thanks man!

You did point me into the right direction. Somehow I did not think about that. I did copy the decks somewhere to translate them correctly, this was still set to “duplicate” after changing it to “duplicate_deep” the array was copied as well as expected.

All the cards are getting loaded once again. Seems like I updated successfully to 4.5.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.