Performance tips for large NeoLemmix levels

Started by ccexplore, September 30, 2019, 05:55:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ccexplore

[copied from namida's reply on a tangential thread]

If you are making large levels in NeoLemmix, there are a few things you can do to improve performance.

I will stress that in most cases, you will not need to worry about this. Treat this as "what can I change if my level is being laggy?" rather than "what should I always take into account when designing levels?"

First, note that there are several layers (visually) for objects - backgrounds, moving backgrounds, no-overwrite objects, one-way arrows, only-on-terrain objects, and "everything else". I list "backgrounds" here because although backgrounds themself aren't objects, there's a special case that's relevant - a moving background object that doesn't animate and doesn't move, will get drawn to the background layer rather than the moving background layer. This is done because the background layer just gets drawn once, not redrawn every frame. (A moving background or one-way arrow object always gets drawn to the moving background or one-way arrow layer respectively, never to the no-overwrite or only-on-terrain layers.)

So, to improve performance on such levels (or any level, really), you can:
1. Have fewer total lemmings. Also note that lemmings with permanent skills (simply on a "yes or no" basis, not a "how many?" basis) are very slightly more demanding than those without, zombies are slightly more so again, and zombie-permanents most of all.
2. Have fewer total objects. Non-moving, non-animating moving background objects do not count towards this, and you can go crazy with those.
3. Use fewer of the object layers. While there is a slight impact from having a different amount of objects on a layer, the main improvement comes from "is the layer completely empty or not". So if you can make all (or none) of your objects "No Overwrite" instead of a mixture, for example, this will improve performance a bit compared to having a mixture.
4. Where possible, use resizable objects rather than placing multiple objects. It's slightly more efficient.
5. Use objects with fewer secondary animations. The frame counts of them don't matter much, just the actual number of animations.

What doesn't make much difference:
1. Having more or less terrain.
2. Using or not using a background. However - this is assuming it's a proper background, and not an object-used-as-a-background situation - see above notes on objects for those.
3. Using objects with shorter animation(s), or objects that don't animate at all (outside of the moving background special case, above). This does affect memory usage, but doesn't affect CPU usage, which is generally the bottlenecking factor for NL.
4. Reducing the variety of object types. Unless this causes an extra layer to be used, it makes no difference whether you have three of the same exit, or three different exits, or an exit + a trap + a fire, etc.

I will note that all of these things actually can have an impact on loading time - but they won't have much, if any, impact on in-game lag.

Some of this advice does not hold true for older versions of NeoLemmix. Since we shouldn't be using those older versions anymore anyway, I am not going to elaborate beyond that.