Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - SMS map editors

Reply to topic
Author Message
  • Joined: 01 Feb 2014
  • Posts: 878
Reply with quote
SMS map editors
Post Posted: Thu Oct 05, 2023 12:50 pm
Ichigo’s brilliant preview images in the other thread reminded me that I’m at a point in my own project, where I can start building the game map.

Embarrassingly, I have used Photoshop to build the maps for all my previous games, then used BMP2Tile and game-specific custom converters to arrange the data as needed.

However, I’m totally ready for a more sophisticated approach. I see that Ichigo is using Tiled, which seems quite powerful, but I always got the impression that it outputs XML data by default unless you write a custom export plugin, which seems less than ideal to me. Maybe this impression is wrong, though?

What else is there regarding map editors? I know xfixium made one (SMS tile studio) and there’s also MapEd by 0x8BitDev. Anyone have tried these apart from their respective creators?

What I want to do is build a world map out of 24x24 tiles big rooms. I'd like to be able to assign both a tile set and a background palette to each room individually, so two rooms can share a palette or a tile set or both. An additional layer for a collision map would be a plus.
  View user's profile Send private message
  • Joined: 04 Jul 2010
  • Posts: 542
  • Location: Angers, France
Reply with quote
Post Posted: Thu Oct 05, 2023 1:16 pm
With tiled i'm using customs handmade python scripts (not directly as pluggin), it's fairly simple to manipulate XML data.
Its generaly outputting ASM files for wla, structured exactly as i want/need (data, labels, custom compression on some parts, etc)
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3828
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Oct 05, 2023 1:26 pm
With Tiled, there are a few options when it comes to exporting data to a custom format - but they all need coding some plug-in, either in JavaScript, Python or C++.

Working on a custom converter from the Tiled files directly isn't easier, IMHO. But you might pick any language you want, provided you can read and parse the input file (XML or whatever).

SMS Tile Studio seems promising, but I suspect it's yet w.i.p. Maybe it has got to the point that it has all/many of the features you need, probably xfixium is the only one that can tell you at this stage.

Custom BMP2Tile export plugins are an option too for simple manipulations.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Mar 2022
  • Posts: 20
Reply with quote
Post Posted: Thu Oct 05, 2023 1:28 pm
I remember reading about one called "Mappy" which seemed quite useful for Spectrum projects. I don't know if it can be used for SMS games (remember I'm starting to learn about SMS development right now! ^_^u)

Here's the link:
https://www.mojontwins.com/warehouse/Mappy-mojono.rar
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3828
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Oct 05, 2023 1:31 pm
This is the official Mappy website.
I don't know if the project is still under active development or has been abandoned already, it looks like it's the same webpage I have seen 5+ years ago...

edit: yes, it's the same version. 27 November 2010. Of course I don't mean to say it's a bad software.
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 886
  • Location: Spain
Reply with quote
Post Posted: Thu Oct 05, 2023 2:26 pm
ichigobankai wrote
With tiled i'm using customs handmade python scripts (not directly as pluggin), it's fairly simple to manipulate XML data.
Its generaly outputting ASM files for wla, structured exactly as i want/need (data, labels, custom compression on some parts, etc)


I also use a custom Python converter. I have a couple of different layers for each map, and I process them with Python to generate .c and .h files.
  View user's profile Send private message
  • Joined: 18 Jul 2020
  • Posts: 375
Reply with quote
Post Posted: Thu Oct 05, 2023 6:50 pm
Last edited by xfixium on Thu Oct 05, 2023 6:56 pm; edited 1 time in total
Kagesan wrote

What I want to do is build a world map out of 24x24 tiles big rooms. I'd like to be able to assign both a tile set and a background palette to each room individually, so two rooms can share a palette or a tile set or both. An additional layer for a collision map would be a plus.


Egh, hopefully I'm not too long winded about this.

