MZ How do you handle a Game-Breaking Bug that you can't Replicate?

Just when I thought my demo was ready for its first release, I was hit by this bug. When I have multiple playthroughs on my Steam Deck, a null error breaks my playthrough during combat. I've no idea where or what plugin caused this as I can't open the console on a deployed game (at least on my game).

At first, I thought it was a Steam Deck issue as I didn't encounter this on PC or replicate it. But now, even on Steam Deck, I just can't reproduce it again.

I've done my investigation which led me to think that a certain third-party plugin might cause it but I'm not that sure. I even wrote fixes that I'm not sure will fix that.

But knowing that this bug could break a player's game randomly killed my enthusiasm for my game's upcoming demo release.

What should I do next?

Edit:
Finally found the bug on Windows:
Screenshot 2025-03-06 070934.png


Update:
Visustella probably fixed this issue after I reported it.

Screenshot 2025-03-20 134945.png
there was a plugin to open the console log during development
for MV (probably portable or same as MV to MZ).

if you want to be sure only you can use it as dev, you need to
modify it to set a players name or hidden code to activate it to be able
to use.

if you remember what you exactly did or skill, you can check that skill
to find the bug.

if it's very rare to replicate like 1%, than I wouldn't worry to much unless
there are more.

if they save it before and get it over and over on the same skill or attack,
let them send you the save file if possible to check it from there.
Even triple AAA games have bugs. Devs patch them when they find out how it happened.

What ShadowDragon said, If you can't replicated it, then it's not worth worrying too much about. Good sign that it won't happen to 99.9% of your players. And when it does, ask for details so you can patch it.
Did you see an error message when the game crashed? It may help to install a plugin that provides more details about the error (similar to what the console does), e.g., Arthan's Verbose Error Screen (https://forums.rpgmakerweb.com/index.php?threads/verbose-error-screen.158324/) as that will help you debug the error.

You can also tell players how to contact you to report bugs, or create a bug-reporting thread on your release platform. Don't get too down on a single bug - it happens, regardless of how many hours you've playtested your game, especially as players do things that a game dev never thought of doing. 🙂
Perhaps find an error log plugin and ask the user who had this bug to upload their log file in the future?
a null error
you mean a value is null, or the whole game just crashes without an error message?
if it's the latter, that could be a faulty file somewhere, not a code error.

....which, if we're talking Steam, could tie to a faulty update or overwrite of files.
not unheard of.
there was a plugin to open the console log during development
for MV (probably portable or same as MV to MZ).

if you want to be sure only you can use it as dev, you need to
modify it to set a players name or hidden code to activate it to be able
to use.

if you remember what you exactly did or skill, you can check that skill
to find the bug.

if it's very rare to replicate like 1%, than I wouldn't worry to much unless
there are more.

if they save it before and get it over and over on the same skill or attack,
let them send you the save file if possible to check it from there.
I remember the skill and how it happened. I just can't replicate the error no matter how I try.
Even triple AAA games have bugs. Devs patch them when they find out how it happened.

What ShadowDragon said, If you can't replicated it, then it's not worth worrying too much about. Good sign that it won't happen to 99.9% of your players. And when it does, ask for details so you can patch it.
Thanks for this. I woke up depressed because of this. I'm feeling fine now.
Did you see an error message when the game crashed? It may help to install a plugin that provides more details about the error (similar to what the console does), e.g., Arthan's Verbose Error Screen (https://forums.rpgmakerweb.com/index.php?threads/verbose-error-screen.158324/) as that will help you debug the error.

You can also tell players how to contact you to report bugs, or create a bug-reporting thread on your release platform. Don't get too down on a single bug - it happens, regardless of how many hours you've playtested your game, especially as players do things that a game dev never thought of doing. 🙂
Will try this.
you mean a value is null, or the whole game just crashes without an error message?
if it's the latter, that could be a faulty file somewhere, not a code error.

....which, if we're talking Steam, could tie to a faulty update or overwrite of files.
not unheard of.
The error is TypeError Cannot read property 'hitType' of null. The game crashes and won't continue. Although the game didn't close on the Steam Deck.
TypeError Cannot read property 'hitType' of null.
so, there IS an error.
what line of what script does it point to?

if you "can't replicate it", it might tie to the user having loaded a save file, which may point to a character or object you can't get right away.
that error in question means the program is trying to access a property from an object that is not loaded.
what plugin calls for "hitType" anywhere at all? you can search for it with a text editor.
so, there IS an error.
what line of what script does it point to?

