Hi, I've recently discovered that there is a limit on common events in RPGM MV and it's like 1000.
And this fact scared me a little because I'm working on a fairly long-term project and am used to group my variables and switches into groups by hundreds, so now I already have reserved space for 2,000 variables and as many switches. But as for common events, I need to limit myself somehow.
Let's say I had a common event with a certain set of actions for each enemy. But now I'm going to replace that system and make just one event that, when triggered, will activate an infernal machine that will take certain actions based on the switch corresponding to the enemy.
So here's the question.
Theoretically. Just theoretically. 10,000 lines of code, and, for example, 500 consecutive "if conditions" in one common event. Will the player system slow down or maybe just die during such common event, or it's completely okay and the system will be able to go through all 500 conditions in half of a second?
In theory the limit of common events is far greater than 1,000. In fact, this is just a limit imposed by the editor.
You may:
- Migrate the project to MZ (editor's limit is 2,000);
- Use MZ to create common events for your game, but continue with the MV.
Though I'm sure there are easier and more efficient ways to do this than using a gigantic 10,000+ line event. You can try this, but I wouldn't worry about optimization until I'm even sure I need to optimize something.
you can reduce nested conditional branch, but so far I know,
an event or common event could have a max lines of 1000.
if you have more, everything beyond this will be gone when you re-open it.
same thing if with a 256x256 map, you can bypass it, but once you open
the map properties, everything beyond 256x256 will be lost.
so 1 massive common event wont work.
if you want a massive common event to run or check over 400 events to that
to see which one is valid is probably harder to track.
I don't think performance will be a problem. The real problem lies in maintainability.
If you realize you have a bug, scrolling down 10000 lines of code trying to find the right conditional branch is going to be more painful than scrolling down a list of 500 named common events.
in your question, the correct answer would probably be "a dozen" because both the 1000 events and the one mega-event have their own problems.
Common events should be combined if they are functionally similar because that helps a lot. making everything its own common event will go wrong sooner or later, and combining everything that doesn't fit together will just cause a big headache.
And to get to that point where you make the correct event structures you'll need experience in eventing - experience that you obviously don't have yet if you consider using hundreds of switches and variables before even starting. Because even big professional RM-Games rarely get to half the maximums of everything in the engine.
That said, even your starting description of your plans tells me that it is very unlikely that you'll ever complete that game. That is simply experience and the hundreds of abandoned project ruins around the internet.
Planning big is easy - extremely easy.
completing even a tiny one-hour game is extremely difficult however.
That is one of many reasons why I suggest in my "starting point" tutorial to never start with your dream game, but always make your first project a scrap idea where it won't bother you to discard it after learning the basics.
Another tip: for an experienced game developer the ratio of playtime to development time is around 100.
Which means that to create a game that has one hour of playtime the developer will have to work 100 hours on average - and that is for experienced people, it does not include the time to learn what you're doing.
Please keep this in mind when revisiting how big your game should be.
The other option is to rewrite some of your events in JavaScript and outsource them into a plugin. Then, rather than calling Common Event X, you'll use a script box to call your function.
But, seriously, do you actually have that many events that are "common"? None of them are map-specific? Or just used on a few maps, so you can copy and paste them into events placed on those maps?
Like, for the half a dozen or so hours long my game is right now, I have all of 10 common events. I can't fathom what you'd do with all of those 😛
I would be looking for ways to group them into single blocks and use script calls for slight differences, rather than one block for each of your 1,000 options.
Well thanks, everyone. I think the right answer is to find the right balance between few overloaded common events and too many unnecessary events. But it's not the easiest thing to do either, I'll have to give it some serious thought before deciding what event I need to group and what better don't.