I think SMS Tile Studio could handle that in its current state. Collision map could be done using the 3 bits on each tile (Type tool, range from 0-7). However, if you need more than 8 values, that is not supported, but will be in the future. (Assigning value(s) to a grid or meta tile grid. Multiples of 8 pixels)

You can use the Select tool to mass set the Type value (Among other things). Right click in the map area after you have made a selection. There are various functions you can access from the context menu. You can also set types in the Tileset tab. There's a Type option there as well. Clicking on a tile, sets the type for all tiles of that tile on the tilemap. The 'Tile Type Value' numeric, is where you select the bit value you want to set (0-7).

Setting the tile 3 bits (Called Types in SMS TS) via select tool
https://www.pyxosoft.com/projects/sms_tile_studio/sms_tile_studio_0001.png

Clicking the Type tool, you can see the results, you can also set tiles by clicking on them
https://www.pyxosoft.com/projects/sms_tile_studio/sms_tile_studio_0002.png

Setting the Type via tileset. Clicking on a tile will set all instances of that tile to the set Tile Type Value in the top right.
https://www.pyxosoft.com/projects/sms_tile_studio/sms_tile_studio_0003.png

You can change a color in a palette by clicking it, and either using the rgb drop downs, or by clicking a color in a swatch. You can also shift the color up and down using the arrow keys You can also import colors from an image via the import button.
https://www.pyxosoft.com/projects/sms_tile_studio/sms_tile_studio_0004.png

Also, you can copy/paste a tileset from one tilemap to another. When pasting, you have the option to auto match the existing tiles to the new tileset. I usually have a tilemap that acts like a master tileset. I make changes there, then I either bulk paste, or copy and paste to tilemaps that may use it.
https://www.pyxosoft.com/projects/sms_tile_studio/sms_tile_studio_0005.png

Also, one last thing, you could import a big map. Then use the select tool to create a new tilemap from the selection for your 24 x 24 tile maps.
  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Thu Oct 05, 2023 6:52 pm
I can easily make a bespoke editor if there is some request for it.

However, just like the FM tracker, I never made one so far, because literally everyone suggests something else when the topic comes up, and I'm not very motivated to work on something which is going to be branded as useless and/or unnecessary.

Feel free to prove me wrong, though. I'd also be up to write a mere converter from/to any existing format(s). Binary manipulation is one of the few things I actually like to do.

My free time just plummeted even more because I found yet another job in a high school far from home, and it already wasn't the best of times for me, so I can't promise a tight deadline, but I can try to make it work if needed.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 878
Reply with quote
Post Posted: Fri Oct 06, 2023 11:02 am
Thanks for the replies so far, much appreciated.

@xfixium: SMS tile studio does indeed look like it could do the job. I wasn’t planning to use the unused bits, but distilling a separate collision map from the data should be trivial. I’ll have a closer look at the whole package and get back to you if I have questions.

@Tom: Thanks for the offer, which I appreciate a lot. I’d never dare to ask someone else to get to work on a custom solution not a lot of people besides me would benefit from, as my requirements would quite likely be too single game-specific to be of much use. Frankly, the fact that you guys repeatedly help me out with those great translations of my silly manual texts makes me feel heavily indebted to you, and I can’t thank you enough for it.

That said, would it be okay if I got back to you in case I get stuck with manipulating data?
  View user's profile Send private message
  • Joined: 27 Feb 2023
  • Posts: 136
  • Location: France
Reply with quote
Post Posted: Fri Oct 06, 2023 3:35 pm
With Tiled you can simply export to csv and you will get a big array with metatiles numbers.

Put the picture with your tiles (that you use as basis in Tiled) in BMP2Tiles and you will get all the individual tiles, as well as a tilemap.

Your tiles of 32 chars are good to go, nothing to change.

You have to split the tilemap in squares of whatever the size of your metatile is (2x2 or 4x4 or whatever you wan actually), which is easily done in Notepad++ with regular expressions.
  View user's profile Send private message
  • Joined: 25 Feb 2006
  • Posts: 874
  • Location: Belo Horizonte, MG, Brazil
