Author Topic: [NeoLemmix] Graphic set conversion to new formats - Available now!  (Read 4535 times)

0 Members and 1 Guest are viewing this topic.

Offline Nepster

  • Posts: 1829
    • View Profile
[NeoLemmix] Graphic set conversion to new formats - Available now!
« on: September 04, 2017, 07:51:33 PM »
Graphic set conversion

While I still have some bugs to fix before we can start converting level packs, all the conversion tools for graphic sets are ready now. As this is the first thing we have to do anyway, let's start with it!

Download the conversion tools from the new-formats release thread.

This zip archive contains:
- GSConvert.exe: The actual converter tool to produce the new-formats files out of an existing style.
- GraphicsTool.exe: The new-formats graphics tool. It can not load old .dat styles! As IchoTolot requested this Saturday evening, I coded it in a 10-hour marathon on Sunday and that shows. So please be nice to it and cuddle it a bit ;). Please don't name your styles "ARGH §$%&!?", all your objects "MyFavoriteObject" or use just a single space for your background...
- NLEditor.exe: The current version of the new-formats editor.
- Several example styles: They are contained in the subfolder "styles".
- Several translation tables: They are contained in the subfoler "data/translation". As they encode where to find the pieces you used in actual levels now, they will become very importent when we convert level (packs). Therefore they should be created now, too.
- Sound files: They are contained in the subfolder "sound" and only useful if you plan to modify your graphic set at the same time.

How do I install these tools?
Just unpack them in a completely new folder. Then everything should work without any further

Please read the next post for details how to convert a graphic set!

IMPORTANT: If you already have some new-formats graphic sets lying around, delete them, burn them to ashes and throw them as far away as you can! There have been quite a few changes to the actual content, so mixing them will only create a huge mess!
« Last Edit: September 23, 2017, 03:57:22 PM by Nepster »

Offline Nepster

  • Posts: 1829
    • View Profile
Re: [NeoLemmix] Graphic set conversion to new formats - Available now!
« Reply #1 on: September 04, 2017, 07:51:47 PM »
How to convert a graphic set?

The basic conversion is extremely simple: Look for your old style file, e.g. "goodstyle.dat", and drag it onto the "GSConvert.exe" file. A black console window should appear (don't worry, you don't have to use it!) and after it has disappeared again, the converted files should be available:
- The actual style files in the subfolder "styles/goodstyle" (where of course "goodstyle" is replace by your style name).
- A translation table file in called "goodstyle.nxtt" in the subfolder "data/translation". This is actually a pure text file, so you can open it with any text editor.

Actually your style is already fully functional now. But if that would have been everything, then I could have done the conversion myself. So here is a list of issues to look out for:

1) Give your pieces proper names
If you haven't already given your pieces human-readable names, they will be called "T5.png" or "O42.png". That's bad. They should be at least somewhat descriptive. Please have a look at the example styles and the names used there. For example "block_12" is fine, while "stuff_112" is borderline and "blue_large_block_with_three_red_stripes" is probably overkill.
So how can I change the name? Let's assume we want to rename piece "T5" to "block_03". Then do the following:
- rename the file "T5.png" into "block_03.png"
- If there is a file "T5.nxmt" or "T5.nxmo", rename it into "block_03.nxmt" resp. "block_03.nxmo"
- Open the translation file and search for the line "PIECE T5" and replace it by "PIECE block_03".

Alternatively you can do the following: Open the style in the old graphics style tool, and add proper names there. Then save the style and convert it again with the "GSConvert.exe". Now all name changes should be properly applied.

2) Style name have to start with your nickname
All styles from non-official games now have to start with your nickname (or an abbreviation thereof). As this was already a recommendation before and semi-enforced by namida, I don't expect any troubles here. If you nevertheless have to change your style name (or want to rename it for a completely different reason), then you have to do two things:
- rename the folder of your style in the "styles" directory, e.g. from "goodstyle" to "nepster_greatstyle".
- open the translation file "goodstyle.nxtt" in the "translation" folder, and replace every occurance of "goodstyle" with "nepster_greatstyle". Do not change the name of the translation file, itself!

3) Check that your terrain pieces are arranged in a proper way in the editor
For terrain pieces, the editor orders them according to their name. So try to use similar names of pieces that should be grouped together in the editor. For this reason piece names like "block_03" or "block_blue" are encouraged over "large_block", "small_block" and "blue_block".
If you have to rename your pieces due to this reason, use the same steps as described in point 2).

