[✓][BUG][ED] Indentation of terrain pieces in NXLVs inflating file size

Started by The Tomato Watcher, February 02, 2026, 09:39:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

The Tomato Watcher

Since NeoLemmix Editor 1.45, if a level with more than one terrain piece is saved, each subsequent $TERRAIN group in the NXLV will be indented two extra characters, which accumulates the more terrain pieces there are in the level.

For example, this:
#        Terrain pieces         
# -----------------------------
 $TERRAIN
   STYLE orig_crystal
   PIECE bar_04
   X 507
   Y 65
   ONE_WAY
 $END
 
 $TERRAIN
   STYLE orig_crystal
   PIECE clump_01
   X 38
   Y 109
   ONE_WAY
 $END
 
 $TERRAIN
   STYLE orig_crystal
   PIECE clump_02
   X -8
   Y 115
   ONE_WAY
 $END

...

...becomes this:
#        Terrain pieces         
# -----------------------------
 $TERRAIN
   STYLE orig_crystal
   PIECE bar_04
   X 507
   Y 65
   ONE_WAY
 $END
 
   $TERRAIN
     STYLE orig_crystal
     PIECE clump_01
     X 38
     Y 109
     ONE_WAY
   $END
   
     $TERRAIN
       STYLE orig_crystal
       PIECE clump_02
       X -8
       Y 115
       ONE_WAY
     $END
     
...

ONLY the Terrain pieces section has this issue. Objects and Rulers are formatted properly.

While this doesn't prevent the level from loading or playing normally in the NeoLemmix Player or in the Editor itself, it can make levels explode in file size. After opening the level these examples are from, making no changes, and immediately saving, the file size went from 26KB to 566KB! :lem-mindblown:

WillLem

Fixed in commit 8f24e33.

Thanks for reporting this, and well spotted! It was due to an overloaded method which needed an extra argument, clearly a very nasty bug but also a very easy fix once I'd tracked it down.

I'll get a hotfix out soon - open and re-save any levels you've saved using 1.45 and it should fix them. If you've saved a whole bunch, use Cleanse Levels.