Weird lag is MV when a couple things happen at once.

Rawbzilla

Villager
Member
Joined
Nov 18, 2016
Messages
6
Reaction score
1
First Language
English
Primarily Uses
Hello there,

Currently I am working on an RPG Maker MV game that in the part I am doing involves a bit of stealth.

So I got the plugin Yanfly's Event Chase Player, set them up to combat the player when the get to them, which has been working fine! I also have a series of switches/event pages set up so you can put on a disguise and most of the npcs are now talkable and won't chase you down which leads me to the issue.

If while you are trying to talk to an NPC, or any text box shows up for any reason, if there was a guy chasing you trying to initiate combat it'll start to lag really badly until the text box is gone and the battle commences.

All the workarounds I could think of for this problem broke immersion/realism for me so I was hoping there might be someone else who experienced this issue. There are a lot of parallel events on the same page, if that makes a difference. Hope someone out there has some insight.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
[move]MV Support[/move] Tech Support is for getting the editors to run.

To reduce lag, you first need to identify where that lag comes from. From your description it's either too many parallel processes, a single badly desinged parallel process, or some conflicts in the way you set everything up.
Please show us screenshots of your events, then we can tell you what might cause this, and only after that you can look for a real solution.
Searching workarounds without knowing the cause will almost never work - please follow the link "bughunting" in my signature to learn more about this.
 

Rawbzilla

Villager
Member
Joined
Nov 18, 2016
Messages
6
Reaction score
1
First Language
English
Primarily Uses
Here are some screenshots.
Event1.jpg
Image 1: This first image shows the page which starts the battle, adds to a variable that is irrelevant until it gets to a certain number, and the self switch A here switches it to looking like a corpse when beaten in battle.



Event5.jpg
Image 2: I added this one next to show that this is the Self Switch A page.



LadyStuff2.jpg
Image 3: This is the movement route (not the whole thing, but the rest is irrelevant), it shows what scripts from the plugin Yanfly's Event Chase Player I'm using.



Event2.jpg

Images 4 & 5: Both of these are essentially the same, you have the option in this map to put on a 'disguise' which is shown in the next couple images, these two pages move the various Events made out to be NPCs to their home positions so their movement routes don't get messed up by the disguise event.

Event3.jpg



Event4.jpg
Image 6: This image shows the page where you can actually converse, the section break area is for a game feature for another plugin that is irrelevant to this problem as well.



Event6.jpg
Image 7: This is a different event, this clothesline that leads to you becoming disguised on the map. As you can see, it has Stealth Prep to reset the other events to their homes, and Stealth and Actor Image changes make you able to converse with a majority of the characters on the map.



Event7.jpg
Image 8: After you take the clothes, the clothesline is empty, and that's all this is for.



So again, to describe the issue: Most of the events on this page are just copy-pastes of the first events' 5 pages, with dialogue changes and slightly different move routes and images. Some of the events on the map are the same as these, but are missing the 'Stealth Page' (See Image 6), so they basically 'see through your disguise'. And this is the only time the problem sets in. I can converse fine but if I am in the process of being chased (Again, see Yanfly's Event Chase Player Plugin and the Move Route I set here) the event chasing me will continuously walk into me until I clear all dialogue boxes. Combat will initiate after that, but until the dialogue boxes are cleared, there is heavy lag which makes it -very hard- to clear the dialogue boxes at all. Hopefully someone else has some experience with this particular plugin. It seems mostly that the event chasing me is trying to initiate combat over and over and over again but is unable, and when it finally can the lag stops because it stopped trying to send the process so many times, but if someone has a better idea I'd love to hear it.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
you have a problem due to your use of parallel processes.

A parallel process, unless switched off, always loops and is executed sixty times per second.
So your village lady, if the stealth prep switch is on and her second event page is active, gets transported to the home position not once, but sixty times in every second. That creates a lot of lag.
Page 5 of the same event is even worse - an empty event page should always be set to action button, never to a parallel process, because even if there is no command, that event will get processed sixty times per second for all eternity on that map after the lady is defeated.

