[+][SUG][ED] .nxlv to .lvl exporting

Started by WillLem, March 11, 2022, 03:00:55 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

WillLem

Is possible? :lemcat:

namida

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 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)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

WillLem

#2
Quote from: namidaYou'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: namidait 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:

namida

QuoteWould 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 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)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

WillLem

A dedicated level editor for RetroLemmini may well happen someday (ar, at least, the ability for the current Editor to handle both formats), but for now I've decided to have a go at implementing a simple "Export to INI" tool built-in to the current Editor which spits out a Lemmini-compatible .ini file:



It's working well so far, just need to finish the translation tables for the default styles (these tables can be built via the GUI so users can add their own styles) and fix up a few other cross-platform quirks and it's ready to go! This means that some* .nxlv levels can now be back-ported to the Lemmini family.

*Those which only use a single Lemmini-compatible style set, only OG skills and objects, and no pre-placed lemmings, zombies, etc. I'll publish a full list once this feature is finished. For now it's still a WIP.