Enigma Virtual Box & Wrong Header Error (MV)

I turned my deployed RPG Maker MV game into a single file using Enigma Virtual Box. It mostly works great, but recently, I've been getting random and unpredictable errors that say, "Uncaught Error: Wrong Header." This seems to only happen during battle in the single file version of the game.

I've been play testing deployed versions of my game for maybe six months, and some people have been playing the single-file Virtual Box versions of the game. I never saw this error before, and now I have seen this error multiple times, and only when playing the Virtual Box version of the game.

I don't know how to get better error information for the deployed game.

Any ideas what could be happening? If not, is there a way to get the game to ignore header errors?
MrTs_stackError is 1 way, but it might also from packing the file incorrectly
or missing the www folder.

if it's only during battle or after battle, you need to see if you can replicate it.
MrTs_stackError is 1 way, but it might also from packing the file incorrectly
or missing the www folder.

if it's only during battle or after battle, you need to see if you can replicate it.
I don't know how the game can function at all without a www folder. I recently made the game again using a new deployed version of the game, and I saw the error a couple times with that.

I had to make an extra www folder for the save files, so maybe the game thinks there are two www folders in some way, but that is how others are using the Enigma program.

The single file version of the game has a www folder inside from the deployed version of the game, and then the single file exe version of the game has to have a www and save folder in the same folder that it is in as well in order to save the game properly.

I see no way to replicate the problem other than just playing the game for hours and randomly seeing it. It is only during battles so far. Everything else works great.
can you give a screenshot of the exact error message?
@Andar

Here is a screenshot
I hoped for a bit more on details there unfortunately.

is there any chance you can add yanfly's main core to your game and go to the error again with that active?
yanfly's main core contains nothing but a few bugfixes and optimizations, so it should not interfere with any other plugin - but it does give a better error message output.
I hoped for a bit more on details there unfortunately.

is there any chance you can add yanfly's main core to your game and go to the error again with that active?
yanfly's main core contains nothing but a few bugfixes and optimizations, so it should not interfere with any other plugin - but it does give a better error message output.
I am using that plugin already. It didn't show anything more than that simple error message.

The plugins:
Spoiler
plugins_10-29-2022.png
maybe your YEP plugins arent in the exact order (you can run the
plugin in my spoiler for the order of it).

Mr.Trivel have [error stack on screen] which can give more info on the error
hopefully.
A "Header is wrong" error happens when your game is trying to decrypt either an audio or an image asset, and the first 16 bytes of the file don't match what the engine expects them to be. If you're certain that the deployed game works fine when it's not packed with Enigma VB, and that you're not making some type of mistake in the deployment or packing process, then maybe Enigma VB is somehow corrupting the file during emulation. But I don't really know why that would be happening, or how to stop it, so the only advice I could offer would be to simply stop using Enigma VB.

Just in case you don't know, I'll mention that anyone can unpack an Enigma VB file by downloading a free tool and clicking one button... so it doesn't actually do anything meaningful for you in terms of protection. That being the case, the reasons not to use it significantly outweigh the reasons to use it, IMO.


If not, is there a way to get the game to ignore header errors?
Technically that is possible, but I would advise against doing that. If the asset files are corrupted, then who knows what kind of garbled mess you'll wind up with by forcibly trying to use them anyway?
If you're certain that the deployed game works fine when it's not packed with Enigma VB, and that you're not making some type of mistake in the deployment or packing process, then maybe Enigma VB is somehow corrupting the file during emulation. But I don't really know why that would be happening, or how to stop it, so the only advice I could offer would be to simply stop using Enigma VB.
For what it's worth, I tried using Enigma once to share my game for playtesting. The user quickly got this exact error message that crashed the game, which has never happened in many hours of my playtesting and didn't happen again once I gave them a non-Enigma deployed version.

In her case, it coincided with her Alt-Tabbing out of the game, but I have no idea whether that was causal or coincidence.

But I did a search and came up with one old thread where someone had reported the same error with no resolution.

I am going to posit that Enigma is not entirely compatible either with RPG Maker MV/Z games generally or with some specific plugins therein.
For what it's worth, I tried using Enigma once to share my game for playtesting. The user quickly got this exact error message that crashed the game, which has never happened in many hours of my playtesting and didn't happen again once I gave them a non-Enigma deployed version.

In her case, it coincided with her Alt-Tabbing out of the game, but I have no idea whether that was causal or coincidence.

But I did a search and came up with one old thread where someone had reported the same error with no resolution.

I am going to posit that Enigma is not entirely compatible either with RPG Maker MV/Z games generally or with some specific plugins therein.
I will likely have to upload the non-one-file version of the game. I like that the one file version can look more professional, and they don't need to use the readme file to know to click on the exe file.
I like that the one file version can look more professional
I wouldn't really call it more professional. On the contrary, I think you'd probably have to search very hard to find a AAA game that is comprised of only a single file, if you could even find one at all. It's quite normal (to the point that I'd call it ubiquitous) for a professional game to be comprised of numerous files.

When it is split into numerous files, you have the benefit of only needing to load the parts of the game that are necessary at any given moment, so it is much more memory efficient. When it's all packed into a single file, then 100% of the game has to be loaded into memory at all times, which is wasteful and oftentimes impractical.

Using numerous files also has the benefit of allowing you to release smaller updates, since the users would only need to download the files that have changed, rather than having to re-download the entire game every time an update is released.

If you're concerned about looking professional, or you want to make things easier for the end user, then the best approach would probably be to distribute an installer that unpacks the files into a directory and creates a desktop shortcut to the appropriate executable file. However, as an end user, I personally tend to be a bit leery of installers when it comes to indie games and software, and I'd actually rather just manually unzip the archive and locate the correct executable file myself.
I double checked the regular deployed version of the game, and it is not giving me this error. I am confident that it is just the one file version of the game.

I think I posted in the wrong forum. I thought it was just for deployment, but I guess it is for mobile deployment.

I've moved this thread to MV Support (from Mobile Deployment). Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/enigma-virtual-box-wrong-header-error-mv.152298/