and so on - you get lag because you're using parallel processes excessively and where they are absolutely useless - you should try to use as few parallels as possible in such cases.
For example (and especially if you have multiple NPC-events like that) setting the event positions in special situation should be done by an independent event that sets all event positions once and then disables itself again, not have each event on the map its own parallel for changing position.
 

Rawbzilla

Villager
Member
Joined
Nov 18, 2016
Messages
6
Reaction score
1
First Language
English
Primarily Uses
While I appreciate your response you didn't actually address the issue here. While I'm sure I can make those particular parallel processes into better things, I still need to determine how to end the lag in this 1 situation. The map does not lag despite parallel processes unless the very specific situation I mentioned occurs: Something that is chasing touches the player while the player is in a dialogue. If you know anything about this please respond.

And for the record, if the solution is just not to use a ton of parallel processes? Then that is what a work around is.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
The problem here is that lag is cumulative, and any computer has only a limited reserve for extra calculations before lag becomes detectable.
So if you get lag, it means that that reserve has been exhausted due to too much processing.

However, you can't always prevent that need for excess calculations, so the only real method against lag is to remove it whereever you can, in order to free that reserve against the few times where you can't simply remove the parallel processes.

As for removing parallel processes, that depends too much of the specific situation, because there is no "catch-all" for replacing parallel processes. Which is another reason to remove them where you can, because you can't remove them everywhere.

In your example I simply don't know enough about the other events on your map to point you to possibilities, but one thing is obvious:

Instead of having the set event location on parallel process on the event itself, use that command on the place where you switch ON the switch 45 that activates that page, and keep that page on action button.

If doing all that does not free the calculation power to prevent the lag from becoming detectable in that specific situation, that means there are still other processes draining your computer's power, and you need to find them to solve the problem - I would probably check for parallel processes on common events next, you should not use more than two or three common event parallels at any given time.
 

Ungragu

Villager
Member
Joined
Dec 12, 2017
Messages
17
Reaction score
1
First Language
English
Primarily Uses
N/A
Yeah, but what if your thing REQUIRES all those parallel events?
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
Yeah, but what if your thing REQUIRES all those parallel events?

Try something. Add a Wait(20) Event command on ALL Event Pages, on ALL the Parallel Events.Tell us if case is solved. And as @Andar pointed to OP, you should try not overdoing it with the Parallel Events.

A stealth system can be designed to run using only one or two well written Events in Parallel, involving Common Event calls and manipulating other Events (NPCs) by the aid of Event Commands or a plugin. No matter what, this is even more complex and hard to design, so as a first step, I suggest you try this.

Wait(20) makes the Parallel Event to wait 20 of the 60 frames per second. Thus one third of the second the event will be idle. This helps out making the event run almost one third less times than without the command. If events in parallel still exist, then it will still be hard and it won't be a panacea, but you can try to see if it works just for this incident. @Andar avoided to mention that, to keep you on the right track. If your thing REQUIRES a LOT parallel events, you have to redesign it more lightweight, needing less. ;)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
Yeah, but what if your thing REQUIRES all those parallel events?
Then you've made some bad design decisions in your events.
Even complex systems and projects should not require more than half a dozen parallels at the same time - most usual game projects should be do able with a maximum of two or three constantly running parallel processes, if they need any at all.

You can have several parallel processes as long as they're independent of each other - the timing problems mostly happen if those parallel processes interaction with each other.
But that also requires you to think about how those parallels work instead of just spamming them everywhere.

And if you do think about it most of the time the number of parallele can be drastically reduced.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If you're talking about the villagelady1 event, there's no need at all for tab 3 to be on parallel process all the time. You move an event once, and you turn off a switch once. In fact, that page is never going to be executed, because if that switch is on, page 4 is always going to be active. Same with page 2 and page 5.

Why is page 2 of event 335 set to parallel process? Nothing happens on it, but it still requires CPU to process "nothing".
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,045
Members
137,569
Latest member
Shtelsky
Top