WohlSoft / Moondust-Project

Moondust Project by Wohlstand

Home Page:https://wohlsoft.ru/projects/Moondust/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

External Tools -> Convert all level files of one format into another

Emral opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
Let's say I have an episode with 100 .lvl files and I want to migrate them to .lvlx

Describe the solution you'd like
It would be cool if you could just do that with a press of a button like with pngs

Describe alternatives you've considered
A CLI would work as well

Moondust Maintainer counterpart already provides this functionality, you need to run pge_maintainer utility, and select the "Levels and Episodes format converting/fixing". Then you need to select the path to the episode and select the target format. Also, this will update all references to each other (means, world map and warps to levels, will keep the valid reference to converted files).

P.S. Screenshot of dialog:
изображение

But, do you want to add the shortcut that launches Moondust Maintainer in this mode into the Editor? That's quick to deal with.

Done, shortcut menu items have been added.

commented

Oh, whoops! Sorry, haven't checked in here in a while.
I just tested it out. Works really well for getting the batch conversion done! Just two things that are relevant to SMBX2 specifically:

  • In the "Save" dialog, lvlx files are called "Extended Level File", while in the maintainer window, they are called "PGE-X". It would be nice if the name matched the one from the save dialog.
  • .wldx does not yet work in SMBX2, so it would be great to opt-out of conversion of .wld to .wldx. Maybe the default for this could be a config pack flag?
  • In the "Save" dialog, lvlx files are called "Extended Level File", while in the maintainer window, they are called "PGE-X". It would be nice if the name matched the one from the save dialog.

That is because Maintainer means the generic format of all files (including levels and worlds), so, the PGE-X is a family of file formats using the same data format used in LVLX, WLDX, and SAVX files: https://wohlsoft.ru/pgewiki/PGE-X_File_format

  • .wldx does not yet work in SMBX2, so it would be great to opt-out of conversion of .wld to .wldx. Maybe the default for this could be a config pack flag?

As I said above, these menu items mean a family of formats, I would tweak the list to also explain what target formats family should be used.

So:

  • SMBX-64 family: all levels and world maps should be SMBX64 LVL levels and SMBX64 WLD world maps
  • SMBX-38A family: SMBX-38A LVL levels and SMBX-38A WLD world maps
  • PGE-X family (Moondust Engine and TheXTech): LVLX levels and WLDX world maps
  • SMBX2 family: LVLX levels and SMBX64-WLD world maps
commented

Ah, hm. I'm viewing this from a lense of usability, and most users will not know anything about these families. With that in mind it would be ideal to remove as much thinking as necessary when using this tool. Would it be possible to add 2 parameters to an ini in the config pack for maintainerDefaultLevelConversionFormat and maintainerDefaultWorldConversionFormat which I can set to .lvlx and .wld in the config for our purposes (and easily adjust in future versions once .wldx is supported)?
In my mind it should be possible for you to retrieve that value when the button in-editor is clicked, and via command line args transfer it to the maintainer which would present 2 dropdowns akin to the "Save File" dialog's options. I think that would be better than using nebulous pre-defined "families". Please let me know if that's not possible.

What if make the "Target engine" and the list of engines instead? OOOOH! I think I need to have "simple mode" and "advanced mode":

  • In a simple mode, just list a target engine as one of kind of common templates (like, "SMBX2", "Moondust", "TheXTech", "SMBX-38A")
  • In advanced mode, the user will be able to manually select each file format for levels and for worlds and special properties like the version number and the config pack ID (for PGE-X-based files).
commented

Maybe. My worry with "simple mode" is if it adds a dependency to the editor build if the target engine's parameters change. If for instance in a year or so we'll support wldx, we just wanna ideally make a one-line change on our end to adjust that here.

If that's possible to do without a change in the editor, then my worries are unfounded and your idea sounds great.

Maintainer as the component is fully independent of Editor and doesn't need config packs to work (except for the option at the batch converter for GIFs2PNG where it needs a config pack as a source for default masks). However, I could add the ability to add custom templates for the "simple mode" through the extra INI file for such cases.

commented

Sounds good.

As this issue has already been solved, the improvement that we discussed will be moved into its own issue: #536