Question about a very complex and heavy parallel event

Hi folks,

I have a question about a very complicated parallel event that I plan to have running in a certain part of my game. The question: Is it a good idea to have a parallel event running which contains a series of 64 different conditional branches, each of which controls at least 4 different switches?

This complex event came about as the solution to a problem I faced in the game I'm making, where the player can recruit one of 64 different "npcs" and bring them back to his space ship to operate one of its systems. Since the event editor window has a maximum of 20 pages, I can't fit all 64 possible "npcs" into a single event, which would then show the chosen NPC based on the corresponding activated switch.

My solution to this was to make a "blank" event (EV005) and to have a different event run in parallel, with the aforementioned 64 different conditional branches inside it. The 64 different conditional branches are the ones that change the image of EV005 to look like, react, and give dialogue responses as if it were each of the 64 different "npcs" that the player recruits.

I've already built out the first instance of this, and it works perfectly. But I don't know if it's going to start lagging or bogging down after I put all 64 characters into that system, and I don't want to spend the considerable amount of time it takes to add each "npc" to it, only to discover later that a different method for the entire system should be used.

Does anybody have any advice about this? Has anyone had previous experience with stuffing a single parallel event with so many conditional branches?

Thanks for any help.
Why does it need to be parallel? Have an autostart event on each applicable map that calls the appearance-setting common event then erases itself, and have a separate one for the dialogue responses which is called when you interact with the event.
I'd just run an event as you ever each map, and have one event, that I change the image for. I'd use a variable for the active NPC, instead of so many switches.
Good question! I should explain a little more about the way this "npc"/event works in my game.

The "npc" only appears on one map inside the space ship, and doesn't go anywhere after that. The "npc" is operating a space junk collecting station that used to be operated manually by the player, so the "npc" needs to be interacted with sporadically and intermittently. I think that if I chose an autorun instead of a parallel event, then the player wouldn't be able to move or interact with the "npc" at all, and if I then had the event delete itself, then my entire system of having the "npc" interactable wouldn't work.

Allow me to explain that particular part. When I first made the parallel event that used a conditional branch to define the character image and dialogue of EV005, I had the major problem that when the player talked to EV005, it didn't turn to face the player. This looked awkward, and I made a (typically for me) complex solution of three different "below character" events surrounding EV005. These three other events check which direction the player is facing, and then activate different switches which the single parallel event checks for to change the image of EV005 to make it look like the "npc" is facing the player.

Like I mentioned before, it's all rather complicated, but it works perfectly. I had another idea for allowing each of the 64 different possible "npcs" to appear more like the editor is intended to do it, which would involve making about 8 copies of that particular map, and then moving the player into the correct one depending on which "npc" he has recruited. In that case, "npc" appearance would be defined very simply the way any event's appearance is defined, and I wouldn't run out of pages in the event editor. But I am worried about running out of maps in this game. 999 possible maps seems like a lot, but this is a huge game I'm making.
Good question! I should explain a little more about the way this "npc"/event works in my game.

The "npc" only appears on one map inside the space ship, and doesn't go anywhere after that. The "npc" is operating a space junk collecting station that used to be operated manually by the player, so the "npc" needs to be interacted with sporadically and intermittently. I think that if I chose an autorun instead of a parallel event, then the player wouldn't be able to move or interact with the "npc" at all, and if I then had the event delete itself, then my entire system of having the "npc" interactable wouldn't work.

Allow me to explain that particular part. When I first made the parallel event that used a conditional branch to define the character image and dialogue of EV005, I had the major problem that when the player talked to EV005, it didn't turn to face the player. This looked awkward, and I made a (typically for me) complex solution of three different "below character" events surrounding EV005. These three other events check which direction the player is facing, and then activate different switches which the single parallel event checks for to change the image of EV005 to make it look like the "npc" is facing the player.

Like I mentioned before, it's all rather complicated, but it works perfectly. I had another idea for allowing each of the 64 different possible "npcs" to appear more like the editor is intended to do it, which would involve making about 8 copies of that particular map, and then moving the player into the correct one depending on which "npc" he has recruited. In that case, "npc" appearance would be defined very simply the way any event's appearance is defined, and I wouldn't run out of pages in the event editor. But I am worried about running out of maps in this game. 999 possible maps seems like a lot, but this is a huge game I'm making.
I think your understanding of events is potentially a bit skewed. There's no reason the appearance part and the interaction part need to be the same event.

Basically, you have your autostart event on the map which calls a common event that has a "change image" command for each possible identity of your NPC, which will set the event's graphic accordingly. Erasing the event afterwards won't affect the event appearance, as it's already been changed.

Then you have a common event that just has the interaction branches in it, and call that from event 5. That way, when you interact with it, it'll branch accordingly. You don't need to do anything with facing the player, because the event will already do that in its ordinary interaction processing.

If your event isn't turning to face the player at all, then you have a problem outside of this system that isn't going to be fixed by a parallel event.
Since the event editor window has a maximum of 20 pages, I can't fit all 64 possible "npcs" into a single event, which would then show the chosen NPC based on the corresponding activated switch.
While that would work, it is rather complex for what you want.
here is a different take that would get the same result without any switches or similar:

make three or four different events (depending on the total number of possible actors)
on each of the event's twenty pages, check the "actor" condition for a different actor.
it is extremely impüortant that is no event page without an actor condition and no actor has been selected twice.

