SmeeDucks

Villager
Member
Joined
Jan 19, 2020
Messages
10
Reaction score
2
First Language
English
Primarily Uses
RMMV
So during testing one of my friends discovered a bug where any damaging skill seems to have a random chance to deal "-Infinity HP" which ends up always killing the enemy. He has shown me, and it is a fairly common occurrence when he plays (roughly once an encounter), however on my own device and several others I have borrowed to test in playtest or deployed versions, the bug has been impossible to replicate. Since it only seems to happen on a deployed versions on other people's devices I don't really know of a way to track down the cause. The only thing that I can reason as the cause is in rpg_core the Graphics.printLoadingError has a -Infinity (this._loadingCount = -Infinity), but I don't know how that would be passed as damage. We are going to try and get a copy of RPGmaker on his device and run in it in the engine so we can bring up the devTools and see what error is being caused on his end, but that might end up being a while from now. If anyone has had any experience with something similar or anyway or any other way of testing it that would be helpful. Thanks!
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
830
Reaction score
669
First Language
English
Primarily Uses
RMMV
Sounds more likely there's a division by zero happening, which turns a float to 'infinity'. Check every time there's a division in your damage formula
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,279
Reaction score
8,361
First Language
German
Primarily Uses
RMMV
for detailed help, we would need more information like a screenshot of the skill used from the database.

as for the testing issue, if you deploy and start the deployed version on your computwer it should do the same as on any other players computer - IF you deploy correctly and don't make the mistake and deploy into your project directory. If there is a www folder in your project directory that has already happened and your playtest is already damaged.

if the error still only happens on that friends computer, ask him/her if it happens on new games or on loaded savefiles - loading an incompatible savefile from an older version can cause data errors.
 

SmeeDucks

Villager
Member
Joined
Jan 19, 2020
Messages
10
Reaction score
2
First Language
English
Primarily Uses
RMMV
for detailed help, we would need more information like a screenshot of the skill used from the database.

as for the testing issue, if you deploy and start the deployed version on your computwer it should do the same as on any other players computer - IF you deploy correctly and don't make the mistake and deploy into your project directory. If there is a www folder in your project directory that has already happened and your playtest is already damaged.

if the error still only happens on that friends computer, ask him/her if it happens on new games or on loaded savefiles - loading an incompatible savefile from an older version can cause data errors.
All the skills use a form of "Math.ceil(((a.atk*x)*a.atk/((a.atk+(b.def*y))))); for damage where no enemy or actor has 0 atk or def or anyway to set it as such (though I guess creating a version with modified skills i.e. no modifiers or notes and see if those error out on his end is an option as well).

As for the deployed versions we have been testing the same version of the same export and starting new games each time. There doesn't seem to be anything in my project directory that should be causing an issue (such as the www folder), though I admit I lack the experience to know what those could be.

Thanks I'll just have to keep working at it.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,279
Reaction score
8,361
First Language
German
Primarily Uses
RMMV
a form of "Math.ceil(((a.atk*x)*a.atk/((a.atk+(b.def*y)))));
There is a reason why I asked for a screenshot, because a skill is more than just a damage formula.

that said, this formula does provide the clues to the error - and you are aware of it as your own words proof.
You'll get an infinity error if you divide by zero. Unless you have another, different cause for an infinity error elsewhere that means that in some skills, the divisor DOES become zero.
That is a fact, no matter how much you claim that there is no attack value zero on any actor.

The fact that the error only happens sometimes support this by telling us that it is a calculation that ends up with a zero divisor only sometimes.

So how can the part ((a.atk+(b.def*y)) become zero?
First - since it happens not with every skill every time, it is likely that only some skills contain the formula part that can become zero - you need to really check which skills are used and get their specific formulae instead of the general idea you gave here. It can for example be a typo or a wrong number of negative multiplicators or a few other things.

Second - you have to keep in mind that a.atk is NOT the actor attack value, it's the actor attack base value plus equipment plus state effects plus any modifications done with event commands.
And those modifications CAN be negative, reducing the total to zero.
The engine should have some ssafeguards to prevent it from getting to zero, but with plugins and the specific formulae I would not guarantee this.
 

Latest Threads

Latest Posts

Latest Profile Posts

Feel free to check out our "Touch the Stars" gamejam submission, "Starlight, Starbright!"
just finished playing one shot. im kinda disappointed with return the sun ending ngl. i was hoping there would be some after credits scene that would play with my emotions
So apparently the surprise Google Search page browser game saves your progress when you close the browser.

This really makes me miss the golden age of Flash gaming.
ohh man im ending oneshot now (im doing the last stepping puzzle rn) and the music is so...sad...like...ive been thinking recently about how fast moments pass and...my anxious thoughts combined with that music and nostalgia...like...im comfortably sad...and want to cry internally
We're playing one of the Touch the Stars game jam entries, come join us!

Forum statistics

Threads
113,552
Messages
1,075,790
Members
147,551
Latest member
ananansy
Top