Parallel Processing = game lag?

Status
Not open for further replies.

McTricky

Veteran
Veteran
Joined
Jul 10, 2012
Messages
790
Reaction score
386
First Language
English
Question: Does parallel processed events affect whether or not the game lags. To make my Skit system work, I've utilized a switch and a variable (as the Skit identifer), which all runs through a common event that's only activated when the aformentioned switch is on. The trigger is set as Parallel Process because I want to player to be able to press a button to activate the current Skit scene (like in Tales of games). It all functions somewhat okay so far.

Screenshot

Now the thing is, ever since I managed implented this, I've noticed that my larger maps (like 30x30 and up) has a bit of lag to them, and I'm wondering if it's because of the fact that this Parallel Processed Common Event is virtually ALWAYS on? The lag even appears in my large yet unpopulated maps.

If it's not the Parallel Process (or the only thing) that might cause lag on larger maps, any idea what else could be the issue? Thanks.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yes, parallel process events WILL cause the game to lag. Add a Wait for a few frames in there, in the inner loop, and see if it relieves it a bit (lets the parallel process come up for air, and gives everything else a look-in at the processor).
 

McTricky

Veteran
Veteran
Joined
Jul 10, 2012
Messages
790
Reaction score
386
First Language
English
Thanks for clearing that up, Shaz. The larger maps run a little more smoother now. I added a Wait time of 180 frames just after the variable operation.

Another question before I declare this resolved. I have (and most likely WILL do) multiple common events (3 so far) that all run by Parallel Process when the switch is on (which it is most of the time). So can I assume that the more of these Common Events for each and every skit the worse the game will lag?
 

Link

Hero of Slime
Veteran
Joined
Mar 13, 2012
Messages
227
Reaction score
11
First Language
English/Engrish
Primarily Uses
Yes, the more of any type of event will cause more lag.
 

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,452
First Language
Portuguese
Primarily Uses
In fact a few parallel process will not cause lag alone, unless it's a very resource use event.

So only heave process events or a lot of parallel process will cause lag, in any case, the solution shaz sugested works, add wait times so there's a small interval between the events.

The longer the event, the more likely to cause lag, since most events are processed at a single frame, unless it's a event that requires graphic update (like display messages)
 

McTricky

Veteran
Veteran
Joined
Jul 10, 2012
Messages
790
Reaction score
386
First Language
English
Right, understood. I might have to re-think how I'm going to implement this feature...

In any case, thanks again for clearing that up, you guys!
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
I suggest to not use any wait commands when you are relying on a button input from the player. This will cause lag and errors, and sometimes it won't even work when the player presses the button.

For other parallel processing events that don't require to be up-to-date constantly, you can use a wait command of 1 frame. Exit event processing also helps if it's a long event.

But the one you have right now shouldn't lag at all. You really only start to notice lag if you have a lot of parallel processes running at the same time (say, around 6 of them). It also depends on how many commands you have inside of the event.
 
Last edited by a moderator:

McTricky

Veteran
Veteran
Joined
Jul 10, 2012
Messages
790
Reaction score
386
First Language
English
This will cause lag and errors, and sometimes it won't even work when the player presses the button.
Putting the Wait command in the conditional branch right after the event caused it to be inoperable for 3 seconds before the play can reactivate again. Having it not work sometimes would probably only be the case if the wait command was outside the Conditional Branch.

But the one you have right now shouldn't lag at all. Your really only start to notice lag if you have a lot of parallel processes running at the same time (say, around 6 of them). It also depends on how many commands you have inside of the event.
Well, I think I found a way to avoid the use of multiple Common Events, with the use of Yanfly's Button Common Events script. I just use one Parallel Proccessed Common Event to run all the skit scenes (non-parallelled events) by using multiple conditional branches in that event.

So far it works a treat.

So far... xD
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Putting the Wait command in the conditional branch right after the event caused it to be inoperable for 3 seconds before the play can reactivate again. Having it not work sometimes would probably only be the case if the wait command was outside the Conditional Branch.
It's just the wait command itself that causes the slight lag in which the player may have pressed the button, and it didn't register that because it was 'waiting' at that exact moment. 1 frame might not seem like much, but if you press the button several times in a row, you'll see that it'll fail to register quite a lot of times. Anyway, the point is, you don't really want to add wait commands when button inputs are being used.

Well, I think I found a way to avoid the use of multiple Common Events, with the use of Yanfly's Button Common Events script. I just use one Parallel Proccessed Common Event to run all the skit scenes (non-parallelled events) by using multiple conditional branches in that event.
That's one way to do it, scripting is a better alternative in this case :D

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Last edited by a moderator:
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top