TilemapEd, Tilemap editor for the X16

Post Reply
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

General - CX16 TilemapEd, Tilemap editor for the X16

Post by Dacobi »

TilemapEd is a simple tilemap editor specifically for the X16.
It's not meant to be a recreation of Tiled, but a more simple approach.

TilemapEd has 3 basic features which are Tilemap editor, Tile editor and Palette editor, but you can also edit the entire Tileset at once or a selection of Tiles in a Tilemap.
Tiles and palettes can be imported from the respective Gimp files (.gpl, .png, .raw, .data, .bin).
Tilesets can be imported from project files and also compatible PNGs.
Tilemaps can be created with an initial value and imported from project files, with a specified Tile offset.

Most Windows has a Clipboard available where Selections can be Copied/Cut/Pasted.
Select the desired area(s). Then press "C" to Copy Selection or "M" to Cut/Move. Press "V" to bring back the last Selection or "CTRL + V" to cycle all Selections. Press "F7" to bring up the Clipboard Window where Selections can be selected using "Left Mouse Button".

An optional CollisionMap can be created for TileMaps. There are different formats for the Collision Map, but all work by setting a "Collision Value", which is an integer between 2-8bits, for each Tile in the TileSet. A CollisionMap is then saved along side the TileMap with the "Collision Value" for each Tile in the TileMap as well as different combinations of Tile Flip and/or Palette Offset.

There is also an optional Sprite Editor.

Files saved from TilemapEd can be loaded directly into VERA and examples are included in C.

The source code is available under BSD 3 Clause license and can be found here: https://github.com/dacobi/tilemaped

For more information about how to use the program open the Help dialog by pressing F1 or run the program with "-h".

Binaries for Win64 and Linux can be fund here: https://github.com/dacobi/tilemaped/releases/latest/
(You may need to changes your Windows settings to allow execution of programs from unknown publishers)

The program can be launched with the following arguments:
"--opengl, --d3d, --software, --window, --maximize, --highdpi <uiscaleinpercent>, --nohighdpi, --vsync, --novsync"
The chosen options will be saved to an INI file and used until other options are applied.

In Windows you can force DirectX rendering by using --d3d. The default is OpenGL.

On 4K displays in Windows with high UI scale values, it may be necessary to run the program with "--highdpi <uiscaleinpercent>".

The default behaviour is to save Window Size/Maximize State to the INI file.

INI file options can also be changed in the "File->Settings" menu.

The first time the program is launched it has to be from the folder that contains the "nerdfont.ttf" file.
This file path will then be written to the INI file after which the program can be launched from any folder.
If the folder containing the font file is ever moved the program must again be launched from this folder and the font file path will then be updated in the INI file.

To access the example folder when using the AppImage you can extract the AppImage using:

Code: Select all

./Tilemaped-<version>-x86_64.AppImage --appimage-extract
or just download it from the GitHub page.

For a short video tutorial on how to create TileSets and Palettes using TilemapEd and Gimp and use them in tracks for my game "Mini Motors" goto my YouTube channel here:
Creating Tiles in TilemapEd from a Gimp Image

A few screenshots:
Screenshot from 2023-02-17 14-14-02.png
Screenshot from 2023-02-17 14-14-02.png (111.55 KiB) Viewed 480973 times
Screenshot from 2023-02-17 14-14-14.png
Screenshot from 2023-02-17 14-14-14.png (57.33 KiB) Viewed 480973 times
Screenshot from 2023-03-06 12-06-51.png
Screenshot from 2023-03-06 12-06-51.png (107.84 KiB) Viewed 480607 times
Screenshot from 2023-03-06 12-04-20.png
Screenshot from 2023-03-06 12-04-20.png (42.11 KiB) Viewed 480607 times
spriteed.png
spriteed.png (28.93 KiB) Viewed 478536 times
Last edited by Dacobi on Mon Oct 09, 2023 6:53 am, edited 24 times in total.
Johan Kårlin
Posts: 292
Joined: Wed Jun 03, 2020 11:33 am
Location: Kalmar, Sweden

