Log In  


Cart #eyn_pltk_dev-1 | 2025-03-31 | Embed ▽ | License: CC4-BY-NC-SA
4

PLTK ("Picotron Level ToolKit", working name) is a in-development tool attempting to provide a similar feature set as LDtk provides.

Its (and LDtk's) design revolves around pattern matching. A set of rules are executed for each tile to compare its value and its neighbors' to determine which tile to apply.

The tool's, while it looks more polished on the first aspect, is still under heavy tinkering in all of its aspects (from the GUI to the data format, etc.), so while it might look close to final, expect things to shift around.

How to use PLTK?

PLTK works with tile layers like map.p64 but instead of storing the tiles to show, they contain the type of the tiles from which the tiles will be deduced. See the "Tile types" section for an example of the tiles I currently have hardcoded in the cart for example.

The canvas

Select a layer, a tile type and get doodling! The canvas' sidebar contains all the currently tools and view modes. Use the pen tool (B for shortcut) or the rectangle tool (B). Erasing is done with the right-click for now. Either use the panning tool (V or hold space) and click&drag to pan around the map. Scrolling with the mousewheel will change the zoom.

There are view two settings: the tile grid view and the tile render mode. The latter will draw the tiles by the color of their types instead of the deduced tile.

Of course, the bindings are prone to change (they're a blend of LDtk's and Aseprite's) so if you have any feedback, feel free to throw them at me in this topic, I'll be happy to take them in consideration.

The rules

Rules are there to determine which tile will be shown based on a tile's type and the configuration of its neighbors. I'd suggest you to look at LDtk's tutorial to get a solid explanation of how it works because PLTK is based on that.

(This part is clumsy as is the interface for now, bear with me and sorry in advance)
Rules are stored in groups (click on the folder icon to open a group). Each tile is going through the rules groups and rules from top to bottom, stopping at the first matching rule.

Clicking on the rule group panel's sheet icon in the header will add new rules and the arrow icon will exit the group.

Each rule has a few icons: the first tile it's assigned to, a button to enter the rule editor, a toggle to mark it as active/inactive and a button to delete the rule.

From the rule editor (really, it's the worst part of the tool as is, sorry!), you can choose the size of the pattern to use to match against. The grid in the middle will reflect the tiles to compare. Left-clicking on a tile will either mark the tile as having to match the selected tile type or be it ignored. Right-clicking on a tile will either mark it as having anything but the selected type or be ignored.

Clicking on the spritesheet on the right will allow you to select one or more tiles to use if the pattern matches. They're picked randomly based on a seeded distribution. The chance gauge at the bottom allows you to select the probability of the rule to be applied or skipped.

Roadmap

Notable features without a need for more words

  • Tile flipping
  • Coarser undo/redo system (to prevent the operation being slow and RAM-hungry)
  • Rule/rule group drag & dropping to re-order

Save/Load and current cart's context

This is a feature I kept aside for long as I was interested in doing all the other things. I'm fighting over myself over whether support the currently loaded cart like map.p64 and the rest of the OS or do a per-project file system like LDtk. I'll be pushing this further away for now but I'm interested to have your opinion about it, if you're willing!

Same thing with the spritesheets. As of the -1 version, the cart is baked with its own spritesheet (done by yours truly but inspired by Kenney's Platformer Kits

Ultimately, I'd like the file format to be a drop-in replacement for the .map files but with its own project data stored aside so packing everything for a release would be just a matter of cleaning up the source file.

World system

This is a feature I'm not yet decided in whether implementing or not. A big appealing point of the editor I'm borrowing from is the ability to have multiple levels in the same view. While Picotron might be too CPU-light to make it doable without making everything lag, I'm keeping it around just for the sake of the challenge.

License

  • The cart is released as CC-BY-NC-SA but the code's license is not yet determined nor gfx/icons.gfx. Though, the spritesheet located at gfx/0.gfx is released to public domain. Feel free to grab it.

Trivia

  • I got the greenlight from LDtk's developer for stealing borrowing a lot of his ideas or workflow. This is both a project I'm willing to spend time on to build my own level editor but also to understand what makes the magic of his.
  • You can bookmark the cart id but note that I reserved eyn_pltk for the 1.0 release and after and I'll switch to it for the 1.0.

Closing words

This post is as much a draft as is the tool: the general sense is there but it clearly lacks polish. If you have any feedback about PLTK or even this post, please feel free to send a message here and I'll look into it. I hope it'll be a tool worth of your time the day I'll drop the 1.0. Have a nice day!

4


This is so needed 🙏



[Please log in to post a comment]