Problem with encryption

Is there a way to encrypt images EXCEPT tilesets?

I have a very odd problem after I deploy my game, in the sense that tilesets sometimes completely fail to appear (so the screen is black except for events). But this happens only with encrypted images. It works properly if I deploy and just encrypt the audio.
I should add that if I enter the menu and exit, the tileset magically appears, but this is hardly satisfying from a gamer's perspective. Another thing is that only a few maps are affected (always the same ones though), but again, not satisfying. And since MV will either encrypt all images or none, I'm stumped.

EDIT: I tried to replace the encrypted tilesets with non encrypted ones but then MV can't read it anymore (it says "failed to load" even though the picture is there) :osad:
Hello and welcome.
Are you deploying your game to Windows?
perhaps you should try to identify the cause instead of trying to fix the problem afterward, because that is not normal behaviour.

do you have any plugins that change tileset behaviour?
does this happen with default tilesets or with your own custom tilesets?
do you have any form of caching or preloading plugins installed?
@Dev_With_Coffee yes absolutely.

@Andar
do you have any plugins that change tileset behaviour? Not purposedly.
does this happen with default tilesets or with your own custom tilesets? FSM.
do you have any form of caching or preloading plugins installed? I do have Galv Image Cache which is used like this:
1637135312108.png



EDIT
Turning it off didn't help :osad:
FSM is OK - I asked because if you made your own tilesheets you might have made mistakes there, but any officially created tilesheet should be OK.
Preloading always has a cost in RAM-usage, and that could have caused problems. If you started a new game after turning the preloader off and the behaviour stayed the same, then it isn't the cause either.

can you give screenshots of your plugin manager with all your plugins listed? then we can check for you - there are several things not obvious in plugins that can cause problems.
1637145444937.png


1637145467038.png


1637145528696.png
@Dev_With_Coffee yes absolutely.
Try to create a new blank project, use all the same graphics in it, but don't put any plugins. Deploying with encryption and testing option.

Good luck
This works. But I'm not surprised and I'm pretty sure the problem HAS something to do with a plugin but the nature of the bug is pretty strange, to say the least.
Basically, the tileset will not show at all. But a quick back and forth in the menu, and it's fixed. Also, the problem happens only with a few maps, not all of them.
Hence why I originally thought of just leaving the tileset folder unencrypted, but then MV can't read it, says "failed to load whatever.png" even though whatever.png IS there.
I think once you've deployed with encryption on (regardless of whether you defined a key), MV loses entirely the ability to read unencrypted files, which is a shame, as this would be a quick and easy fix :osad:
then you should try to pinpoint which plugins are responsible by testing this with each plugin on/off.

probably redirect the starting position to a map that has this problem, then turn half the plugins off and test. If the problem consist, it is in the half of the plugins still active - if not it is in that half that was turned off.
repeat the test with a quarter of the plugins (half of the half that contains the problems) and so on until you have the plugin that when turned off solves the problem.

then start trying to solve by reordering or replacing that plugin.
Actually I removed everything but SRPG_Core and YEP_Core and the bug was still there.
What originally misled me is that I had removed the game intro to make my tests faster, and that time the exact same map was loading properly (even without the need to remove a single plugin). This is a very stupid glitch in my opinion, and very hard to pinpoint.
Basically:
I can remove all the plugins but the absolute mandatory ones, and the glitch persists.
I just start the game without the intro, and the glitch is gone. The intro itself is just a bunch of cutscenes with no script call and plugin use, so I don't see what it would do wrong.
I wish MV would still read non encrypted png even with the rest is, that'd make the fix so much easier.
I can remove all the plugins but the absolute mandatory ones, and the glitch persists.
1) if you use only one of those "mandatory" ones each test, can you pinpoint which one it is?
because in reality there is no mandatory plugin...

2) if you go to your project folder, js directory and use a text editor to open rpg_core.js, what is the version number at the end of the title line? No number there means 1.0
1) if you use only one of those "mandatory" ones each test, can you pinpoint which one it is?
because in reality there is no mandatory plugin...

Given the nature of the game, there is. I'm keeping SRPG_Core and YEP_Core. I tried removing YEP_Core but got some kind of weird error message. I think maybe SRPG_Core needs YEP_Core but not sure. Anyway I kept only these two.

2) if you go to your project folder, js directory and use a text editor to open rpg_core.js, what is the version number at the end of the title line? No number there means 1.0

rpg_core.js v1.6.1 (community-1.3b)
Anyway I kept only these two.
this was for testing and bughunting, not for keeping them off.
please test both cases (yep only, srpg only without the other) and if you get a strange error message, give us a screenshot of that error message.
@Andar

With all plugins:
* normal start of the game (with a bunch of cut scenes) -> tileset on buggy map doesn't appear
* start the one map before buggy map (with an autorun taking you to buggy map) instead of normal intro -> tileset appears