Re: Tilemaped, Tilemap editor for the X16

Post by Johan Kårlin »

I think this is a really interesting project. Keep up the good work! A few comments:

1. Unfortunately I cannot run it on my computer. A completely blank, white window opens, nothing else happens. I had the same problem with Box16 which also is an Windows C++ application. But by using a certain option I am able to run it. It is documented as follows:
-vsync {none|get|wait} uses specified vsync rendering strategy to avoid visual tearing. Some drivers may not support all types of vsync.
none: Use if the content area remains white after start. Disables vsync.
get: Default, should work with OpenGL ES >= 3.0
wait: Alternative, should work with OpenGL >= 3.2

Can it be the same problem?

2. I am not looking for many features, but there is one I found really useful, it is the possibility to edit a tile directly on the tilemap and immediately see the changes in the map. This is because so far in my game creating experience almost all tiles relate to other tiles. If for example a tree consists of four tiles, I like to be able to place those four tiles beside each other on the tilemap and edit them there so I can immediately see how changes affect the appearance of the whole tree.

3. I am not a native English speaker, but shouldn't it be "tilemapped"?
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: Tilemaped, Tilemap editor for the X16

Post by Dacobi »

Hello Johan, I'm glad to hear that you are interested :)
get: Default, should work with OpenGL ES >= 3.0
wait: Alternative, should work with OpenGL >= 3.2
Can it be the same problem?
It sound like a graphics driver problem, what GPU/driver are you using?
I'm just using the SDL2 build in renderer, so I don't know how much control I have over which version of OpenGL is used.

(edit) You wouldn't happen to be running Win11? There seems to be a general problem with SDL windows in Win11.
the possibility to edit a tile directly on the tilemap and immediately see the changes in the map. This is because so far in my game creating experience almost all tiles relate to other tiles
I don't know about editing directly in the map, but I was planing to allow editing of a selection of tiles. So you could select ie. 3x3 tiles and then enter the Tile editor. You can press <space> to quickly switch between Tilemap and Tile editor.

Regarding the name, Tilemaped is short for TilemapEditor as in TilemapEd :)
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: Tilemaped, Tilemap editor for the X16

Post by Dacobi »

Unfortunately I cannot run it on my computer. A completely blank, white window opens, nothing else happens. I had the same problem with Box16 which also is an Windows C++ application. But by using a certain option I am able to run it. It is documented as follows:
-vsync {none|get|wait} uses specified vsync rendering strategy to avoid visual tearing. Some drivers may not support all types of vsync.
none: Use if the content area remains white after start. Disables vsync.
get: Default, should work with OpenGL ES >= 3.0
wait: Alternative, should work with OpenGL >= 3.2
Can it be the same problem?
I've added a new Win64 test on the releases page: https://github.com/dacobi/tilemaped/releases
If the problem persists try using these switches (--software, --novsync)

There's also a new AppImage for Linux. It will only work on distros with glibc 2.34 or higher.
For the AppImage, you will have to extract the image to get the example folder, or download it from the github page.
Johan Kårlin
Posts: 292
Joined: Wed Jun 03, 2020 11:33 am
Location: Kalmar, Sweden

Re: Tilemaped, Tilemap editor for the X16

Post by Johan Kårlin »

With the latest release everything works without any problems. My GPU is Intel UHD Graphics 620. I have tried it, it looks very promising.

Regarding tile editing: If you can edit a selection of tiles and see how they form a greater picture as you edit, that sounds what I am looking for. But I would appreciate if you could see the tilemap and tile editor beside each other simultaneously instead of switching between them. So if you're tilemap forms a forest of trees, you can edit one tree consisting of maybe four grouped tiles, see how it changes the tree as whole and also simultaneously see how it affects the forest.

When I think of the game I am working on right now - I would need a convenient way to work with several tilemaps relating to the same tileset because every level is a separate tileset. And it would be great if you could save a part of the palette, not always all 256 colors.