4) Remove slowfreeze and triggered decoration objects
The graphics converter still outputs them, even though they will no longer be supported for the simple reason, that you might want to reuse their sprites. So if you have such objects in your style, please do the following:
- Delete the sprite file (or move to somewhere else) and delete the ".nxmo" file of the same name.
- Search for your sprite name in the translation tabe file, and delete the whole section starting from "$TERRAIN" and ending with "$END" that contains the piece name.
The same applies if you want to remove any other piece for some reason.
PS: If you have a decoration object without any trigger area, then it is either a pure decoration object or a movable background and can stay.

5) Remove duplicated pieces
We want to avoid duplication of pieces. So if you used an object (or less likely terrain piece) from another style, then please do the following steps:
- Find the sprite you copied from. A good place to look for it is the folder "styles/default" and in case of splat-pads "styles/namida_wasteland".
- Check whether they are actually the same sprites. If they look the same, but have different size, please contact me and I will deal with it.
- Delete the sprite file and the corresponding ".nxmo" file coming with it.
- Locate another translation table file that has a reference to this sprite in it. For everything not contained in "styles/default" you can use the translation table for the corresponding style.
- Go to the section in your translation table, that contains the name of your piece, and replace all lines starting from "COLLECTION..." until "$END" with the ones from the other translation table. Make sure to keep your original line starting with "INDEX".

I know this copying of lines from translation tables isn't easy, so I have compiled a list of common such objects and how their section should look like at the end. So you can basically copy from here, too, but please make sure to keep your piece index!

6) Edit out preplaced lemmings
Hopefully the graphics converter does this already for you, but just in case it does not do so:
- Delete your preplaced lemming sprite and the corresponding ".nxmo" file.
- Replace the section for the preplaced lemming piece in the translation table by the following (while keeping your original index number):
Code: [Select]
  INDEX "Keep this!"
  SPECIAL lemming

7) Combine exit and exit tops
In the new-formats we want that level designers don't have to place two objects per exit. So please create a sprite where they are already combined. As there have to be some nasty manual changes to both the translation file and the ".nxmo" file, you can send me your style with the unmodified exit in the style folder and an extra combined exit sprite, and I will do all the necessary modifications.
If you want to do everything yourself, you are welcome to do so. Ask me for more infos in this case.
Btw. at the moment you cannot combine the locked exit and the exit animation, so keep these as they are.

8) Crop huge empty spaces
This should not be a problem for custom styles, but was one for the original styles. But if you nevertheless see a spite with huge empy spaces at some side, consider cropping it a bit. As this affects the placement of the piece, you will have to modify the translation table a bit. Look at the section for your piece and you'll notice some lines called "OFFSET". These are exactly for such purposes:
- If you remove N pixels from the top, change the line "TOP_OFFSET 0" to "TOP_OFFSET N".
- If you remove N pixels from the bottom, change the line "BOTTOM_OFFSET 0" to "BOTTOM_OFFSET -N".
- If you remove N pixels from the left, change the line "LEFT_OFFSET 0" to "LEFT_OFFSET N".
- If you remove N pixels from the right, change the line "RIGHT_OFFSET 0" to "RIGHT_OFFSET -N".

If you have any further questions or problems, please contact me.

For those who want to modify their styles:
a) Removal of old pieces
Delete your piece (.png), the text file with the same name (.nxmt or .nxmo) if it exists and delete the section corresponding to this piece in the translation table.
b) Addition of a new piece
Just load your style in the new graphic style tool, add the new piece there and then save the style again. Please make sure that you don't choose a piece name that already exists within the style.
You don't have to change anything in the translation table.
c) Changing a piece
If you keep the size of the sprite and want to keep the same position and size of the trigger area (if any), then this is very simple: Just change the image .png file.
If you want to change the size/position of the trigger area or the sprite itself, most likely you have to modify both the translation table and the .nxmo file. Contact me, if you have problems there.
« Last Edit: September 06, 2017, 08:57:31 PM by Nepster »

Offline Nepster

  • Posts: 1829
    • View Profile
Re: [NeoLemmix] Graphic set conversion to new formats - Available now!
« Reply #2 on: September 04, 2017, 07:53:00 PM »
List of converted styles:
- All styles from L1, ONML and Holiday Lemmings. Moreover dirt_md; the other "orig_md" styles are replaced by the DOS styles.
- L2 styles: all
- L3 styles: all
- Colorful Arty: all styles (Lego and Underwater)
- Flopsy: Scrapbrain, Starlight. Honeycomb_mod is merged with namida_honeycomb.
- GigaLem: all Freedom Planet styles
- Gronkling: all styles (Menace, Beast II, Cyber and Slime)
- IchoTolot: all styles (Dune, City and Castle) and two VGASpecs.
- jarv156: Future style
- Matt: Lix Marble
- Minim: ps3dark und ps3factory
- möbius: all styles (tancastle)
- namida: all styles.
- Proxima: Lix Tile
- Raymanni: all styles (Biolab, Circus, Cyberspace, Eldorado, Food, Gore, Sewer, Snow and Toys), except Spooky
- zanzindorf: all styles (glacier and kiwi style)
- various VGASpecs
« Last Edit: November 16, 2017, 10:10:04 PM by Nepster »

