Optimization tips and tricks?

Im here lookingg for tips and tricks regarding workshop optimization and limitation~

For example: what are the do’s and don’ts of workshop programming.

What should i strive for when making something, and what should i avoid.

And where lies the limit of workshop memory? What happens if the limit is reached? And is there a difference between rules and actions? Is it better to spread the code out in lots of rules, or should i try to push as many of my actions into as few rules as possible?

Don’t overuse loops.

Is it better to copy/paste actions multiple times than to loop though them?

And can i mitigate the abuse of loops by making them loops with long waits? (0.25, 0.5 and 1 second waits for example)

Sorry, I didnt explain myself enough. I meant, only use loops if they are needed like:

No, its better to loop those of course. I just have seen intitialisations being looped etc. where loops just take computing capacities for no reason.

Here is a thread that gives you some useful tips:

I think there was another thread wich asked the same questions like you, but I can’t find it unfortunately.

Who in the right mind would loop a initlization… I run mine only on game start and hero spawn

You only loop it enough times to initialise all of the things you need.

For example, if I need 30 Light Shaft entities stacked on top of each other, you use one Create Entity action and loop 30 times, changing and using the data of 1 or more variables along the way to change the position/height etc.

Now, instead of having 30 manually inserted and edited actions, you can have 1 that dynamically changes based on where it is in the loop, and a couple extras for modifying the loop data - 30 actions, down to only around 5-10.

eh, fair point! didt think of such a use case ^^. havent really touched on permanent effects yet