View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,984

Violet CLM has disabled reputation

Mar 28, 2020, 10:23 PM
Violet CLM is offline
Reply With Quote
MLLE v2.14 has been released, and its big new addition is Smart Tiles, which let you create fully tiling walls and stuff just by dragging your cursor around and letting MLLE find the right tiles for you without your needing to so much as look at the tileset. Remember to copy everything from MLLE's "ExtractToJJ2+Folder" folder or this won't work. Some examples of how MLLE's smart tiles can guess what you want to do and place exactly the right tiles for you:





All official tilesets are supported except for Inferno, Haunted House, and Town House, and you can define your own smart tiles for any tileset you please using the built-in editor. When you first click the menu option to add a new smart tile, you'll see a window like this:

Each of the special Assignment tiles in the right-hand image represents a possible way tiles can connect to one another. To get started, click one of the assignments on the right, then click a tile from the tileset image on the left to assign it. Or click multiple times if there are multiple tiles that fit that assignment. In a minute or two the window should look more like this:

Few, if any, tilesets have tiles available for every possible assignment, but that's okay. MLLE will try a series of next-best options to make your tiles come as close as possible to tiling even if the exact necessary tile doesn't actually exist in your tileset. (Every smart tile you create must assign at least one tile to assignment 11, 14, and/or 47, because all the different series of next-best options eventually default to one of those three, and they all default to one another.)

If you hold down F and/or I while clicking a tile to add it to an assignment, it will be flipped horizontally and/or vertically. (For example, Medivo only has slope tiles in one direction, so the other direction needs to use horizontally flipped tiles.)

If you make a mistake, you can right-click a tile from the vertical list on the far right to remove it. Or you can right-click that same tile from the tileset image to remove all copies of that tile from the vertical list. Or you can right-click the assignment to clear the vertical list entirely and start afresh.

The "extra" assignment is a special case. MLLE will never automatically place tiles from it, but tiles assigned to it will count as part of this same smart tile. For example, if you're making a level with Castle, MLLE has no way to guess where you want the tiles with the cannon and cannonballs to go. But if you do place those tiles somewhere manually, the smart tile should place other wall tiles gracefully around them. This is achieved by adding the cannon's floor tiles into the "extra" assignment.

The "Friends" dropdown menu appears when there are multiple smart tiles for the same tileset, and lets you specify that tiles of one smart tile should continue into tiles of another rather than place edge tiles. It's similar to putting that entire other smart tile into the "extra" assignment, although not quite the same. For example, Diamondus's "Caves" smart tile has "Walls" as one of its friends:


But the friends menu is only part of that: the Walls smart tile also needs to know to place right-edge wall tiles with caves behind them instead of transparent pixels. For this you need to use the super-wide button with the plus symbol on it to add one or more Rules to the right-edge wall assignment:


Each of the three rules you can see in that screenshot looks at the tile immediately to the right of the right-edge wall tile, as indicated by the position of the red rectangle in the grid. Depending on whether that tile belongs to another smart tile, or is one of a number of specific other tiles (in this case, tiles that have tree branches in front of caves), different tiles get placed instead of the normal right-edge tiles: specifically, right-edge tiles with tree branches and/or caves behind them.

Editing any of the fields of a rule—e.g. moving the red square—selects that rule: once you do so, left-clicking a tile from the tileset image will add the tile (flipped or otherwise) to that rule instead of to the assignment generally.

Rules are tried in top to bottom order. In this case the "specific tiles" rule is on top because it's the most specific: only if the tile in the red square position is not 666, 667, or 668 does the second rule get evaluated, and only if the second rule is also false does the third rule get evaluated, and so on.

If a rule does not have any result tiles on the right at all, it is treated as an "and" rule instead of a "then" rule. A "then" rule is only accepted if it is true and so are all "and" rules immediately preceding it. For example, depending on what's available in the tileset, you might want to place one tile if there are cave tiles both on the left and on the right; a second tile if there is a cave tile only on the left; and a third tile if there is a cave tile only on the right.

The "X" button on the right side of every rule deletes that rule. The "D" button duplicates it. The "^" and "V" buttons move it up or down in the order.

Rules are the most complicated part of defining smart tiles, and defining smart tiles is the most complicated part of using smart tiles. If you don't want to get involved in defining smart tiles, that's fine: remember, they're already totally available for almost all of the official JJ2 sets! And maybe someone else will make a smart tile definition file for any other tileset you might be wanting to use. Once you get the hang of it, defining smart tiles doesn't take very long, and then they can save you incredible amounts of time once you start actually laying out a level.
__________________