Extreme lag when using autorun with parallel

Hello! I'm prob committing some kind of RPG Maker sin here but after much trial and error leading me nowhere I am at wits end. Appreciate any guidance or help.

What I'm trying to do:
I want to set a default value to a control variable. Instead of default value 0 I want it to be 1 so I can display the current day of the game with an image e.g. Day 1, Day 2, Day 3 etc.
(I realized that I can just adjust the conditionals to check for Day 1 = 0 instead of Day 1 = 1 which kinda made me facepalm lol but problem remains that I still don't know how to set default variables without lag)

What I currently have:
I have a day/night time system running on one parallel process that updates the time and date. I read in a thread that it's possible to do so by creating a common event that autoruns and sets the variable to the desired value. To make that work I also have an event in the corner of the map that is on autorun to enable a switch for the common event. This map event has a self switch that erases the event on page 2.

Current state:
The variable works and has a default value of 1 but I get like 1fps and can't move the character. When I remove the autorun event and just have parallel it all works fine.

Here are some pictures of the autorun events
map event.png
map event1.png

common event.png


Parallel events
parallel.pngparallel1.pngparallelevent.png
OK, your events are a mess that has no wonder that it creates lag.

first: You don't use both switch off and erase for any autorun or parallel, you only use one of them depending on what you want.

if you want the autorun to run once per entering the map, then you use erase event on the same page as the single page autorun that does what you want.
if you want the autorun to happen once per game, you switch it off by going to an action button second page that has absolutely no commands.

second: all parallel processes should use waits to reduce lag

in case of the time-counter, you usually use a wait(20) or so and count only to 30 instead of counting to 600 without waits.

third, you should use as few parallels as possible with as many similar function in the same parallel as is advisable.

basically your time display and your time control should happen in the same parallel process.

fourth, one-time initialisations should be done on the first map, never by common events

your ceInit event is extremely bad - autoruns loop permanently and sixty times per second if not switched off, and that common event will set the variable sixty times per second while blocking everything else on your game.
The variable should have been set in the same map event that activates the rest of the time system.

EDIT:
and by the way - the definition of autorun is "player cannot move". That is automatically and always happening as soon as any autorun is active anywhere, so whoever gave that advise was either wrong or had it for some very specific case that has nothing to do with your use.
..Ah yeah the tool tip for autorun is very misleading, well I find it is.
I would agree that the documentation on what autorun does is poor. It doesn't specify that it stops player movement, and it doesn't state that the event is run continuously (where it does say so for parallel).

On the flip side, any event tutorial you look up and follow would address these things, so that could be a good course of action here.
Wow thanks Andar for taking the time to write such a detailed response, it really cleared out a lot of things for me and made me understand things, I appreciate it. I removed the common event as instructed and set the variable value in an event on the map with just the self switch. It works perfectly now. Thanks also for the extra tip about parallel events, I have implemented the changes to make everything more efficient now which is of course desirable.

As for the time implementation lacking waits and having two parallel events, I got that from following a relatively known RPG Maker youtuber making tutorials. I guess even the popular tutorials can have faults in them, I better be more wary next time.
@massivepeasant
I have a very bad opinion of video tutorials for a lot of reasons. In 99% of all cases video tutorials are simply too short and omit important details or assume the watcher already know those details while focusing on details that are not always important.
And added to that comes the fact that sometimes (especially with scripting) you can't even see important differences in the video. There was a case where it was literally impossible to see the difference between (), [] and {} on the video, and that caused failures because it was a video tutorial involving scripting where the difference is very important.
Not to mention that if you want to learn from a tutorial you have to work through it, and that is easier with a written tutorial side by side with the editor, instead of rewinding and replaying a video a dozen times to make the same in the editor.

I suggest you follow the link to the "starting point" in my signature to several better tutorials.
The starting point tutorial was written when VXAce was current, but almost everything of it is still the same in MV and MZ.

Original thread: https://forums.rpgmakerweb.com/threads/extreme-lag-when-using-autorun-with-parallel.147427/