derkork / godot-resource-groups

An add-on for the Godot engine that simplifies handling of resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Playtesting is saving resource multiple times

bazsupport opened this issue · comments

commented

I'm not sure how or why but whenever I go to playtest, I'm getting multiple savings of the resources:
Godot_4 2 1_esbswBKg4H

It seems like it could be creating a longer delay to get the playtest up and running, feels like it, but not certain.

Forgot to mention, thanks for this awesome plugin!!!!

The resource-groups will be updated whenever the project is saved and Godot saves the project before every launch of the game. This way it can be ensured that all resource group data is up-to-date with the current project before your game is started. I have tried this on projects with thousands of files and I have not yet encountered any noticable slowdown of the startup procedure.

One alternative would be that you have to manually update the resource groups when you change something in your project. This could be done with a special menu entry. But I feel this is easy to forget and might cost significant development time in chasing down "bugs" which were caused by forgetting to update the resource groups.

What are your thoughts on this?

commented

I actually don't mind the current way you have it automated, I was mostly curious why it saves so many times on playtest?

That image you see with the 8 print outs was after pressing playtest, not manual saves. I average about 2-5 of those messages per playtest. So my thought was maybe it's running more then it needed to?

Edit: Or actually is it how many scenes Godot is saving in order to playtest? So maybe I had 8 different changes between scenes/scripts that it needed to be saved when playtest was pressed?

Hmm that is odd indeed. The plugin reacts to the _save_external_data call from the godot editor, so if this appearing 2 to 5 times then it is because the editor calls it that often. Now the interesting part would be why does the editor call it this often when you play the game? Are you using other plugins or custom scripts that run or do you manybe press Ctrl+S a lot?

commented

I do press Ctrl+ S a lot, as much as I can anyway cause I'm afraid of the Godot editor still lol.
But all those prints are after a playtest is clicked, because it clears the output area and puts all the prints.
Here is a gif of me clicking playest:
Godot_4 2 1_q7qxy8mg8t

Here is plugin list:
Godot_4 2 1_32VOdTpOLI

I did some searching and it's a known issue here godotengine/godot#29468.

seems like if put print() in _save_external_data() it will definitely print multiple times when click "Run" in editor.

commented

seems like if put print() in _save_external_data() it will definitely print multiple times when click "Run" in editor.

Ok so it's only printing that much, it's not actually resaving a bunch?

It is resaving stuff multiple times when being called multiple times. As a workaround the plugin could maybe remember the last time it resaved and if its only a few milliseconds away doesn't do it. Would be nicer if the underlying issue was fixed though.

I tried moving it into the _build function which fixes the problem when running but because _build is not run on export it could happen that you export the last state that you ran rather than what is actually inside of the resource groups...

The exporting problem could be addressed with an EditorExportPlugin.