If no page is selected, then the event doesn't exist. So depending on which actor is chosen, only one of the three or four events will be displayed.
So the four events would be on different positions, but you can cover that by making the station larger, or by moving the event depending on which actor is in party with a different event.

I think that if I chose an autorun instead of a parallel event, then the player wouldn't be able to move or interact with the "npc" at all, and if I then had the event delete itself,
no, you misunderstood that the autorun is NOT the NPC event itself - it would only remotely change the NPC event and then erase itself while the NPC event stays to be interacted with.
Of course, if you know where to look, there are workarounds for every problem... 😉
1751474436310.png
Thanks for your help and advice, everyone.

I think your understanding of events is potentially a bit skewed. There's no reason the appearance part and the interaction part need to be the same event.

Basically, you have your autostart event on the map which calls a common event that has a "change image" command for each possible identity of your NPC, which will set the event's graphic accordingly. Erasing the event afterwards won't affect the event appearance, as it's already been changed.

Then you have a common event that just has the interaction branches in it, and call that from event 5. That way, when you interact with it, it'll branch accordingly. You don't need to do anything with facing the player, because the event will already do that in its ordinary interaction processing.

If your event isn't turning to face the player at all, then you have a problem outside of this system that isn't going to be fixed by a parallel event.

This was actually the first thing I tried. The problem with this method is that as soon as the player leaves and comes back, the "npc" is invisible and can't be interacted with. That's why I chose to make my system of a very heavy parallel event.

In any case, I'm not asking how to accomplish this. I already have it working perfectly, and I know how to make an alternate method using duplicate maps if I need to. (This part of the space ship is very small, as space junk collectors aren't known for having big space ships, ha ha.)

What I'm asking is will this single parallel event become slow or laggy?

I think I'm going to just go ahead and build it out with all 64 recruit able characters, and I'll report back in this thread in a week or so when I'm done. I have a feeling that it will be fine, since I already have a few regular events that sort through up to 48 different conditional branches, some of which are nested.
Thanks for your help and advice, everyone.



This was actually the first thing I tried. The problem with this method is that as soon as the player leaves and comes back, the "npc" is invisible and can't be interacted with. That's why I chose to make my system of a very heavy parallel event.

In any case, I'm not asking how to accomplish this. I already have it working perfectly, and I know how to make an alternate method using duplicate maps if I need to. (This part of the space ship is very small, as space junk collectors aren't known for having big space ships, ha ha.)

What I'm asking is will this single parallel event become slow or laggy?

I think I'm going to just go ahead and build it out with all 64 recruit able characters, and I'll report back in this thread in a week or so when I'm done. I have a feeling that it will be fine, since I already have a few regular events that sort through up to 48 different conditional branches, some of which are nested.
That shouldn't be the case. Erase event is a temporary state and the event will be there again if you leave the map and return.

The change image command, if I remember correctly, doesn't have too much overhead when it's processing parameters that already reflect the settings on the event, so theoretically this shouldn't cause much if any lag, but there's no way to know for sure unless you actually try it. One thing to keep in mind that's generally applicable to 90% of parallel events is that it may need a 1-frame wait at the end to prevent frame skip.

And I know you're not asking how to accomplish this, but I'd feel remiss if I saw a potentially better way to do something that would be less painful for you and didn't suggest it.
Thanks for your help and advice, everyone.



This was actually the first thing I tried. The problem with this method is that as soon as the player leaves and comes back, the "npc" is invisible and can't be interacted with. That's why I chose to make my system of a very heavy parallel event.

That's too much solution for this problem. You don't even need a separate event, you can just change the event graphic as you enter the map. Whatever event transports the party to the ship can test this.
Like I said I would, I'm now reporting back after finishing this quixotic and strange parallel event that I've made, the one with 64 successive conditional branches stuffed into it, and with 4 different switches inside each one.

My original question was:

Is it a good idea to have a parallel event running which contains a series of 64 different conditional branches, each of which controls at least 4 different switches?

The answer is yes and no. As far as lag or slowdown is concerned, there is no perceptible lag or slowdown at all while playing through my game at this point while this parallel event is functioning. It all works perfectly as I had intended. The player won't see anything different about talking to this NPC, and won't notice any slowdown at all.

However, there was a noticeable and increasing amount of lag while I was opening up the event and working on it to add more conditional branches to it, right up until I added the 64th and final one. Opening up the event to edit now takes almost a full second. My PC is a mid-range gaming PC from 10 years ago, to get some idea on specs.

The editing of this event and of other events that interact with it became increasingly precarious and unwieldy as I built it out and added more to them. Bug fixing and tracing down errors also became a real chore. So my advice for anyone looking to add some ludicrous number of possible NPCs like 64 to a single event is don't do it. There are only 20 pages in the event editor, so I would call that a hard limit.
However, there was a noticeable and increasing amount of lag while I was opening up the event and working on it to add more conditional branches to it, right up until I added the 64th and final one.
Sometimes depending on your needs and how you set up your conditions and variables, you may be able to use an object literal to directly assign the values.

If you can show examples of what you have for a small set of conditions (like 4-6 or even a screenshot or two), there might be able a way to refactor it into a script call.

On the other side, if it is working fine and the issue is just the editor, I wouldn't change it, especially if you understand the workflow and can make your own changes.

Original thread: https://forums.rpgmakerweb.com/threads/question-about-a-very-complex-and-heavy-parallel-event.178681/