Page 2 of 21

Re: Tilemaped, Tilemap editor for the X16

Posted: Sat Feb 25, 2023 10:25 am
by Johan Kårlin
Ok, mystery solved. That is a great solution! I like the simplicity, that no extra project file is needed and that the binaries can be used both in Tilemaped and in a game as they are. No problem for me making the changes manually to import my binaries.

Re: Tilemaped, Tilemap editor for the X16

Posted: Sat Feb 25, 2023 2:51 pm
by Dacobi
I just uploaded a version to GitHub where you can import Tilesets from both project files and from compatible PNGs.

Tilemaps will come later, when I manage to add support for multiple tilemaps in a project.

Re: Tilemaped, Tilemap editor for the X16

Posted: Sat Feb 25, 2023 3:54 pm
by Johan Kårlin
That is great. I imported the tiles and one level/tilemap from the game I am working on by using a hex editor, worked just fine. I tested to make some changes. The zoom function with the mouse is perfect.

Flipping tiles works fine but I noticed that the flip information is preserved when I replace a tile with another one. I find that somewhat confusing, I expect to place the exact tile I have selected from the tileset, but when I place it, it seemingly flips by itself.

Another thing that comes to mind is that I am used to be able to pick a tile by right-clicking on it anywhere I can find it in the tilemap and then place the picked tile anywhere by left-clicking. I find this very handy, I don't have to drag the mouse back and forth over the screen each time I want to change the tile I am working with.

Just trying to give some more constructive feedback. Of course, you know what is doable, what your prorities are and what you think is the best way to implement things.

Re: Tilemaped, Tilemap editor for the X16

Posted: Sat Feb 25, 2023 4:14 pm
by Dacobi
Flipping tiles works fine but I noticed that the flip information is preserved when I replace a tile with another one. I find that somewhat confusing, I expect to place the exact tile I have selected from the tileset, but when I place it, it seemingly flips by itself.
This is an oversight, I'll fix it in the next upload.
Another thing that comes to mind is that I am used to be able to pick a tile by right-clicking on it anywhere I can find it in the tilemap and then place the picked tile anywhere by left-clicking. I find this very handy, I don't have to drag the mouse back and forth over the screen each time I want to change the tile I am working with.
Yes, that was also the plan. It already works like that in the Tile editor with colors. Just forgot to change it in the Tilemap editor, but I'll add it to the list :)

Re: Tilemaped, Tilemap editor for the X16

Posted: Sat Feb 25, 2023 9:03 pm
by Dacobi
I just uploaded a version with tile type select on right click and flip data replacement.
I was a bit unsure about what to do with flip data when replacing all tiles of a certain type, ie in my test map I have 4 corners of the same tile type but flipped. Here it would make sense to keep the flip data, but in other cases it might not. At the moment all forms of tile replace also replaces flip data.

Re: Tilemaped, Tilemap editor for the X16

Posted: Sun Feb 26, 2023 9:38 am
by Dacobi
I'm about to start working on support for multiple tilemaps but there's a problem with the Undo stacks.
Currently the tilemap and tileset share the same undo stack. This would be a problem if you can switch between several tilemaps, to keep track of the order of undoable actions.
The only thing I can think of would be for all actions on tilemap and tileset to have a pointer to the tilemap that was active at the time and then automatically switch back to the specific tilemap when undoing actions.

Re: Tilemaped, Tilemap editor for the X16

Posted: Sun Feb 26, 2023 1:12 pm
by Dacobi
I just uploaded a version with an initial attempt to have more tilemaps.
There's bound to be some bugs, but in general its working. The first tilemap is always just map.bin and then the next starts at map0.bin etc.
The way I handled Undo/Redo was to check if the next undo/redo action is on the current tilemap and if not I switch to the specific tilemap, but without actually undoing/redoing the action. That will then happen next time undo/redo is pressed.
It may be a little confusing at first, but was the best I could do.

Currently there's no function for setting a Tile offset in imported maps, so its not super useful for maps that are made with another tileset. Also it will refuse to import maps with tiles that are out of range of the current tileset.

Re: Tilemaped, Tilemap editor for the X16

Posted: Sun Feb 26, 2023 3:51 pm
by Johan Kårlin
Regarding undo actions, maybe an alternative is to simply clear the undo buffer when switching tilemap? Undo is mostly useful for backing a one or a few steps almost immediately after they are taken?

Re: Tilemaped, Tilemap editor for the X16

Posted: Sun Feb 26, 2023 4:08 pm
by Dacobi
Regarding undo actions, maybe an alternative is to simply clear the undo buffer when switching tilemap? Undo is mostly useful for backing a one or a few steps almost immediately after they are taken?
You may be right. I just like the fact that you can (most of the time) Undo until the beginning of time :lol:
I'll have to think about it. I do already clear the redo stack whenever an edit action is taken.
Tiles and TileSet editors have their own undo stacks, so they are not affected.

Anyway I just uploaded a version where you can create new tilemaps with an initial tile value and import tilemaps with a tile value offset.

Re: Tilemaped, Tilemap editor for the X16

Posted: Mon Feb 27, 2023 9:20 pm
by Johan Kårlin
I have tried the latest version, it seems to work just fine. You work really fast. Details I thought of is that I would prefer if the initial tile is zero-indexed just like the palette offset dialog use zero-indexing. Also to benefit from the initial-tile-feature, I need to specify both initial tile and which palette offset to use because in my game tiles don't use palette offset 0, those colors are used by the text layer.

This is already so complete that I can only think of one more crucial (as I see it) feature I am missing. That is the possibility to reorder tiles, for example by simply dragging one tile over another to make them change place.