[SOLVED] Gestion of image packs

Hi everyone,
I’m new to gdevelop (and dev in general).

How do I…

I wanted to create a system of flashcard to learn the top 99 paintings with a swipe action (left i know it, score increment etc , right nope, decrease).

What is the expected result

It works pretty well on the browser (computer) but when i export it on android (apk) and install it on my phone, i just got a huge freeze on the splash scene, and after some minutes i got to my main scene but no response.

I used a sprite with the 99 images as animations and my code change the animation (randomly) and i guess it’s the core of the problem.
I thought that using 99 pngs was easy but maybe my phone doesn’t like it.

I have been trying to create a sprite with only one animation and change it by charging the new picture (but i didn’t manage to find an action like that)

If someone could have an idea.

Thanks for any help.

2 Likes

Hi @naboo!

Welcome on our forum.

I find your example of application very interessant.
It’s not usual to create this type of application, with GDevelop of course.

Unfortunately, i have no idea to answer how load a new image in a given sprite (i have not had the occasion to think about)

Can you present you on this forum in the dedicated section?

Thanks.

A+
Xierra

1 Like

there’s this - but ive not used it myself
Load images from a URL - GDevelop documentation

1 Like

Hi naboo nice project, I don’t have any solid answers either but things to look at, how big is the file size of each pic, have you made a decision about pre loading them or not pre loading. Have you made a copy of your project with say, just 5 images/animations and see if it still loads with problems in your test phone.

Unfortunately, it’s not the answer waited by our friend.

It seems there is no possibility to directly load an image into a sprite during execution of the game.

Somebody to confirm that?

A+
Xierra

I agree with what @Bubble said

Let us know the total size and maybe the model of your phone, maybe it simply cannot run it properly.

Also some things to consider

  • If the size if too big, maybe use JPEG images
  • Make sure that each image/animation dimensions are the same, or similar
  • You can definitely make this by using 99 sprites instead of 99 animations but I think the animation solution is easier to work with.

If you want you can send me the apk and I can try it on my phone

Perhaps if the problem is a 100 images downloaded in the first scene how about if you have all the events in an external event and all the ui and extras in an external layout so that on the editor there is just the image object with the first image. Now you can duplicate the scene over and over and insert the next image and then refer to the scene to go to with a number variable.

Thanks for the answers.

I tried to upload it on gdevelop and it doesn’t work either so maybe not a probleme with the images.
My text variables (which store the percent of succeed doesn’t initiate) i got the text “rslt1” (the name of the text object) instead of 0%.

I am investigating on this side of the problem before resizing, removing the images.

Ok, I just remove the lines coding the upload of the save as a JSONfile, and it works on gdevelop export.
Here the link if you want to see the idea of the project.
on gd.games snaboo/culture-g-tableaux

I’ll export the apk and will test it tomorrow (without the lines saving to JSON)

here the lines i have removed (certainly the problem)

don’t work … little disappointed.

@Bubble this will be my next try

@petlimpet this will be my last resort (i am a little reluctant at the idea of creating 99 scenes ^^)

Thank you and good night
++

yes - its a little ‘out there’ - that one! …leave that one as very much a last resort!

Solution : wrong diagnostic. the probleme was with my phone (realme) and the method of upload.

I uploaded it on my drive, then on my phone (it wrecked my app gestion) no more apps could be installed.

I rebooted my phone, reinstall my app via USB (in the download then install) and it works perfectly fine.

I use 100 pictures (average 50ko in jpg) as sprite animations and no problem, no latency.

I’ll test that thoroughly now on my phone.

Thank you for the help and the solutions suggested (even though there weren’t the answer for my specific problem, they put some enlightment on other aspects).

Best regards

PS : I will try to change the title to add SOLVED or something like that.

2 Likes

Hello @naboo!

Happy to see your issue has been resolved.

Don’t worry: i am going to put a “Solved” in the title of your post.

A+
Xierra