As I said, this looks very good so far. It is so liberating to work directly with the native formats of the X16 with no need of conversions. I really like it.
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: Tilemaped, Tilemap editor for the X16

Post by Dacobi »

I'm happy to hear it's working now, I still don't know what caused the bug. A friend of mine had the same problem in Win11 so I upgraded my laptop to Win11 but was not able to reproduce the bug. At that time I had already made changes to how the window was created so maybe I already fixed the bug.

Your feedback is very appreciated.
Regarding saving palette ranges and having more than one tilemap this is doable. I was already thinking about having more tilemaps.
But having both the tilemap and tile/tile selection editors in the same window would require an almost re-write of the program, which I'm not inclined to do right now.
I am however working on a complete tileset editor with selectable grid size.
So you can choose a grid size that aligns your tiles the way you want them.
This feature will be extended to work with an arbitrary selection of tiles, but I'm afraid that the space bar is the best I can do for switching between the editors right now.
Johan Kårlin
Posts: 292
Joined: Wed Jun 03, 2020 11:33 am
Location: Kalmar, Sweden

Re: Tilemaped, Tilemap editor for the X16

Post by Johan Kårlin »

I am glad you see my thoughts as an encouragement.

I don't know if this is the way you mean, but as I see it, the best way of editing tiles together is by being able to draw a square/rectangle around them in the tilemap and then switch to the tile editor and being able to edit them there together. Then you can for example select a house consisting of six tiles, switch to the tile editor, make adjustments, switch back se how it looks in the tilemap, make a new selection, switch to the tile editor and so on.

When thinking of how I have used tile editors so far, I realize that I also use zooming a lot. I am zooming in when editing, and zooming out to get a quick glance of how it will look.
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: Tilemaped, Tilemap editor for the X16

Post by Dacobi »

I'm about to upload a new binary where the TileSet Editor is almost complete.
(edit) It's on the GitHub releases page: https://github.com/dacobi/tilemaped/releases

You can change the Tile grid width to match your layout and change the scale. Currently you have to change the scale in the menu but I'm going to map it to the mouse wheel.
being able to draw a square/rectangle around them in the tilemap and then switch to the tile editor and being able to edit them there together.
This is the next step after the TileSet editor is complete.

I've also added a program switch --d3d to try to force the renderer to use DirectX. The default in Windows is now OpenGL.
Screenshot from 2023-02-24 10-54-04.png
Screenshot from 2023-02-24 10-54-04.png (63.87 KiB) Viewed 480806 times
Screenshot from 2023-02-24 10-54-10.png
Screenshot from 2023-02-24 10-54-10.png (66.76 KiB) Viewed 480806 times
Johan Kårlin
Posts: 292
Joined: Wed Jun 03, 2020 11:33 am
Location: Kalmar, Sweden

Re: Tilemaped, Tilemap editor for the X16

Post by Johan Kårlin »

All your plans are good news : ).

When I save a project, I get three binary files, they all seem to be exactly the data that VERA needs and nothing more. But where do you save the metadata (tilemap size, tile size, bits per pixel)? Can I import my VERA binaries from my current game somehow?
Dacobi
Posts: 292
Joined: Sun Dec 19, 2021 1:44 am
Location: Samsø, Denmark
Contact:

Re: Tilemaped, Tilemap editor for the X16

Post by Dacobi »

When I save a project, I get three binary files, they all seem to be exactly the data that VERA needs and nothing more. But where do you save the metadata (tilemap size, tile size, bits per pixel)? Can I import my VERA binaries from my current game somehow?
The metadata is simply the first 2 bytes of the files that the file load kernel functions of the x16 expects, using mostly the same format as layer config in VERA.
(edit) The first 2 bytes contain map/tile sizes and bpp. When those values are known a simple file size check is all that's needed to see if the file is valid.

There's not currently an import function, besides importing a raw binary Tile file, but it wouldn't be that difficult to do if you modify the first 2 bytes manually.
I was already thinking about functions to import Tilesets and Tilemaps from other projects, which would work with any file that has the correct 2 byte header.
Post Reply