Encryption breaks some .png files when deployed

Has anyone ever had an issue when encrypting your image/audio files during a deployment, some of those image files simply don't show up in your deployed game? I've been using encryption for nearly 2 years in my project and have never had an issue until today and I can't figure out what's going on.

When I don't encrypt my deployed project, every looks and sounds perfect, but when I encrypt it, suddenly random image files won't appear in my game. The game doesn't crash or throw up an error or anything, it's just simply not there.

I also tried using Arthran's https://arthran2.itch.io/encrypterator-3000 which encrypted everything just fine, but I still have the same issue of random images not appearing in my deployed build.

Any ideas?

1718719970070.png
Post the file names of those that are not loading. All files must follow various rules and windows cheats to get around it sometimes in playtest, so it may be the file name is not in proper format for deployment.
Also, are you sure it's the encryption, or are you using the Exclude unused files checkbox?

If you have files you use in plugin parameters or notetags, the deployment will exclude them so they'll be missing in your project.

Neither of those encryption methods should be able to delete files.
@bgillisp
It's strange, but different files go missing on different deployed builds. One file that is always missing no matter what, is called Merc_Selection_Board_Set1_BG.png_

Since that one is consistently missing, I'll use that as my test case.

@ATT_Turan
I never use the "Exclude" feature as I read somewhere that this can cause major issues with a deployment. Instead, if I want to exclude a file (like a .psd file for example) in my build, I manually delete it.

Update: I just changed Merc_Selection_Board_Set1_BG.png_ to 1.png_ and it's still missing in the game when I play a deployed version, so I don't think it's a naming convention issue. Hmm.. 😕

Update 2: So I figured out the problem but don't yet understand why it's happening. First off, it has nothing to do with the name of the .png file. What's happening is that I use a common event to assign a .png to picture ID 19. Then when the player clicks a button, another common event erases picture ID 19, then fires off another common event to assign Merc_Selection_Board_Set1_BG.png to picture ID 19.

When I choose a different picture ID, one never used before, like 20 or whatever, the issue is resolved when using an encrypted deployment. When I don't encrypt my deployment, everything works as expected when using picture ID 19.

Strange, eh?
Update 2: So I figured out the problem but don't yet understand why it's happening.
I don't think I understand the explanation. You're saying that you have the same event, you change nothing other than the ID, and it correctly loads the file?

The ID should have nothing to do with the filename, and I've certainly never heard of anyone having this issue before.

If you got it working and that's good enough for you, that's cool. Otherwise, you could post screenshots of the event(s) and the file in your deployed image folder.
@ATT_Turan
I figured out what the issue is... when using encryption, RPGMaker has a hard time letting go of assigned picture IDs for some reason. When I don't encrypt my build, everything works exactly how it does in the Playtest.

I use a lot of pictures for maps, menus, etc... When I assign a background .png file, let's say for a map, I have to assign that .png file to a picture ID. When the player closes the map, it erases the picture ID so a different .png can be assigned to that same number. Unfortunately, when I encrypt my game, RPGMaker won't unassign the first .png file assigned to a picture ID. Which means, when I try to assign a different .png to a picture ID I already had assigned before, the new .png won't display - only the first .png ever assigned will display.

Does that make sense?

Example:
I assign Map.png to Picture ID 1.
It displays how I should.
I use a Common Event to erase Map.png which should unassign it from Picture ID 1.
I then assign Map2.png to Picture ID 1, but it won't display... only Map.png will display using Picture ID 1.

Long story short... I can't use encryption for my game. 🙁
Does that make sense?
No. There's nothing in the Erase Picture code that looks to see whether anything is encrypted.

I also can't duplicate your problem. I made this event, deployed it with encryption, and it works perfectly.
1718731065853.png
@ATT_Turan
What is so odd is that sometimes the 2nd assigned picture displays, and sometimes it doesn't. It's making this issue hard to nail down. I did notice that when I zone to another map, that seems to clear out the picture ID and I can reassign it to another .png... but then the same issue reoccurs.

Update: I found that if I replace any troublesome .png_ files with the original unencrypted files, those images show up just fine in the deployed game. Looks like I can have encryption for my image files except those that give me an issue. Wow, what a headache deployment will be with encryption.
It could be a plugin trying to do some weird caching stuff or something. Are you able to replicate this issue without any plugins active?
It could be a plugin trying to do some weird caching stuff or something. Are you able to replicate this issue without any plugins active?
@Arthran
Thanks for the comment. It's very possible what you're saying. Unfortunately, I can't really test that because I've got around 80+ plugins running at once, meaning the game won't even startup if I were to disable them.

Original thread: https://forums.rpgmakerweb.com/threads/encryption-breaks-some-png-files-when-deployed.169606/