After ALL plugins have been removed:
* start one map before buggy map (with the exact same autorun) -> tileset doesn't appear anymore!!
* remove a portion of eventing apparently harmless from this autorun -> now tileset appears again (it's interesting to note that this portion of code was NOT preventing tileset from appearing when all plugins were present).

The code that is removed involve a bunch of switches and some "add member" event, "add weapon/armor, "change equipment", nothing out of ordinary.

1637169325304.png


Leaving this code in the autorun -> tileset doesn't appear
Removing it -> tileset appears

As a reminder this is performed with NO plugin whatsoever.


This glitch is really a big mess.
Why is it so hard for MV to just display the tileset? I mean, if I enter/exit the menu, the tileset IS BACK no matter the plugins involved. What (kind of magic) happens when you enter/exit the menu then? This is what I'd like to know and maybe I could just force it with a script code whenever that stupid glitch happens.
Hence why I originally thought of just leaving the tileset folder unencrypted, but then MV can't read it, says "failed to load whatever.png" even though whatever.png IS there.
In reality the function that loads the images checks if the encryption is enabled and not if the files are actually encrypted.
To create a case that when it is a Tileset would have to modify this function in particular.

Yet that would not guarantee the problem was resolved. Perhaps CACHE is overloading by the number of simultaneous executions due to events in the map.
When an instant event is executed in an order and not together with another one in parallel, it is more difficult to overload.

The ideal would be to redo this system or linear event in the new blank project, this will help you to isolate the problem.
Leaving this code in the autorun -> tileset doesn't appear
can you give the full original event instead of just the removed commands?
it sounds more and more like a timing problem with load times and update times as those commands you show have nothing to do with the tileset.
and timing problems are always caused by a combination of commands and triggers, so knowing the commands that slow down the rest of the event is of limited help.

and is there a reason why you don't use the default initial equipment for those settings? that would make the event much easier...
Perhaps CACHE is overloading by the number of simultaneous executions due to events in the map.

Yes I thought maybe it's a case of too many functions although that's only about 20-25 very simple event commands there.
Also why would the same set of commands actually no longer trigger the bug when all plugins are there?

and is there a reason why you don't use the default initial equipment for those settings? that would make the event much easier...

Yes the game can be played in different ways that require different piece of equipment for each character.
Also MV is pretty limited if it can't handle 20 of its own default events...

can you give the full original event instead of just the removed commands?

1637176676422.png


1637176701955.png


1637176719866.png


1637176738937.png


1637176759849.png


1637176775272.png


1637176791326.png
OK, I don't see anything directly suspicious - but several places where you used strange logic.

1) why set variables with script commands at the beginning?
the usual way for the same is to use control variable, and then the script line inside control variable for the code from Orange.
Technically the result would be the same, but using control variable you can see the name you set for the variable, which is an advantage in preventing using the wrong variables due to typos.

2) why the wait commands between the ifs and so on?
those have absolutely no function or use there as far as I can determine, and might mess up things with timing.

3) if possible, transfer player commands that transfer the player to a different map should always be the last commands of an event.
if you need commands to happen after the transfer, those commands should be on the next map.

The reason for this is that the transfer to another map deletes the current map - and that includes all events on the map like the currently running one.
In some cases the commands after the transfer stay in memory long enough to be executed, but in other cases the event gets deleted before those commands can take place - and that can really mess up what is happening.
the difference depends on which commands are used in which sequence, and because most people can't get that correct we always suggest to not use any commands after a transfer in an event.

4) your condition structure is strange
you have two conditions checking if that global meta switch is ON, more or less directly after another, and nothing checking it for off or doing if any of those branches are off.
That is not automatically wrong depending on what the conditional branches do, but it is strange and should be checked if it works as intended.
1) they are switches not variables.
2) I use them a bit by habit but would that cause any dysfunctioning?
3) unless I'm mistaken the SRPG plugin command has to be put just after the teleport. I could do it for the transparency event though.
4) it works as intended, no worries about that.

That leaves me with one question: why does removing the series of "yellow" events (add weapon etc) make any difference? Everything stays the same, there is only that autorun event and in one case tileset appears, in another not.

And is there absolutely no way to either:
a) replicate what(ever) the entering/exiting the menu does (as it fixes the issue) and force it with a script code in a parallel event?
b) alter how MV deals with encryption so that it can still read unencrypted PNG if the rest is encrypted? Then I could just swap the encrypted tileset folder with the unencrypted one.
1) OK, I misread

2) theoretically no, but practically you'll never know.
The problem is how the wait works internally - that is not as simple as it seems.
And while the waits there should not cause any problems, I've learned to streamline every process when trying to find the cause for strange computer behaviour.

The most extreme (and reproducable) thing I ever found that way was that the wrong mouse driver under Windows caused a display error under DOS. And no, that is no joke and we never found out why exactly...

3) I suggest checking the instructions and testing if it still works when the plugin command is given the next map. That said, it should not cause problems in that specific case.

b) anything can be done and programmed in. The reason why it wasn't done that way in default is because having a switch between two different load functions will slow down loading, for a functionality that shouldn't be needed in any regular case.
you can probably ask for a plugin that changes the encryption behaviour in that way - but be warned that this may also cause a weakness in the encryption.

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-encryption.142201/