Reply with quote
Post Posted: Fri Oct 06, 2023 10:34 pm
Not sure if it will help, but if you happen to be confortable with node.js, dragon-blaster uses a small node.js script to convert the Tiled map into something the SMS can use:
https://github.com/haroldo-ok/dragon-blaster/blob/main/tool/convert_map.js
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Sat Oct 07, 2023 9:12 am
Kagesan wrote
That said, would it be okay if I got back to you in case I get stuck with manipulating data?
Of course, as I said, I'm always happy to help if I can, and manipulation of binary formats is one of the very few things I can actually do. However, please note that I can't guarantee a quick reply (even now, I'm replying several hours after you posted), because my life keeps finding new exciting ways to get worse and worse.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 878
Reply with quote
Post Posted: Sat Oct 07, 2023 3:06 pm
Tom wrote
However, please note that I can't guarantee a quick reply (even now, I'm replying several hours after you posted), because my life keeps finding new exciting ways to get worse and worse.


I’m sorry to hear that and I sincerely hope that things get better for you soon. Don’t worry about response times. I’m not in any kind of hurry, and at this moment, I’m really just bouncing ideas back and forth.
  View user's profile Send private message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Sat Oct 07, 2023 7:24 pm
Let me tell you this, as long as it's a mere 24×24 map with a few attributes for each tile, if you give me a description of the target format (e.g. as a bitfield or something), I can easily whip up a rudimentary converter, even from a TXT file or a VBA-activated Excel file, and by "easily" I mean that I can probably make one within a day.

If you want a dedicated editor, instead, I'd probably need more time, but if you like how I designed my Slider editor, I can probably repurpose that within a reasonable amount of time.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Jan 2017
  • Posts: 556
  • Location: Málaga, Spain
Reply with quote
Post Posted: Sun Oct 08, 2023 7:28 am
I always usé Mappy. Some reasons:

Low level functions: like remove duplicated tiles, create map from Big image, order functions.....

Bunch of lua scripts from which you can make your own utilities.

Can export to csv. (And from the csv, i can make my own scripts to rearrange the data)...

Regards.
  View user's profile Send private message
  • Joined: 01 Feb 2014
  • Posts: 878
Reply with quote
Post Posted: Sun Oct 08, 2023 1:46 pm
Tom wrote
Let me tell you this, as long as it's a mere 24×24 map with a few attributes for each tile, if you give me a description of the target format (e.g. as a bitfield or something), I can easily whip up a rudimentary converter, even from a TXT file or a VBA-activated Excel file, and by "easily" I mean that I can probably make one within a day.

If you want a dedicated editor, instead, I'd probably need more time, but if you like how I designed my Slider editor, I can probably repurpose that within a reasonable amount of time.


I do think that a dedicated editor would be overkill. I think a custom converter will be able to do the job in the end just fine. I wasn’t aware that Tiled can export .csv. Teaches me to read documentation more thoroughly before asking around. I think I’ll be able to work with that, so I’ll experiment with Tiled and SMS Tile Studio for now and see how that goes.

However, I haven’t even decided on a final data structure yet. That will depend on how the world map will turn out. If I have a better idea of the whole thing, I’ll be able to decide how to best structure the data of the individual rooms. It will probably be similar to how I set up the rooms in Bruce Lee, which means separate tile and collision maps plus a few additional bespoke flags and variables for certain rooms.

@eruiz00: Thanks, I’ll have a look at Mappy, too.
  View user's profile Send private message
  • Joined: 25 Jul 2007
  • Posts: 732
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Wed Oct 11, 2023 10:06 am
I personally love Tiled, it's a very powerful and extensible map editor.

Just as an example, this is an extension I wrote to export binary tilemaps compatible with DevKitSMS.

extensions are located in %USERPROFILE%\AppData\Local\Tiled\extensions on Windows.



/*
 * sms-binary-format.js
 *
 * This extension adds the 'SMS Raw Binary Tilemap' type to the Export As menu,
 * which can be used to generate matrix maps as used by devkitSMS.
 */

