Event sounds bug out and create lag

cthulhusquid

Veteran
Veteran
Joined
Aug 19, 2013
Messages
310
Reaction score
255
First Language
English
Primarily Uses
RMVXA
So I have 3 parallel process events that are supposed to give you radiation when entering different zones. Each one has a different sound, and gives different amounts. They work fine when by themselves, but if I try to run more than one the sounds fluctuate between not working and speeding up. The framerate also drops a huge amount. (Ignore the fact that two of them show action button activation, they are supposed to all be parallel processes.)

Screenshot (489).pngScreenshot (490).pngScreenshot (491).png
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
287
Reaction score
70
First Language
English
Primarily Uses
RMXP
Not sure about this but have you tried adding some wait counter?
 

cthulhusquid

Veteran
Veteran
Joined
Aug 19, 2013
Messages
310
Reaction score
255
First Language
English
Primarily Uses
RMVXA
I just did, and it solved the framerate issue but not the sound one. The sounds are now really choppy.
 

Mewgles

Veteran
Veteran
Joined
Jul 24, 2020
Messages
71
Reaction score
70
First Language
German
Primarily Uses
RMMZ
You can't run more than 1 BGS at a time. You have to make sure to fadeout the previous BGS before using a new one in order to avoid those issues.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,497
First Language
Indonesian
Primarily Uses
RMVXA
Why not put all of them in a single parallel process? There is no reason for them in a separate process. You can do all of them in a single process.

Also to prevent lag, only "activate" the event when the player region ID is changed.
To illustrate, you're going to do this (I'm too lazy to set up the event, so I'm giving you the pseudocode)

-> Check if the player region ID is changed
And by this, I don't mean to check if the player is equal to something. But do it like this

- Decide which variable ID to hold the player's region ID
- Check if the variable is not equal with the player's region ID
- If not equal, perform BGS change
- Re-Assign player's region ID to that variable
- Put all the region id based damage below that

This way, play BGS only happens ONCE when the region ID is changed. Not all times.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,960
Reaction score
13,589
First Language
English
Primarily Uses
RMMV
Also add a Wait 5-10 Frames at the very beginning of the parallel process event. Your player is not going to change regions 60 times a second.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,894
Reaction score
522
First Language
English
Primarily Uses
N/A
Why not just make it all one event and check the players position with variables?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,960
Reaction score
13,589
First Language
English
Primarily Uses
RMMV
Actually, if these events are all on the same map and all have a parallel process trigger, it's never going to work the way you want.

The first event will fadeout BGM if the player is not on region 1.
The second will fadeout BGM if the player is not on region 2.
The third will fadeout BGM if the player is not on region 3.

As the player can only be on one region at a time only one of these events can ever be true, and the other two will be false. That means one event is always going to be playing BGM, and the other two events are going to be fading it out. This is why it's choppy.

If they are all on the same map, you probably want to do something like this:

Code:
wait 5 frames
if player region is different to the last player region (will need to use a variable to store the last player region)
  if player region is 1
    play BGM 1
    do other stuff
  else
    if player region is 2
      play BGM 2
      do other stuff
    else
      if player region is 3
        play BGM 3
        do other stuff
      else
        fadeout BGM
      end
    end
  end
end
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I'm hoping to get a call October 1. They should be fully open by then.


With this, all demo dungeon graphics are done.
Eventually I need to make animations...send help.
OcRam demo project is now available at https://ocram-codes.net !!!
mzBaseBody.png added!

Ami
--- Mushroom ---

F.Knight: We runs out the food!
Hero: Anything could eat in this place?
F.Archer: It's a bunch of Mushroom over there. I wonder it's safe to eat.
F.Knight: No worries,we have to fill our inside no matter what it is.
(Hero & F.Knight Eat The Mushroom,After 10 Seconds They Collapse With Foam)

Forum statistics

Threads
103,445
Messages
999,363
Members
134,982
Latest member
nobyde
Top