Looking for some advice before I do this from some of you that have experience running a lot of parallel process common events. I'm looking to run 9 at the same time, and all they are doing is checking and adjusting a single variable each. I know through scripting this takes like 0 processing power, but I'm not sure how taxing it is via in game methods. Could anyone with some experience doing this shed some light? I've never really done more than 2 at a time.
Parallel process common events
General DiscussionShouldn't be a problem. If anything you can add a little wait after the check to not have it run every single frame if possible. (Depends on what you use them for)
Yeah, each one will already have a different wait time depending on when I want to check them, around 3-10 seconds depending. I just wanted input from someone who's done lots of them because I've done seemingly insignificant things before that lagged the game like crazy lol
Hi there!
If you will run them at the same time, is better if you just create a single one checking and updating all variables. Not a super big difference, if all the events are doing is performing a conditional branch checking and updating a variable.
Why do you need 9, one for each variable?
If you will run them at the same time, is better if you just create a single one checking and updating all variables. Not a super big difference, if all the events are doing is performing a conditional branch checking and updating a variable.
Why do you need 9, one for each variable?
Because they each update differently. For example I want variable X to change by 1 every 3 seonds, variable Y to change by 1 every 10 seconds, etc. The only way I could think of doing them all in 1 process would be through a conditional branch, and the wait time would mess it up.
If you are waiting for seconds rather than frames, it's fine to have them all running together. That many parallel processes with NO waits might cause issues, but adding just a one or two frame wait to each would resolve that. If you are doing seconds (like Wait 180 for 3 seconds, assuming 60FPS) on each one, you'll have no issue at all.
Why?
At the start of the game, set a variable SecondsWaited = 0. Then inside your single parallel process:
Code:
Control Variables -> SecondMod = SecondsWaited
Control Variables -> SecondMod Mod 3
Conditional Branch -> SecondMod == 0
- do stuff to/with variable X
Control Variables -> SecondMod = SecondsWaited
Control Variables -> SecondMod Mod 10
Conditional Branch -> SecondMod == 0
- do stuff to/with variable Y
Control Variables -> SecondsWaited += 1
Wait: 60
And when you get to some highest value you want to check that's divisible by all the others, you can reset it to 0.
Original thread: https://forums.rpgmakerweb.com/threads/parallel-process-common-events.149151/