[HELP] A Square-SmallcapsRM tileset?

Hello Cataclysm community. I’m not sure which category is appropriate for this topic. In other hand, I am not fluent in English, so I am going to do my best to express my question as clearly as I can.

I’m trying to figure out how to make an ASCII tileset with a “Square-SmallcapsRM” font. I mean: something like “ASCIITiles” tileset but looking exactly like CDDA looks when “graphic” option is “off”. My main purpose is to be able to play with ascii graphics (I don’t like non-ascii ones) but with the option to zoom in / out. I know the “ASCIITiles” package behaves this way, but I am a fan of the Square-SmallcapsRM font, and after using it for about ¿6 years? I am unable to get used to anything else.

There are other characteristics of Square-SmallcapsRM drawing behavior that I was interested in preserving if possible, such as turning the “not visible” range completely black at night (exactly as it happens with the “graphics” option disabled). In any case, I’m happy to be able to play with Square-SmallcapsRM without losing the zoom option.

Any ideas or instructions about how I could do this?

Thanks you very much in advance.

see doc/TILESETS.md

The following steps should work:

  1. copy gfx/ASCIITiles to gfx/SmallCaps
  2. edit the gfx/SmallCaps/tileset.txt with the new information
  3. replace gfx/SmallCaps/fallback.png with a new version of the same .png in your preferred font.

Thanks you very much, mlangsdorf. I’m going to work on it right now, see if I get it

An extra question: is it possible to substitute the symbol ‘,’ (“tall grass” graphic, in game) by the symbol ’ " '? Graphically it would look more beautiful and coherent (I think). The problem is that the interpreter of json files recognizes the symbol ’ " ’ as “closing” of a quoted json expression. Maybe with a UNICODE code? It’s possible?

If you’re using a tile set you’re using “images” that, in your case, happen to look like characters. This also means that you can change the image of the tile that looks like ‘,’ in the tile set you’re using as the starting point with an image that looks like ‘"’ in your modified tile set.

Okay. Using FONTFORGE with a custom Python script, I have managed to convert each Square-SmallcapsRM.ttf font character to PNG (ie: I have a PNG file for each character). Now: reading TILESET.md, I understand that the compose.py and decompose.py scripts serve to produce a fallback.png file with the desired images in some way. But I am not a programmer and I cannot understand how. I am assuming that the fallback.png image is not created manually with an image editor, but is generated automatically with some tool. Could anyone help me with the steps to follow to create a fallback.png file from the PNG files of each character? Any suggestions or information that can help me? Thanks in advance

No, the fallback.png is a standard png file that each tileset has. I don’t know how it was created, but it isn’t created as part of compose.py script. But since it’s an individual file in each tileset, you can just replace it in your tileset.

A meta-image creation tool like ImageMagick or vips has functionality to take a bunch of images and merge them into a single larger, image. That’s a small part of what compose.py does and if you know Python, you can see that in the write_composite_png() function. But you said you’re not a programmer.

Well, I’m not an artist but I read enough ImageMagick and vips documentation to figure out how to composite images together. I suggest you do the same! I’ve forgotten the syntax, but I know both programs have the capability. Good luck!

1 Like

Thank you very much, mlangsdorf. I understand, I think. I’m not a programmer but a logician, so with a little patience I can read some programming languages ​​like python or javascript (for C I don’t have enough patience XD). I’ve done a bit of research and indeed the fallbacks.png file can be produced with VIPS. Nor does it seem excessive to me to build, with GIMP, by hand, a fallbacks.png. Yesterday, in 2h approx. I completed 10% +/- of the new fallbacks this way. However, I am now thinking that creating a tileset from the SquareSmallCapsRM font may be more complicated than I thought. The problem I run into is that I need to generate a fallback.png with a minimum resolution of 512x8192px (otherwise it is impossible to preserve the body of the SquareSmallCapsRM font), and I understand that this prevents me from using the tile_config.json file of a tileset as ASCIITiles (which is 160x2560px).

I guess I can take the tile_config.json from a tileset like Cuteclysm, since it refers to a 512x8192px fallbacks.png; however, the way the tile_config.json works/is-read-by-CDDA is quite mysterious to me. My current question is: how does CDDA know (where is it defined) that the fallback.png is 512x8192 pixels (for relative graphics position, I mean)? I understand that, if I want to preserve the object-symbol relationship that the game handles in the “graphics-off” version, it would be enough to replace the fallbacks.png of the Cuteclysm tileset with the desired fallbacks, and delete all the other png files that Cuteclysm includes ( or delete, in the tile_config.json, all the definitions that refer to any png that is not the fallback.png); I mean: I understand that the drawing program goes to fallback.png when one of the following two conditions is met: a) in tile_config.json there is no png image defined for the object; b) in tile_config.json there is a png image defined for the object, but the referred png file does not exist. Is this correct? I ask this because, if it doesn’t work like that, I think it might be easier (for my limited knowledge) to forget about the fallback.png and use a tool like the CDDA-Tileset-Editor to replace, one by one, the images of a tileset like Cuteclysm. On the other hand, this method may have a considerable impact on the speed of the graphic drawing of the game (right?).

I think I’m going to focus on producing a 512x8192px fallbacks.png with SquareSmallCapsRM font, and then we’ll see. In any case, I’ll upload the new fallback.png to the forum when it’s done.

Thanks Palu. That’s right. I understand that If I manage to create a Square-SmallcapsRM tileset I can define the desired graphic for tall_grass object, but my question in this case was how to define the use of the symbol ’ " ’ with the graphics-off option. Sorry for the confusion. I probably shouldn’t have asked this question in the same post, as it refers to different problems. In any case, my question in this regard, more specifically formulated, is: how (and where) can I define the use of the character ’ " ’ to represent an object in game-map (with "graphics-off " mode), if java-script does not allow me to use the ’ " ’ sign as non-javaScript sign? I have tried to solve this question by reading the online java-script manual, but without success (true that I have not spent much time on it).

Don’t use Cutieclysm as a base. Use ASCIITiles as a base. It has fewer tiles defined, which means it uses fallback.png more.

If you want to go around creating an entire tileset from scratch, use compose.py. That is what is for: to manage the game entity to sprite offset relationship so you don’t have to.

Thanks for clarifying the question.

A search for “json escape quote” returned this in the first post listed:
Double quote is replaced with "

so that’s what I would try (“escaping” is a way that’s used in various circumstances such as coding and text formatting to insert/display something that typically has an inherent meaning in the context [sorry if that was too basic for you, but I hope it might be useful for someone, at least]).