How many variables is too much?

Is there a recommended limit to not exceed with the number of variables (and let's include switches as well) in your game? I've once read a user comment on someone else's game having 100+ variables as inefficient. I've been trying to be efficient with the number I use, but should I really try?

30 variables vs 300 variables for example. Would there be any difference in performance?

EDIT: Bonus question. Say I create 200 variables, but variables 100-130 are unused... can there be any impact on performance? Are those empty slots taking up any memory?
In my current project there are 500 variables. There really shouldn't be limits to these sorts of things. Having a lot of variables won't harm anything, and if there's any impact on performance...well, there just won't be really.

It all has to do with what you want to do with your game. Use as many as you see fit.
Is there a recommended limit to not exceed with the number of variables (and let's include switches as well) in your game?

No.

I've once read a user comment on someone else's game having 100+ variables as inefficient. I've been trying to be efficient with the number I use, but should I really try?

No.  In fact, trying to re-use variables in order to "conserve" them is really risky, because you might have two different events trying to work with them at the same time, or you may fail to reset them properly.

30 variables vs 300 variables for example. Would there be any difference in performance?

No difference in performance whatsoever.

EDIT: Bonus question. Say I create 200 variables, but variables 100-130 are unused... can there be any impact on performance? Are those empty slots taking up any memory?

No difference in performance whatsoever.
   I mean, obviously you want to do things as efficiently as you can, but in this case efficiency is fairly subjective. For instance, say you use variables to create a custom encounter system or some such, where different events draw a random number as a variable and match it with a troop found on that map. Since only one of these instances will ever play out at once it would be silly to add a new variable to every new area/troops pool when you could just start each event by disposing of any previous data and continue to use a single variable for that function. On the other hand, say you have a camp/home base/fortress system in play and you want your party members to chat with you at said base and you use variables to progress those conversations, obviously each party member needs to have their own variable only controlled while advancing that characters conversations, far to easy to make mistakes and break things otherwise.


   Short answer- The question is too subjective to answer as is, and depends on what you are using said variables for. You can use 500 variables efficiently to the point you need every single one, but you could also use 5 variables very inefficiently and run into problems because of it, it's impossible to tell you which without knowing exactly what you are using them for and how you are using them.


   Generally speaking though you aren't going to lose performance by just declaring extra variables, so having a few redundant variables is probably a better alternative to accidentally using the same variable in two events that could be triggered at the same time as that's more where you're likely to run into problems.
Thank you everyone for the answers <3
The problem i faced when i make a lot of variables is when you want save it will take longer time, more variables you have longer time to save 
IT DOESNT MATTER GUYS WHO CARES ABOUT SAVE TIME USE AS MANY VARIABLES AS NEEDED

Original thread: https://forums.rpgmakerweb.com/threads/how-many-variables-is-too-much.67912/