Author Topic: [SUG][TOOL] .nxlv to .lvl converter  (Read 2647 times)

0 Members and 1 Guest are viewing this topic.

Offline WillLem

  • Posts: 3348
  • Unity isn't sameness, it's togetherness
    • View Profile
[SUG][TOOL] .nxlv to .lvl converter
« on: March 11, 2022, 03:00:55 PM »
Is possible? :lemcat:

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [SUG][TOOL] .nxlv to .lvl converter
« Reply #1 on: March 11, 2022, 07:06:57 PM »
Theoretically.

You'd essentially need a "reverse translation table", to map the piece names back to index numbers. You could autogenerate most of this from the regular translation tables (and presumably, you'd need to take into account any remapping in the alias files too). Some parts couldn't really be auto-generated any sensible way, and would need to be filled in manually - for example, splitting the exit back into a seperate main part / animated top. This could either be "modify the reverse translation tables by hand", or just "modify the output level to manually add back the missing part".

I'd note that there's very little point in doing this. If, as I suspect, the intended use case is SuperLemmini level creation, it would likely be not that much more effort - and a far more useful result - to create a fork of the NL level editor that instead loads and saves SuperLemmini levels directly.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline WillLem

  • Posts: 3348
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: [SUG][TOOL] .nxlv to .lvl converter
« Reply #2 on: March 12, 2022, 11:42:24 PM »
Quote from: namida
You'd essentially need a "reverse translation table", to map the piece names back to index numbers

Would there need to be 2 copies of each style, one named (as per .nxlv) and one indexed (as per .lvl)? Or, does this depend on the player (NL/SL)?

Quote from: namida
it would likely be not that much more effort - and a far more useful result - to create a fork of the NL level editor that instead loads and saves SuperLemmini levels directly

That's the dream, for sure. I even have some ideas for how I'd want the UI to look:

(Note that the tool panel on the upper left is for: Normal mouse pointer action / Selection mode (an advanced version of normal select which allows you to highlight and switch between pieces using the cursor/pgup & pgdown keys - great for fine-detail editing, as well as perform multi-selections, etc) / Paintbrush mode (which paints continuously using the currently selected piece whilst LMB pressed, or paints pieces edge-to-edge with RMB pressed) / Erase mode (erases continuously whilst LMB pressed, or turns pieces into eraser pieces whilst RMB is pressed) / rulers (for splat distance, etc) / skill mask sketches - all of this is dreamland at the moment, but it's what I'd want the editor to be able to do)


Thing is, I don't know anything about C# (which I believe is what the editor is written in?) I'm willing to learn, though. Realistically, how long do you think it would take (and how much work do you think it would be) for me to reverse-engineer a simplified version of the current NL editor which only deals with the classic 8 skills and L1/ONML objects, saves to .lvl and .nxlv (if possible), and give it something like the above UI?

Obviously, I'd start by just simplifying the editor (by removing stuff it doesn't need). That seems like a good place to start. Then, I'd need to re-introduce it to the .lvl format via .nxlv.

Worthwhile learning project, do we think? Or horrendous amount of work for very little gain? Or both? :crylaugh:
« Last Edit: March 12, 2022, 11:54:02 PM by WillLem »

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: [SUG][TOOL] .nxlv to .lvl converter
« Reply #3 on: March 14, 2022, 07:01:06 AM »
Quote
Would there need to be 2 copies of each style, one named (as per .nxlv) and one indexed (as per .lvl)? Or, does this depend on the player (NL/SL)?

Theoretically you don't need an old-formats copy of the style, though there's not really much point converting it to LVL without one. On the other hand, if the ultimate intent is NXLV to (SuperLemmini) INI, then there's no reason to go via LVL. Make a convertor that goes straight from NXLV to INI. You'd still need a translation table (to be clear: this does not literally have to be in the exact existing format; I simply mean a file that serves the same purpose) unless the piece names in both engines mix exactly, but this would instead be one that maps NeoLemmix piece names to SuperLemmini ones, rather than NeoLemmix piece names to an index number.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)