How many conditionals in one common is too many?

I have one common event watching variables for life, mana, energy and such.
Example, if variable HP = 0 then die, If mana = 0 then speed 3.

I tested a bit with 15 - 20 conditional branches with some of them nested in else. The rest of the conditionals are stacked beneath.

Well I have no evidence of this but when I tested it, it was like the common event skipped some of the conditionals if too many checks in the same parallel common event.
Is there any reason for this, if we pretend I have done everything by the book?

Would be nice if anyone know of a guide of any kind showing how to use them the "right" way or a smarter way, and also how to avoid lag and such. I know of the rmmv helpfile not asking for that. 🙂
Well I have no evidence of this but when I tested it, it was like the common event skipped some of the conditionals if too many checks in the same parallel common event.
you can't have any evidence of this because it can never happen - the computer can't skip commands that way.

It has to be something else that happens, most likely due to a logic error somewhere

But we can't solve your problem for you without seeing what you did wrong...
Okay, thank you for clearing that up 🙂 I have no specific case I need help with right now, I just needed to know if anyone had experienced the same or if someone have found a smarter way to use them than usual. Example, some people say its better to nest all conditionals into "one" but I prefer to have them one by one. Does this has anything to say in performance?

Question 2: So I can literally run every (conditional branch running while on map to check variable hp etc.) in the same parallel common event?

Is it better, worse or the same to have:
Parallel processes: 5 common events with 5 branches each, or run 25 branches from the same common event?
(timing is not important in this particular case)
parallel processes are causing lag, so there are differences in how they are used.

if possible for a specific check, then you should disable the else branch of it.

there is no general answer to the question of nested or not (and anyone who claims otherwise hasn't really understood what that is about) because both variants have different advantages compared to each other.

A nested branch will not be checked if the top condition is not fulfilled. that has a lot of effects that may or may not help. If it is not checked it does not add to lag, but it also means that it is not checked - the logic errors mentioned above are often cases where abranch should have been checked but wasn't due to such wrong nesting.

Another question is how often does the above condition go wrong? If a branch is true 49 of 50 cases, then it might be better to have something not nested below - nesting does add its own sequence to lag, and if it hasn't an effect then it might be better to have everything on the main level one after another.

As for your second question: It depends
Usually it's better to have everything in one single parallel.
However, that depends on how much waits the checks should have - if one thing needs to be checked often (few waits) and another needs rarely checked (large waits) then it's better to have two different parallel processes for them. Things that are checked with a similiar frequency should be combined into single PPs.
Thank you so much for that very good answer! Really appreciate this!
a work around complex nested conditionals is to make separate conditionals that add specific values to a variable.
if you base the operation on binary, you can add 1, 2, 4, 8, 16, etc to a variable and the result would give a very specific number, which you can check for.
if you have 4 variables to look for, and all of them check out, the total is 15, because 2^4 is 16 and you always take one less (because, the count starts from 0, not 1!)
if one of them fails to check, the result will never exceed 14..... if it's not important which specific condition was triggered and you only care for some, all, or none, or particular combinations, then use the count method.
if you want a very specific set of conditions, say, 1st, 2nd and 3rd, but not 4th, check for the binary equivalent: 1 + 2 + 4 = 7.
if the check returns 7, there's no way that the program will ever validate the 4th condition, because there's no way to get 7 out of the set that is not 1 + 2 + 4, because there is no 5 + 2, or 6 + 1..... 6 always implies 4 + 2, and 5 always implies 4 + 1.


this approach is how map tiles hold their Z layering, passabilty conditions, counter flags, etc: it's one number comprised of binary inputs that only ever fluctuates between 0 and 8192.
there is no nested conditional to check for all the variants: the program just checks for that number being equal to a certain figure, across different processes.... each process doesn't care about the number being equal to anything else other than the input they're meant to check for.

Original thread: https://forums.rpgmakerweb.com/threads/how-many-conditionals-in-one-common-is-too-many.117218/