Async storage events

#What?
Storage events (save/load) should be asynchronous.

#Why?
Storage events take time to load/save, I want it async to know if the data is empty or still loading.

I had the same problem…
a wait action for loading fixed it…
Or are u referring to another matter?

I cannot guarantee the loading time from storage, it may take milliseconds and may take more than a second.
If asynchronous, it will continue next actions once finished.

I have loaded over 3mb worth of saves from storage in a single action and it never makes a frame take over 4ms for the loading (or saving) group.

What is your data structure like that is making it take over a second? Or are you not using a structure variable for your save data (which would be something I strongly recommend against, since even in AAA dev you save/load entire chunks of data, not individual items).

1 Like

I don’t think they should be exclusively async, maybe a different async save/load event the dev can choose. Personally I don’t even like the AdMob optimization flags being added to the manifest by default. Look how many people that messed up having to go through and figure out why once working ads no longer worked. There should be a toggle for that, then the dev can just toggle optimize and rebuild if they notice a lot of ANR. Anyway I hope this would be optional if adopted.

1 Like

did you mean now ads not working ? i already try gdevelop template for admob but still ads not display

Well, since they updated to the new ad SDK that Google required, they enabled Ad Optimization. So the events are async now. Before, they were in order. You could say enable the add and then say show the ad right after, and it would wait until the ad was enabled and then go to the next event of show. Now you say, enable the ad and it goes and does that in the background while it runs the rest of your script. So if it gets to Show the Ad and the other part is still working in the background it will just skip that and not display an ad. It can work as long as you know to just say check if the ad is loaded and if so, then show the ad.

1 Like