if you "can't replicate it", it might tie to the user having loaded a save file, which may point to a character or object you can't get right away.
that error in question means the program is trying to access a property from an object that is not loaded.
what plugin calls for "hitType" anywhere at all? you can search for it with a text editor.
I didn't get to see the line error or the file where the error is as I'm playing on Steam Deck.

Searching on notepad++, the only plugin I used that has "hitType" are Visustella's Battle Core and ItemsEquipCore. I'm guessing the error comes from Battle Core as the error happened during combat.
the error happened during combat.
I'm not an expert on VS plugins, but you can help narrow it down even more by looking at what objects that property is tied to.
if it relates to actors, then maybe a character was faulty, or the troop in question had an enemy that was faulty, or outright missing in the database.
keep reading and tracking.... you'll figure it out.
if it only happens on SteamDeck and not on pc/webbrowser.
than SteamDeck might handle it a bit slower, so maybe there is something
you can load the type to be readed before battle somehow.

ItemEquipCore can also be the cause instead of BattleCore if your equiped
has increasing but no value or not loaded during battle.

to really pinpoint this, a screen error an line is usefull, but if through
VisuStella's Plugins which is obfuscated makes it harder to patch or fix
if its inside the plugin of missing line of code for example.
I just did a hundred battles with the same party, troop, and skills, the error still won't show up.

I also found someone using the same plugins as me (Visustella Battle Core and Visual State Effects) four years ago and having the same issue. It seems like Visustella fixed this issue before. There's probably just a rare chance that the error might happen again.
or something isn't read or refreshed.

as there are some issues with YEP plugins, some has code to fix
this is it has a wrong return value or missing code to return otherwise.

while VS plugins are obfuscated, we cannot really check why the
hitType becomes null or why the 2 are compatible as they should.

so to make the patch, the 2 should be readable in order to fix.

no one can really extend it for their modifications either to suit the game.
so if you really need it, but no help, best thing is to find alternate plugins.

I believe AquaEcho had a thread for it, but no idea if everything could
replaced what you already have.

if its just steamdeck, put a error stack on screen so they can send you a list.
but while error stack is <computed> it would be hard to pinpoint the error.
the same party, troop, and skills
have you tried items?
hitType is a property of usableItem objects (items and skills, with a user and a target).
for items, hitType is 0 (certain hit)

Visual State Effects
...which, if you patched this error to return 0 by force, I bet will return another error down the line when trying to access the effects of the item, to display on top of an actor.
could that be done? add the property hitType to the class null just to trigger this?
if there was a raise exception call during that run, that could be picked up by a console tracker.
basically, dye the bloodstream to show you the clot on X-ray.

(overkill, I know.... but it might bypass Yanfly's obfuscation, IDK)
have you tried items?
hitType is a property of usableItem objects (items and skills, with a user and a target).
for items, hitType is 0 (certain hit)
I didn't. But I don't remember using an item in that battle. The error occurred after the enemy was killed by using a skill.

I probably shouldn't worry about this error anymore, as people in this thread pointed out unless a lot of my future players encounter this. I'll then probably just ditch the plugin with a compatibility issue with Battle Core.

Thanks a lot guys! Much appreciated!
The error occurred after the enemy was killed by using a skill.
that's another clue.
there's a specific order in which things must happen, in the engine.
just because you see an error happen at one point, doesn't mean it happened "during" that... there's a lot of processing behind the scenes, and YF may have poked their entrance point anywhere, and we can't know because we can't read the code.
and you can't exactly go and tell them their plugin is faulty, because "their plugins are never faulty", apparently.

if you want to track this down, it can be tracked, it just takes time.
if you can live without it, scrap it... maybe there is a plugin that does what you need without the bulk of options that YF packs theirs with.
Finally found the bug in Windows, but can't replicate it still.

Screenshot 2025-03-06 070934.png


It sucks that it's Visustella Battle AI as I'm using it for my autobattle actors and I can't find any alternatives. I already reported the bug and will probably just wait for their reply.
check the line of manager and object, but if not relevant there of error trace
only from it, than it can be a pain to fix the battleAI (if its not a typo you made).

good thing there is more info, but we might be stuck helping you on the
obfuscated code (maybe the skill that cause it, its code, to see it there.)
Visutella probably fixed this issue after I reported it.

Screenshot 2025-03-20 134945.png

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-handle-a-game-breaking-bug-that-you-cant-replicate.175525/