Text-2-image to parse RTS map tiles (Dune2021)
I know that is a weird topic title, but I have no idea how to clarify...
Basically, I want to reboot an old RTS project I was working on. It used a 'Dune II - Battle For Arrakis' tileset terrain map format, that stores each tile as an ASCII character, and also automatically forms the terrain sets, as so:-
I looked into Dune2000 tools, but from what I can tell, there's no way to easily bypass the hard-coded limits of their size limitations. I'm looking at having maps up to 2048x2048 tiles, with tiles 256* or even 512* (for posterity), and many extra custom tiles too, so none of these tools seem like they're going to cut it, even if it were commercially viable to do so, which I doubt. Those numbers might sound crazy but, the project would feature multiple levels of view angles and zoom, along with safeguarding for posterity and ensuring scalability.
So, I'm either asking if anyone knows free software that might be capable of doing this, or if anyone is interested in being commissioned to create it for us?
It doesn't need to be elegant or optimised for performance, since it's only for creating maps, but does have some strict requirements in terms of which ASCII character represents which graphic in the tileset, since we already have maps from the past we'd like to port up. The backend workhorse could be something like ImageMagick and I actually already have some idea how to achieve that, but, the terrain formation graphic I posted above is the biggest hurdle for me, even if I could program something to read/write those text maps. The terrain formation is really important.
Further commissions will be possible since I have a lot of ideas what a map editor like this could do, to decorate maps and (half)-intelligently relate tiles together.
Hey! I'm not going to do this for you because I don't have the time, I am afraid. But, what you are asking is actually pretty easy.
You have two options.
The first is to manually recreate your maps in Tiled. Tiled has exactly the solution you need, which it calls 'terrains.' I appreciate that this is not what you asked for, but it's worth thinking about, because a decent workflow there will mean you can then start creating new maps this way.
The second is to recereate the algorithm that Tiled uses yourself. If you read the link, you can see it talks about some key concepts: these are edge vs corner vs mixed tilesets; flipping and rotating; and probablity.
Essentially you'll need to go through your tileset, and mark up each tile with its corner and edge types (obviously depending on what type of tileset you have); then you take your ascii map and figure out what the corners or edges would need to be; then you choose the best tile you can find from your tileset. I say the best, because the number of tiles required for a complete three material set is quite large and you may find you are missing some. Read about Wang tiles here to find out more.
Then you either want to output as an image or as Tiled file. I would do the latter, because you can edit it later. There are libraries for writing TMX and TSX files in a lot of languages. Python or Lua might be a good choice for this, but you know your toolset.
And then you are done! If you do end up commissioning someone I guess at the very least you can point them to this text.
Thanks, I did actually try Tiled before and was excited about it, but I thought it only supported a 2X2 "sub-tile grain", and it did also crash on me a lot. Dune II used a 3X3 grain to demarcate/qualify the tiles, allowing for single rows/columns of terrain. I gave it another look after reading about the "Wang tiles", and it does indeed support what I'm looking for. However, it does still crash on me a lot. I guess I need to really downscale my tile sizes to use it, and rely on ImageMagick and data-management to stitch together the real juicy stuff afterwards. It would be great if Tiled was open source, or at least had some elaborate plugin system, but, as far as I can tell, it's neither.
Having said all of that, I'd still be interested in commissioning some coder to collaborate on this. Not to completely redo Tiled from the ground up, I think it still can be used, but there's still a lot more I have in mind.