/* global tiled, FileInfo, TextFile */

tiled.registerMapFormat("smsbinary", {
   name: "SMS Raw Binary Tilemap",
   extension: "bin",

   write: (map, fileName) => {
      data = new Uint16Array(map.width * map.height);

      for (var li = 0; li < map.layerCount; ++li) {
         var layer = map.layerAt(li);
         var di = 0;
         if (layer.isTileLayer) {
            for (y = 0; y < layer.height; ++y) {
               for (x = 0; x < layer.width; ++x) {
                  var priority = 0;
                  var palette = 0;
                  var vertical = layer.cellAt(x, y).flippedVertically ? 1 : 0;
                  var horizontal = layer.cellAt(x, y).flippedHorizontally ? 1 : 0;
                  var index = layer.cellAt(x, y).tileId;

                  data[di] |= priority << 12;
                  data[di] |= palette << 11;
                  data[di] |= vertical << 10;
                  data[di] |= horizontal << 9;
                  data[di] |= index;

                  // tiled.alert(data[di]);

                  di++;
               }
            }
         }
      }

      var file = new BinaryFile(fileName, TextFile.WriteOnly);
      file.write(data.buffer);
      file.commit();
   },
});

sms-binary-format.zip (734 B)
needs to be unzipped

  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3828
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Oct 11, 2023 10:31 am
so I'm also posting an example - this is a Python export plugin for a column-major metatile map made using multiple metatilesets - it's from an old abandoned project (feel free to use it/modify it if you need it!)

on Linux the plugin directory is simply ~/.tiled

from tiled import *

class MapExporter(Plugin):
    @classmethod
    def nameFilter(cls):
        return "Meta-tilemap binary data files (*.map)"

    @classmethod
    def shortName(cls):
        return "Meta-tilemap binary data"

    @classmethod
    def write(cls, tileMap, fileName):
        fileHandle = open(fileName, 'wb')                 #  write binary data
        for i in range(tileMap.layerCount()):
            if isTileLayerAt(tileMap, i):
                tileLayer = tileLayerAt(tileMap, i)
                for x in range(tileLayer.width()):        #  column-major
                    for y in range(tileLayer.height()):
                        if tileLayer.cellAt(x, y).tile() != None:
                            tile_id=tileLayer.cellAt(x, y).tile().id()
                            for t in range(tileMap.indexOfTileset(tileLayer.cellAt(x, y).tileset().sharedPointer())): 
                                tile_id+=tileMap.tilesetAt(t).data().tileCount()
                            fileHandle.write(bytes([((tile_id<<3)&0xF8)|((tile_id>>5)&0x07)]))    # pre-rotated meta-tile ID [ROL 3] (byte)
                        else:
                            fileHandle.write(bytes([255]))    # write 0xff (this shouldn't happen!)
                            print ("Warning: cell at ({0!s},{1!s}) is empty.".format(int(x), int(y)))

        fileHandle.close()
        return True
  View user's profile Send private message Visit poster's website
  • Joined: 26 Aug 2022
  • Posts: 21
Reply with quote
Post Posted: Thu Oct 12, 2023 1:38 am
I've been experimenting with tUME recently. It's very old and was actually used in the industry in a few games from the era like MD Earthworm Jim, MD Aladdin and GG Mickey's Ultimate Challenge. That said, it's pretty damn powerful. It supports tile attributes based on priority and on which of the 16-color palettes is used for the tile. It's also designed to support collision mapping and setting up actors and events directly on the map, them exporting that as data your game engine can use. Also live palette cycling and lots more stuff. It exports graphics, metatiles, tilemaps, palettes. It also comes with a few tools like one that turns a picture into tiles, excluding duplicates and handling mirroring while also creating a tilemap, BMP2Tile style.

The downside is that, like other options mentioned here, you need to create your own exporter, though it comes with a couple well documented example exporters with sources.
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!