Fearful freeze bug (Patreon)
Content
The joy of completion was short-lived, suddenly the game freezes with the message like above. This is a bug caused by an infinite loop in the program, and it's very difficult to find the cause. This time it happened and I'll describe the consequences. If you're not interested in the program, please skip this article.
The game freezes when changing costume in face zoom and Device-on, so I'll trace the cause of the problem from there. 1st, check the behavior of the costume change program by executing each suspicious command.
Then I found out that the cause was the command to reset the facial expression.
Further tracking revealed that the cause was a command to control the legs. There is a "for" statement in this to animate the legs. If you've learned programming, you may know this is a statement that repeats a certain process and it's known as "Suspect the 'for' when it freezes". As expected, I disabled it and it was fixed, so this is the culprit.
"for" must be set to a number of repetitions, but no numerical value(NaN) seems to be entered there and cause an infinite loop.The number of times is supposed to be entered based on the current frame number of the legs parts, but it turns out that the reason for this is because the loading of the legs parts is not yet complete when this program is run, so I solved this problem by not executing this program when the target itself does not exist. Although, I should have written an executable program in the legs side to prevent the loading problem originally...Like this one, architecture-induced bugs are tricky because we can't know until it actually happens. When you find a freeze bug, I'd appreciate if you could report me, although it's scary...