Help pls. - Parallel Process lag

Hello my friends.

I tried to creat an event where the BGM changes when I enter a certain area on the same map.

I did it before on another map and it worked perfectly!

I did it again and it startet do lag, my character is moving very slow suddenly and the music doesn't change at all..

=( pls help me!

Thanks!

Spoiler
e703y5p.jpg
Do you have a wait command in the parallel process? If not it is trying to change it 60 times a second, which will lag the game in most cases.
Do you have a wait command in the parallel process? If not it is trying to change it 60 times a second, which will lag the game in most cases.

Hi!

No.. where do I put the wait command?

PS: I tried to put a wait command into the process, but now the music lags instead of the movement.. ^^"

PPS: THANKS for helping! =)
Put it outside the conditional branch; it works fine either as the first or last line
Put it outside the conditional branch; it works fine either as the first or last line

I did.. but I suppose wrong..

I put a "wait" (60frames) command in it..
But the music lags now.. ;(

PS: Thanks for help!
Can we have a screenshot of what the event looks like now.
The music will never be instant. You'll have to choose between instant music or lag on the map. This is because nothing can run 60x a second without causing lag.

However, you might find wait(6) is good enough. It's still 10x a second checking, but it should keep lag down.
don't do parallel process unless you need to control something going way too fast to be caught.
once you've entered the area in question, you no longer need to check for it.
make it so that something disables the parallel event when you don't need it.
The music will never be instant. You'll have to choose between instant music or lag on the map. This is because nothing can run 60x a second without causing lag.

However, you might find wait(6) is good enough. It's still 10x a second checking, but it should keep lag down.

Hi.

I put a screenshot in spoiler at the top. =)
Hi.

I put a screenshot in spoiler at the top. =)

We need to see what it looks like AFTER you added the wait command. ^_^

Also, do you have any other parallel processes running on this map?
We need to see what it looks like AFTER you added the wait command. ^_^

Also, do you have any other parallel processes running on this map?

Hey. =)

I don't have any other parallel scripts on this map.

But I did the same thing on another map without a wait and not the music nor the movement started to leg.. 🙁
Only on this, much smaller map..

How do I show that? I can't do GIFs.. ^^" And you don't see anything from a screenshot, aren't you?
Sorry, I am a super Noob. xD
He meant the same Screenshot as you did in your first post, only updated so that we can see where you placed the wait command and how it looks now.

For parallel processes to work correctly, the placement and the timing of the wait are extremely important, and we haven't seen yet how you did that.
He meant the same Screenshot as you did in your first post, only updated so that we can see where you placed the wait command and how it looks now.

For parallel processes to work correctly, the placement and the timing of the wait are extremely important, and we haven't seen yet how you did that.

Oh! Okay.

Here is the screenshot.
Spoiler
54eo80C.jpg
That actually looks good to me. Are you sure that the "lag" you're experiencing isn't from your 2 second fadeout? The 60 frame wait should also add up to a one second delay, but that shouldn't be TOO bad. As bgillisp mentioned, you could reduce the wait time to as little as 6 frames. If you experiment with changing the wait time, maybe you will find a sweet spot where it doesn't lag and plays the music fairly soon.
That actually looks good to me. Are you sure that the "lag" you're experiencing isn't from your 2 second fadeout? The 60 frame wait should also add up to a one second delay, but that shouldn't be TOO bad. As bgillisp mentioned, you could reduce the wait time to as little as 6 frames. If you experiment with changing the wait time, maybe you will find a sweet spot where it doesn't lag and plays the music fairly soon.

How about this?

Spoiler
HTegXpt.jpg

I did that in another map, where it perfectly worked..
Here my example:
Spoiler
a7kPBjq.jpg

I have a question for the second one too..
Is it possible to show a text from the same command, which tells the player the name of the area?
When I use the insert text command, it repeats over and over..
You only need the BGM to play ONCE, when you enter the map. Put an Erase Event at the very end (of your original parallel process) so that it DOES only play once. Otherwise, it's going to run those commands every single frame. Also, if the music doesn't change at all, I'd suspect something else is the problem - is that switch on? What's on page 1 of that event?

You should Erase Event as the last command on every single parallel process event you add whose purpose is to "set up" the map when you first enter.
Assuming the player doesn't enter the map on region 2...
babas_music.PNG
The parallel process is still going to continue to loop on every frame and do the conditional branch checks, so it will still cause lag.
I changend the enterpoint on region 2 which made it a little bit better.

But only if I change the BGS and not additionally the BGM... 🙁

The problem is, I want it everytime to change forth and back if you enter the basement and walk upstairs into the house again..
The parallel process is still going to continue to loop on every frame and do the conditional branch checks, so it will still cause lag.

The funny thing is, on my other map there is no lag at all.. And I did that parallel process stuff there too with changing the music sounds..

Original thread: https://forums.rpgmakerweb.com/threads/help-pls-parallel-process-lag.85941/