Offline Nepster

  • Posts: 1829
    • View Profile
Re: [NeoLemmix] Graphic set conversion to new formats - Available now!
« Reply #3 on: September 06, 2017, 07:32:11 PM »
If anyone wants to modify their converted style, I have a new version of the graphic style tool for you. Changes:
- Style titles are now properly loaded.
- Buttons, ... are now inactive, if they won't do anything resp. are irrelevant for the piece.
- The tool is no longer a FileEater.T.png. In other words: If you have multiple pieces with the same name, they are no longer saved to the same file, one overwriting the other, but into different files.
- If you enter style or piece names that aren't valid windows file names, you will no longer get an error, but the tool automatically turns them into valid file names when saving the style.
- Loading and saving styles is now done via a proper file browser.
- If you encounter any errors, they are now logged properly, so that I can actualy debug them.

Offline namida

  • Administrator
  • Posts: 12414
    • View Profile
    • NeoLemmix Website
Re: [NeoLemmix] Graphic set conversion to new formats - Available now!
« Reply #4 on: September 07, 2017, 10:54:40 AM »
The "offset" lines aren't needed in the translation tables if their value is zero.

Also, when giving names to pre-conversion graphic sets, assuming this is the same graphics set convertor I wrote and not a new one, you can name several terrain pieces (but not objects!), for example, "block_#". If you named three pieces that way for example, the actual names in the output would become "block_1", "block_2", "block_3". Once again, this only works for terrain.

Similarly, you can name pieces "#[set]:[piece]" in the pre-conversion graphic set, and the conversion tool will automatically apply that reference in the translation table it generates. For example, if you have an updraft, you can name it "#default:updraft". The conversion tool will automatically apply the correct WIDTH and HEIGHT values. (If this doesn't work, try without the #, I'm not 100% sure whether it's used or not, but I think it was.)

Finally, regarding the offsets for the pre-placed lemming: Do note that some existing pre-placed lemming objects have a trigger point of 2, 9 and others have 2, 10. Make sure that the data in the translation file matches the preplaced lemming object in your set. Of course, this will generally be a moot point since the conversion tool should automatically take care of this.
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 Nepster

  • Posts: 1829
    • View Profile
Re: [NeoLemmix] Graphic set conversion to new formats - Available now!
« Reply #5 on: September 07, 2017, 03:41:16 PM »
Also, when giving names to pre-conversion graphic sets, assuming this is the same graphics set convertor I wrote and not a new one, [...]
Yes, it is the same one. So everything you said applies.

Offline Nepster

  • Posts: 1829
    • View Profile
Re: [NeoLemmix] Graphic set conversion to new formats - Available now!
« Reply #6 on: September 09, 2017, 09:17:50 PM »
IchoTolot noticed a few bugs in the graphic style tool, so here is version 0.4:
- Wider lists for pieces, so that their names get properly displayed.
- Loading and saving of movable backgrounds works now.
- Objects that have no trigger area no longer display a trigger area.
- Trigger areas outside the sprite area are displayed instead of cut off.

Offline Nessy

  • Posts: 579
    • View Profile
Re: [NeoLemmix] Graphic set conversion to new formats - Available now!
« Reply #7 on: September 09, 2017, 10:07:11 PM »
By the way, whenever Nepster releases a new version I will post in the New NeoLemmix Website thread when the update has been uploaded to the server. That way you can download it directly from the NeoLemmix website on the NLEditor page.

As a reminder, there is a link for a fresh copy of the latest version of everything (NLEditor, styles, graphic conversation tools), a link for the latest NLEditor only, and a link for the latest GraphicTools only. That way, you don't have to constantly download everything, just what was updated.

Offline Nepster

  • Posts: 1829
    • View Profile
Re: [NeoLemmix] Graphic set conversion to new formats - Available now!
« Reply #8 on: September 13, 2017, 05:07:06 PM »
I am making good progress fixing bugs in the new-formats version, so a first new experimental version (with the possibility to convert packs) should be coming soon.
If you have any converted styles, that you haven't yet sent to me, please do so and I will include them in the next update. :thumbsup: