1000 common events vs one absolute universal mega-common event

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.
How do you use these common events?
Common Event is best used to storing game functions you often use.
Avoid storing game content you only use once.

To save common event slot, you can categorize similar CE into one then make use of the conditional branch.
1630689203832.png


To save eventing lines, I couldn't give better advice than just be more efficient and conservative in designing your events.

This reminds me of the old days when I still learning by dissecting other RM games.
Their common event looks like a huge mess.
It can be waaay more efficient if they planned and design it better.
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.
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 😛
This may seem like a silly question, but in order to write an event in a plugin do you need a strong knowledge of javascript?
It's just that I've decided to seriously reduce my number of common events, but that will cause one of my scary mechanism to not working. Basically, it's an event that randomly plays a bunch of other common events. And the events themselves are not small in size too. But if I remove all of them, in the case of my machine, there would really be 10,000 lines of code in one event.
So, is it even difficult to write a plugin that will play a lot of events?
This may seem like a silly question, but in order to write an event in a plugin do you need a strong knowledge of javascript?
It really, really depends on what the event is doing. You absolutely need to know the basic syntax; if you have that, you can find a stickied forum post here that lists all of the JavaScript functions equivalent to the various event command buttons.

Because the event editor is designed to be simple and user-friendly, many things you'd do in the event editor are actually more efficient and compact when written in code; but some things (like text windows) are more complex.

Original thread: https://forums.rpgmakerweb.com/threads/1000-common-events-vs-one-absolute-universal-mega-common-event.140133/