Grid Sage Forums

REXPaint => Everything REXPaint => Topic started by: Ununsept on July 24, 2020, 08:39:50 AM

Title: REXPaint art for CDDA
Post by: Ununsept on July 24, 2020, 08:39:50 AM
Prepare for a long post. Well, maybe it's not so long since I've hidden the images under spoiler tags.
Some time ago I was playing Cataclysm: Dark Days Ahead a lot. Since it's open source, I decided to contribute to the project. I found out that someone implemented a system where ASCII art can be shown under the description of an item (probably inspired by Cogmind), but only a couple of items had pictures. I figured out it wouldn't be to hard to make some more since CDDA has so many items that I can make ASCII art for almost anything. But there are also some limitations for implementing ASCII art in CDDA: it can't be wider than 41 columns, I'm limited to rectangle font, and color palette is rather limited. It should be noted that I used REXPaint for all pictures, but the fancy text was copied from text to ascii generator and pasted in notepad, I'm not masochistic enough to do it manually in REXPaint. I also added some additional characters in some cases. Anyway, here's what's I made so far (all the screenshots are taken directly from the game):
Chemistry textbook
Spoiler (click to show/hide)
Deputy Badge
Spoiler (click to show/hide)
Electrohack (does what it sounds like - hacks electronic devices. I saw some picture in this thread with the binary thing and I really wanted to do something like that.)
Spoiler (click to show/hide)
First aid kit
Spoiler (click to show/hide)
Lajatang
Spoiler (click to show/hide)
mp3 player
Spoiler (click to show/hide)
pack with cigarettes - I did this only for this joke :P
Spoiler (click to show/hide)
SD card
Spoiler (click to show/hide)
Big book of first aid
Spoiler (click to show/hide)
Thermometer
Spoiler (click to show/hide)
Umbrella - I think this one came out really nice, I like the colors
Spoiler (click to show/hide)
Wristwatch
Spoiler (click to show/hide)
Halberd
Spoiler (click to show/hide)
I have never dome ASCII art before so the pictures are of varying quality, but I'm generally satisfied with them. One of the most useful features of REXPaint that I didn't notice initially was exporting to BBcode. The way colors are indicated in the game code is similar to BBcode, except < and > are used instead of [ and ], and color names are different. So manually coloring pictures like umbrella (see above) where colors change 7 times per line would be painful. Thankfully if I export to BBcode I can set the colors in a minute using replace option in notepad++. So thanks for this option. Right now I've lost some interest in CDDA so I haven't done anything new in a while, but doing ASCII art seems fun so I might get back to it soon. The CDDA community seems quite enthusiastic about adding ASCII pictures to the descriptions.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 24, 2020, 04:37:42 PM
Oh nice these are really great! Thanks for sharing, I laughed at the cigarettes :P

So I guess no one else is actively working on adding art for items, eh?

Will these be added to the main branch, do you think? Or maybe already were? I can imagine the community being interested in this, as you say, which at least can be motivating :)

And good to hear someone's getting real use out of the BBCode export! I added it just for fun back when I was using forums a lot, but even on forums people would generally just use image exports anyway :P (more control over the final appearance, after all, rather than leaving it to the forum software and/or browser)
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 25, 2020, 04:15:42 AM
These were merged about 2 weeks ago, so they can be already seen on experimental builds. And yes, I'm the only one who's working on ASCII art. There was one guy who added a bunch of items a few months ago but that's it. I guess people have a lot of other work, like fixing game breaking bugs - there's plenty of them after the nested containers update, and there are always great new features planned. On the other hand, ASCII art does look cool so who knows, maybe someone will add more.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 25, 2020, 05:25:20 AM
Ah cool, I imagine more will get added over time, yeah. Also perhaps if enough people know that you can do it without too much trouble using REXPaint, more might get made? I guess it would help if you also shared a little guide and/or the REXPaint-CDDA palette you've presumably put together to make it easier. Just thoughts on how to get it filled out more quickly :)
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 25, 2020, 02:51:10 PM
I haven't even thought about making a custom palette, I just set colors that are somewhat similar to ones found in the game, but it might be helpful to make a custom palette, it would with visualizing how the picture will look. I mentioned that I used REXPaint in my pull requests, but it's definitely a great idea to put a guide in the documentation. People should know that there's a way to automate the coloring, maybe it's not very useful for simple pictures but for ones with multiple colors it saves you a lot of tedious work. Before I found out I could do it I spent more time putting my art into game than actually making it.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 25, 2020, 04:27:38 PM
Makes sense, lowering the barrier to entry is important with something like this. Honestly if this would become something that more people might use, or that you intend to do a fair bit more of, I'd be open to adding a dedicated method for exporting the art in CDDA's format, if that would be feasible which it sounds like it is.

And I mentioned a palette since you said the CDDA colors are limited, in which case it often helps to have a dedicated palette, yeah.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 26, 2020, 02:50:57 AM
Thanks for your offer, it's really nice of you! It probably isn't some high priority issue but it would save a few minutes in notepad++. Altough I guess it doesn't make much sense without a custom palette, so I'd have to make it first. There's also one thing that would be really cool to implement but I'm not sure how to do it. I want to add unifont font, which is the font used in the game. I have a .ttf file but I'm not sure what to do next. Currently I'm using a font with same proportions as unifont and when I want to check how it'll look ingame I export the image to .txt and check it in notepad in unifont. It'd be great to be able to see how it'll look as I draw it.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 26, 2020, 05:57:50 AM
There's also one thing that would be really cool to implement but I'm not sure how to do it. I want to add unifont font, which is the font used in the game. I have a .ttf file but I'm not sure what to do next.
Indeed it would be best to be able to see the actual results using the target font! REXPaint uses bitmap fonts so you'd have to take the ttf font and use it to create a PNG file* with the necessary characters in the CP437 layout. You can look at the other included fonts to see how they're done. Creating a bitmap font can be a fair amount of work, though.

It gets faster once you've done it before, and even faster if you've set up some kind of workflow and tools for doing it, but in the end it will still take a good amount of tweaking and repetitive work :P

*(via some other software--I use Photoshop but other people have their own tools that they're familiar with)
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 26, 2020, 07:16:42 AM
That seems like a lot of work, maybe I'll do it in the future (but definitely far future). Anyway, in case you want to implement exporting to format readable by CDDA, here's how color tags work: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/JSON_INFO.md#ascii_arts
And here are the color names: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/COLOR.md
So exactly like BBcode, but with different brackets and color names instead of hex values. I don't know if you'll need it but I attached a color palette with these colors.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 26, 2020, 07:30:17 PM
I see, so it's basically a standard set of terminal colors.

Seems like one of the complications that make it less straightforward is the ability to also use background colors which are combined into the same string name. Easy enough, though I don't recall seeing any examples in your art in particular.

Some conflicts/questions:

- The sample you linked for ASCII art uses "color_" as a prefix, but the format specification only lists "c_" as a valid prefix, not "color_"
- Technically CDDA art can specify the "i_" and "h_" prefixes, although I guess REXPaint can't do that (not sure what they really do in game, either--why invert the foreground and background color like that? is there some other meaning? the specification just says "special rules will be applied")
- It seems implied but not explicitly stated that perhaps any time a background color is not specified, that color will be black, eh?

Anyway, could probably do this, just most importantly need to know what the proper color prefix is. That said, the specification even says the prefix isn't even necessary, which would be nice for reducing file size--so can that just be ignored entirely? For example the sample art could really just be:
Code: [Select]
    "picture": [
      "",
      "",
      "",
      "       <white>╔═══════════════════╗",
      "       <white>║                   ║",
      "       <white>║</color> <yellow>╔═   ╔═╔═╗╔═║ ║</color>   <white>║",
      "       <white>║</color> <yellow>║═ ┼ ║ ║═║╚╗║═║</color>   <white>║",
      "       <white>║</color> <yellow>╚═   ╚═║ ║═╝║ ║</color>   <white>║",
      "       <white>║                   ║",
      "       <white>║   RIVTECH TRUST   ║",
      "       <white>║                   ║",
      "       <white>║                   ║",
      "       <white>║ 555 993 55221 066 ║",
      "       <white>╚═══════════════════╝"
    ]
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 27, 2020, 05:42:48 AM
I tried applying different prefixes to ASCII art color tags, but apparently only <color_colorname> works. I could get other prefixes or background colors to work by adding them after the "color" prefix i. e. <color_light_gray_light_red> or <color_i_red> but they produce errors regarding line length. If I wanted it to work without errors I would have to ask a coder to fix it, but I'm not sure if I even need that. As you said somewhere previously background colors make the art look "blocky" and I did fine without them. So because background colors don't work you shouldn't implement them. Also while we're discussing reducing the file size reduction, BBcode export sets a color for spaces (black), which is unnecessary because spaces look the same no matter the color. It makes the file look a bit messed up because there are tons of unnecessary color tags. And the last step in automation of the export process would be wrapping the lines in " at the beginning and ", at the end. The " at the beginning can be applied in a few seconds using "column mode" or whatever it's called in a text editor, but adiing ", at the end it takes more time because lines usually have different lengths thanks to the color tags. They can be easily added in REXpaint but then they are treated as a part of the image and will be colored. They could be applied automatically before and after each line. ", could also be applied at the point in line where there's nothing but spaces after it and then the spaces would be deleted, but that would probably take more work and the previous solution works fine assuming the user resizes the canvas width to 41 characters, which he should do anyway if he makes art for CDDA. The last line should be without comma at the end, but that would again require a solution with detecting empty space or user resizing the canvas. Honestly it doesn't matter that much, the user could just delete the comma manually. Also I realized the example is kinda misleading, the color tags don't have to be applied every line if the color doesn't change. It could look like this:
Code: [Select]
"",
      "",
      "",
      "       <color_white>╔═══════════════════╗",
      "       ║                   ║",
      "       ║</color> <color_yellow>╔═   ╔═╔═╗╔═║ ║</color>   <color_white>║",
      "       ║</color> <color_yellow>║═ ┼ ║ ║═║╚╗║═║</color>   <color_white>║",
      "       ║</color> <color_yellow>╚═   ╚═║ ║═╝║ ║</color>   <color_white>║",
      "       ║                   ║",
      "       ║   RIVTECH TRUST   ║",
      "       ║                   ║",
      "       ║                   ║",
      "       ║ 555 993 55221 066 ║",
      "       ╚═══════════════════╝"
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 27, 2020, 05:21:11 PM
Update: I've added the font used in the game! Was tedious but super easy. I've attached it so you can add it to resources if you want to.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 28, 2020, 01:27:20 AM
Also while we're discussing reducing the file size reduction, BBcode export sets a color for spaces (black), which is unnecessary because spaces look the same no matter the color.
Ah okay, I'll remove that, thanks.Edit: Hm, no wait, I think it'll stay that way because it makes the exporting code a ton more complex to have to also consider characters in the midst of its color RLE algorithm xD

The " at the beginning can be applied in a few seconds using "column mode" or whatever it's called in a text editor, but adiing ", at the end it takes more time because lines usually have different lengths thanks to the color tags.
Note you can do the entire thing really fast in any editor that offers macro recording. Like I use Notepad++ for much of my editing, and it could update an entire image with the proper formatting in a matter of seconds. Not that you'll need it once REXPaint can output this format, just mentioning for the meantime :)

the previous solution works fine assuming the user resizes the canvas width to 41 characters, which he should do anyway if he makes art for CDDA.
Indeed, the export format should be applied properly as if the entire image is to be used, so resizing the image (and really the canvas via the settings so that it uses the required dimensions as default) should be required of the user.

Update: I've added the font used in the game! Was tedious but super easy. I've attached it so you can add it to resources if you want to.
Oh awesome, thanks for that! Will be adding this to the resources.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 28, 2020, 02:43:22 AM
I could get other prefixes or background colors to work by adding them after the "color" prefix i. e. <color_light_gray_light_red> or <color_i_red> but they produce errors regarding line length. If I wanted it to work without errors I would have to ask a coder to fix it, but I'm not sure if I even need that. As you said somewhere previously background colors make the art look "blocky" and I did fine without them. So because background colors don't work you shouldn't implement them.
So you did get background colors to technically work (as in they're okay to have in the file), they just produce errors for now? As in they don't stop execution or anything? Technically I should include those in the implementation since they're part of the specification, even if the code is not yet ready.

Some artists can do really nice things with background colors, and depending on how use them they can be very useful. (I have indeed mentioned before in my art guide that I generally avoid them for the type of line art that I do, but they definitely come in handy sometimes, and would even more so for the huge variety of art needed in CDDA.)

Would be a good idea to let them know about this issue, since I'll be including C:DDA export support in the next official release of REXPaint (soon!), and this could potentially attract more interest in creating art for it (or it could be the impetus for doing so :P), since I'll be announcing that around.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 28, 2020, 04:01:46 AM
I just did more extensive testing regarding the background colors and I've found out a few things:
1. Some color combinations work fine except for line length errors in some cases.
2. Some color combinations don't seem to exist? Apparently if color pair doesn't exist in https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/color.cpp, it can't be used.
3. Background colors don't carry on between the lines, so they have to be typed every new line like in the example art (not that much of a problem thanks to "useless" color tags for spaces).
I'm gonna do some more testing and then submit an issue on GitHub and hopefully someone will work on it. For now the option to export background colors can just sit there and wait until something changes.
Anyway, I'm pretty hyped for the new release, I think I'll have to celebrate by making new art and posting a guide for using REXPaint for CDDA!
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 28, 2020, 05:33:37 AM
3. Background colors don't carry on between the lines, so they have to be typed every new line like in the example art (not that much of a problem thanks to "useless" color tags for spaces).
Ah, well not an issue for converting the existing BBCode format, but it would definitely be an issue for the new export I just finished working on! I've got a new dedicated C:DDA export feature (ctrl-j), but it sounds like it's hard to call it official if there are so many issues...

I guess it can be assumed background colors should behave as foreground colors do, wrapping to new lines etc? And although people just can't use them via REXPaint yet, the feature will be available once it's ready.

Anyway, I'm pretty hyped for the new release, I think I'll have to celebrate by making new art and posting a guide for using REXPaint for CDDA!
Yeah this would be great! Definitely drop a note here in the thread when you do, both so that I know and can also probably link it from elsewhere.

I'm about done with this feature, but went out to dinner so hadn't gotten to the testing part yet. Was going to get you a build to test, too, to see if it's good enough to include in v1.50 proper. (I'm not set up to test it within CDDA itself, and can only base things on the specifications and examples I've seen so far.)
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 28, 2020, 06:03:59 AM
Quote
I guess it can be assumed background colors should behave as foreground colors do, wrapping to new lines etc?
I guess so, I think the developers simply didn't even consider someone would use background colours. I'll let you know if background colours get fixed.
Make sure to send me a test build, I'll gladly test it when I'll have time.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 28, 2020, 06:51:00 AM
I've sent you a test version of the current state via PM.

I discovered that it's not entirely clear how background colors would be handled if they change from the previous color. Overall there needs to be more examples and guidance on the specifications there :/

So far it errs on the side of always including the foreground and background color whenever either changes since the last time it was set. Also empty lines actually include all their spaces rather than the shorthand method. In any case, let me know how the current approach works out for you!
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 28, 2020, 11:37:30 AM
Quote
I discovered that it's not entirely clear how background colors would be handled if they change from the previous color. Overall there needs to be more examples and guidance on the specifications there :/
So far it errs on the side of always including the foreground and background color whenever either changes since the last time it was set.
I'm not sure what you mean exactly, are you asking if for example in this case
Code: [Select]
"<color_white_red> A </color><color_green> B ",background of B would be black, because background is not specified, or red because the previous background was red? The answer is that B would be black. If color of the background isn't specified, it won't be colored (or it will be black? Which is the same thing anyway).
I noticed that if the background color is black, then it's exported as <color_colorname_black>. This generally doesn't work in CDDA, instead it should be simply <color_colorname>, which has the same visual effect but is actually accepted by the game.
Other issue related to background colors is that if I set a background color with space glyph, it will be exported as if every space until next color change had that background color. As a workaround it's possible to use the █ glyph instead, which has exactly the same visual effect.
I noticed I've made a mistake in the color palette with light_cyan color, I've attached a fixed version (the manual should be updated to include that).
Maybe it's nitpicking but it should be made clear in the manual that ASCII art for CDDA doesn't have to be exactly 41 columns long, it simply can't be longer.
Also it's not exactly CDDA related but it might helpful for users with small screens. It existed in previous versions too: if your screen is small and font height is big, then the program window will not fit on your screen. It's not a problem for square font users because they can just change the font to a smaller one, but with rectangle fonts proportions are different, so art will look different. I wouldn't even write about that if it wasn't for the fact that instead of appearing exactly on top of your screen and "cutting out" the bottom part which doesn't contain anything extremely important if you don't care about layers, a bit of the top part is cut out too, preventing you from browsing images (which is rather important). So it would be cool if the program window had its top exactly at the top of user's screen. Not like there's not a workaround (at least it works this way on windows 10, idk about other systems): you have to shift-RMB on the REXPaint icon on the taskbar, click "move", then press down arrow key on your keyboard until the top of the window is visible. You may be wondering why I don't consider selecting images at the bottom of the browsing list important? Because I've got another workaround for that. Simply make a bunch of empty images and name them "zzz1", zzz2" etc. until they fill the bottom of your image list.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 28, 2020, 02:53:14 PM
Also an issue that's present both in this and previous versions: whenever I set canvasWidth to less than 42 in config file the program changes it to 42, and I have to set it manually every time I open it.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 28, 2020, 08:27:04 PM
background of B would be black, because background is not specified, or red because the previous background was red? The answer is that B would be black. If color of the background isn't specified, it won't be colored.
I noticed that if the background color is black, then it's exported as <color_colorname_black>. This generally doesn't work in CDDA, instead it should be simply <color_colorname>, which has the same visual effect but is actually accepted by the game.
Yep, wasn't sure whether to do it that way or not. So it's apparently assumed the background is black if not specified. Really the specifications are way too slim on details xD

(or it will be black? Which is the same thing anyway)
Exactly part of the problem with the specification not including any details here, since I don't know if it's possible to change the default background color in CDDA, and if so then would CDDA then treat any art's unspecified background color as the new default? Or would black then be actually black as specified by the art??? :P

I.e. can you force a black background in art? Ideally this should actually be possible for ANSI art that might appear on a different background, since the visual effect can be significantly different. And which way it's handled makes a difference for the implementation... That said, considering CDDA is using a 16-color terminal, it's likely enforcing black or whatever color replaces black as the default background no matter what, regardless of what that might do to an image. So I guess it's safe to assume that's the case.

Honestly the color encoding for CDDA seems rather weird. Back to the example you provided:
Code: [Select]
"<color_white_red> A </color><color_green> B ",What if we wanted to change only the background color, but retain the same foreground color as before? The lack of differentiation between the two in a string means that you then have to restate the foreground color, I guess,e.g.
Code: [Select]
"<color_white_red> A </color><color_white_green> B ",in order to change the background while keeping the foreground white.

Also it's not exactly CDDA related but it might helpful for users with small screens. It existed in previous versions too: if your screen is small and font height is big, then the program window will not fit on your screen.
As a terminal program with a minimum static row count, this is just how REXPaint works--a large screen is required for larger fonts, though the manual describes a setting that offers a partial workaround for those who don't mind having negative side effects. (2.0 will likely be different since the UI will be more flexible.)

Also an issue that's present both in this and previous versions: whenever I set canvasWidth to less than 42 in config file the program changes it to 42, and I have to set it manually every time I open it.
Ah true, this is actually the minimum default canvas size allowed by REXPaint in order to fit certain UI elements (this is indicated in the context help for that setting in the options menu). I'd forgotten about the relevant settings and should update the new CDDA Appendix to point out that it's not default canvas size that should be updated, but Default Image dimensions (also found in the options menu). That's what should be set to 41 in order to make editing more convenient.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 28, 2020, 08:48:21 PM
Updated the build with new export behavior, same link I sent before.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 29, 2020, 04:44:25 AM
Yes, the game "forgets" the colors from previous color tags once you enter a new one, so you have to define foreground and background color (if any) in every color tag. Also regarding the background color if unspecified: if you change your black color to something else (cyan in this example), this is how it looks like:
(https://i.imgur.com/UpMOsaR.png)
So the spaces whose color was specifically set to black changed their background color (note how the ones at the beginning don't because their color is unset), but everything else has the "true" black background. So changing black color only affects things that have their color set to black.
I see that the color tags for spaces are back, I assume it's the price we had to pay for fixing the issue with spaces with background colors? If it's possible to add color tags for spaces only when it's absolutely necessary it would be really nice because it would make the text file image more "clear". If you can't do that then alternative would be to add 2nd option to export with the previous system where spaces with background colors don't work as intended but you get a nice, clear text file.
Overall it seems to be working fine, I exported an image and put it into the game. But while I was doing it I remembered one thing: single \ in game file  is treated as if it didn't exist (I think it has something to do with json in general?). The solution is to replace every \ with \\, which will display \. 2 backslashes will be treated as one character for purposes of line length calculations and the solution works fine also if you want multiple backslashes.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 29, 2020, 09:25:31 AM
Also can you tell me which section of the manual describes this workaround setting ? I've read all the sections except for the layers but I couldn't find it.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 30, 2020, 05:19:14 AM
I see that the color tags for spaces are back, I assume it's the price we had to pay for fixing the issue with spaces with background colors? If it's possible to add color tags for spaces only when it's absolutely necessary it would be really nice because it would make the text file image more "clear". If you can't do that then alternative would be to add 2nd option to export with the previous system where spaces with background colors don't work as intended but you get a nice, clear text file.
Maybe it's not necessary at all? I mean I'm not really sure what's absolutely necessary based on the specification since it's so sparse, and I don't have a CDDA setup to test with so I'm relying entirely on you xD

What if just every instance of "<color_black> ... </color>" is just removed from the file. Does it work then? And in that case do we even need to care if it's spaces or another character? Like, literally just removing every one of those pairs would be okay?

Overall it seems to be working fine, I exported an image and put it into the game. But while I was doing it I remembered one thing: single \ in game file  is treated as if it didn't exist (I think it has something to do with json in general?). The solution is to replace every \ with \\, which will display \. 2 backslashes will be treated as one character for purposes of line length calculations and the solution works fine also if you want multiple backslashes.
Ah, okay I wasn't aware this was going to be an issue. Yeah backslash is a JSON escape character, so I'll have to change the output such that it converts that to two characters, no problem.

Also can you tell me which section of the manual describes this workaround setting ? I've read all the sections except for the layers but I couldn't find it.
It's in the Options section under Customization. It describes the "unlimitedFontSize" setting.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 30, 2020, 06:06:12 AM
I don't see any difference between unlimitedFontSize 0 or 1, manual says
Quote
Setting this value to 1 loads all fonts, even those which will allow extreme zooming where it produces a window which doesn't fit on the screen!
But I can load the same fonts (many of which indeed don't fit on the screen) on either setting .
About the black color tags: yeah, they are completely unnecessary: for spaces because it doesn't change anything and for other characters because well, why would I want to draw anything in black if it's gonna look like an empty space anyway?
Just make sure to include </color> after spaces with background color right after the color ends, which was a problem before because I guess the black color tags for spaces were ignored.
Also some news about in-game implementation of background color tags: they actually don't produce errors about line length, it's just that every color tag counts towards the character limit if you don't close it properly and I didn't notice it because color tags without background colors are shorter (but it's getting fixed anyway). The issue about adding colors to the next line in some pictures exists, and in some it doesn't. What's more interesting, I shared a json with the issue with a dev and he said it worked fine in his case ¯\_(ツ)_/¯
About more background colors: it can be done, but apparently it might not work on some terminals https://linux.die.net/man/3/init_pair (https://linux.die.net/man/3/init_pair)
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 30, 2020, 06:22:45 AM
About the black color tags: yeah, they are completely unnecessary: for spaces because it doesn't change anything and for other characters because well, why would I want to draw anything in black if it's gonna look like an empty space anyway?
Yep, just originally wasn't sure how CDDA renders things like the terminal background.

I'll have a newer version later. Time for bed!

I don't see any difference between unlimitedFontSize 0 or 1, manual says
Quote
Setting this value to 1 loads all fonts, even those which will allow extreme zooming where it produces a window which doesn't fit on the screen!
But I can load the same fonts (many of which indeed don't fit on the screen) on either setting .
Hm, this is an unrelated issue to what we're doing here, but it might be because the unreleased v1.50 you have contains an issue with the font size calculations? I rewrote a bunch of that in order to support unlimited numbers of characters in fonts, and thought I fixed any new bugs in all cases, but perhaps not.

You're not supposed to be able to load fonts that will produce a REXPaint window larger than your display (unless your display is smaller than the first/default font size you have set in the config, but that is unlikely unless you've also been removing things in your copy).

Have a copy of the run.log file from your REXPaint directory? That will show your resolution and what fonts are loading, and I could take a look at what's happening.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 30, 2020, 10:37:37 AM
I attached the run and _config.txt files . I see that only CP437 20x20 exceeds resolution (and can't be used, I think? Hard to tell when the font name is outside the screen). I assume that the max resolutions are the same as defined in data\fonts\_config.txt? If that's true then they're probably wrong because my resolution is 1920x1080 and any font higher than 12px is bigger than my screen. Which is rather weird now that I think about it, because if you assume that window height is font height*60 then the resolutions should be correct (if you don't take the top bar into account).
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 30, 2020, 02:33:16 PM
I've updated the CDDA export download (same link). It now has escaped backslashes so those will work normally, and I removed extra black tags. As long as everything works in its current form maybe it's done?

I assume that the max resolutions are the same as defined in data\fonts\_config.txt?
No, max resolution is not defined anywhere because there's no need to explicitly define it. There are some comments in the config file, but that's it. But anyway, found that there's apparently still a bug in the new font loading process so I'll have to address that before release.

I attached the run and _config.txt files . I see that only CP437 20x20 exceeds resolution (and can't be used, I think? Hard to tell when the font name is outside the screen).
Your run.log looks normal. With a 1080p screen 20x20 is the only font that should not fit, and indeed it should not be loading unless you have unlimitedFontSize set to 1.

Myself and other users have tested this and it's working normally, not sure what else is going on here. What do you mean by "Hard to tell when the font name is outside the screen"? Open the options menu (F3) and the loaded/available fonts are listed in the Font selection. And I guess attach a copy of your REXPaint.cfg file.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 30, 2020, 03:13:41 PM
(Edited/updated the previous post because it originally contained incorrect info.)
Title: Re: REXPaint art for CDDA
Post by: Ununsept on July 31, 2020, 05:20:12 AM
With a 1080p screen 20x20 is the only font that should not fit
That's the problem, 14x14 is exactly the height of my screen:
(https://i.imgur.com/XAyuaf6.png)
and anything bigger doesn't fit, but only 20x20 can't be selected. I attached all the files from the newest version.
As for the CDDA export, it works and I'm glad that black color tags are gone, but now a sample picture looks like this:
Code: [Select]
"                                         ",
      "                <color_light_gray>|\\</color>                       ",
      "                <color_light_gray>|</color> <color_light_gray>\\</color>                      ",
      "                <color_light_gray>|</color>  <color_light_gray>\\</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "                <color_light_gray>|</color>  <color_light_gray>|</color>                     ",
      "               <color_dark_gray>(____)</color>                    ",
      "                <color_dark_gray>[__]</color>                     ",
      "                <color_dark_gray>[__]</color>                     ",
      "                <color_dark_gray>[__]</color>                     ",
      "                <color_dark_gray>[__]</color>                     ",
      "                <color_dark_gray>[__]</color>                     ",
      "                <color_dark_gray>[__]</color>                     "
and it would be better if it looked like this:
Code: [Select]
      "                                         ",
      "                <color_light_gray>|\\                       ",
      "                |\\                      ",
      "                |  \\                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |                     ",
      "                |  |</color>                     ",
      "               <color_dark_gray>(____)                    ",
      "                [__]                     ",
      "                [__]                     ",
      "                [__]                     ",
      "                [__]                     ",
      "                [__]                     ",
      "                [__]</color>                     ",
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 31, 2020, 08:39:54 PM
and it would be better if it looked like this:
Hm, could be more complicated, but anyway I guess the idea there is that spaces without any explicit background can't reset the color in any way. I'll look at it, thanks for the specific example.

That's the problem, 14x14 is exactly the height of my screen and anything bigger doesn't fit, but only 20x20 can't be selected.
Ah okay, then this isn't a bug, just what happens when you have DPI scaling enabled. REXPaint normally tries to deactivate it, but it would appear your OS is forcing it on the program anyway. REXPaint's engine reads the actual pixel dimensions of your display settings and bases font loading on that--it doesn't know anything about scaled DPI effects and can't compensate for it. (To confirm, you will also be seeing this effect in REXPaint v1.04, which has the same behavior.) Your screenshot does appear to be showing REXPaint with DPI scaling applied, as it's not pixel-perfect like the original fonts. Without DPI scaling your display will be able to comfortably use larger REXPaint fonts that also look more precise.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on July 31, 2020, 09:05:16 PM
Okay, updated the download again, which should produce a simplified format mostly like that in your last example.

One exception I'm not sure about in terms of how the CDDA code might treat it is that the final color tag in that example will not actually be closed, since there's no way to predict what will come after it during the writing process and therefore the only way to address that would be to output it into a buffer and retroactively edit it, but that seems excessive since I'm guessing not closing the final color tag probably doesn't even matter.

Anyway, maybe this is final version? :P
Title: Re: REXPaint art for CDDA
Post by: Ununsept on August 01, 2020, 05:04:57 AM
Indeed, this can be the final version! Everything is working correctly and I can't find anything that needs improvement. And yes, color tag at the end is unnecessary.
As for the size problem: windows 10 has a setting "make everything bigger" that's set to 125% by default, which causes REXPaint to scale. I disabled it for REXPaint by right clicking REXPaint.exe>Properties>Compatibility>Change high DPI settings>Override high DPI scaling behavior>Scaling performed by: Application. Maybe add this to the manual?
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on August 01, 2020, 05:29:51 AM
Yay, good to know it's finally finalized xD. Now I can go ahead and release 1.50 next week!

And yeah I thought that information might already be in the REXPaint readme, and checked when I saw your post, but apparently it is not. I guess a long time ago when I added DPI scaling overriding to REXPaint the reports of this issue basically stopped, so I thought it wasn't really a thing anymore. I wonder if something since changed in Windows...
Title: Re: REXPaint art for CDDA
Post by: Ununsept on August 01, 2020, 08:01:47 AM
Thanks for all the work! Also remember to add unifont to the resources before the release, the manual states you can find it there.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on August 01, 2020, 05:47:48 PM
And thanks for all the help! Yep the font is already added to the new site, but I haven't uploaded the new site because it's not officially released yet (you have the prerelease version of the manual :P).
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on August 09, 2020, 03:04:08 PM
Hey Ununsept, now that this version has been officially released (https://www.gridsagegames.com/forums/index.php?topic=1468.0), I was going to also announce the CDDA export feature in some relevant CDDA places, and was wondering if/when you might have some sort of guide for it that I could also link to. You mentioned the possibility earlier which is what made me curious and want to hold off on doing the announcements so far.

If not that's fine, too, and no rush, either :)
Title: Re: REXPaint art for CDDA
Post by: Ununsept on August 09, 2020, 03:48:19 PM
Oh I actually finished it so I might post it soon, I'm thinking about adding it to the CDDA documentation so it might take up to few days before it gets merged, I'll let you know when it does. Just note that this guide is basically installation instructions (including CDDA font and palette) and some basic tips like setting default image width to 41 so nothing groundbreaking, my main intention is to just let CDDA contributors know that there exists a tool that can export their work in a format ready to be pasted into json file. Also unifont still isn't on the resources page.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on August 09, 2020, 06:11:51 PM
Excellent, and no problem about how simple it is, yeah just something else to point people to for more instructions.

Also unifont still isn't on the resources page.
It's there, I put it there last week shortly before the official release--you'll find it down at the very bottom, and if you don't currently see it then your browser is probably using a cached version of the page. Use Ctrl-F5 to force reload the page.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on August 10, 2020, 04:10:09 AM
Oh you're right, for some reason I didn't check the miscellaneous section xD
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on August 10, 2020, 05:38:33 AM
Hehe, yeah the fonts honestly don't have a really great organization there since that page has grown gradually as I've acquired things over the years. Could probably use a revamp, although not super important so I never get around to it, plus it'd probably just get messed up again with yet more new additions that don't quite fit in anywhere anyway :P
Title: Re: REXPaint art for CDDA
Post by: Ununsept on August 11, 2020, 02:29:09 PM
Can you add the CDDA palette to the "resources" page? Someone pointed out that you can't download it without registering and I guess not everyone wants to do it.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on August 11, 2020, 04:00:45 PM
Ah if you're going to be adding an external reference yeah that makes sense. I didn't originally want to do that since it's not really a general-purpose art-focused palette, but it does enable functionality/convenience that a wider group of people might want now...

I've added it to the page, and also updated the online version of the manual to point to its new location.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on August 12, 2020, 10:49:10 AM
The guide has been merged, here's the link: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/ASCII_ARTS.md
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on August 13, 2020, 01:56:49 AM
Awesome, thanks for the link!

Note that the default image dimensions can be set via the options menu (F3 or the 'O' button at the bottom of the tools)--it's not necessary to use the .cfg file for that, although I'm sure most people doing this sort of thing are comfortable with config files anyway :P
Title: Re: REXPaint art for CDDA
Post by: Ununsept on August 24, 2020, 01:13:35 PM
Ok, so I just found out some color tags in COLOR.md are simply wrong. light_yellow should be yellow, light_magenta should be pink, and and "magenta or pink" should be just magenta. I've made a PR to fix that but it hasn't been merged yet. Because color tags in REXPaints are based on COLOR.md, they are also wrong, and should be fixed.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on August 24, 2020, 04:06:51 PM
Oh no, sadness :(

At least this won't affect any .xp files/local REXPaint images, just the output, so any images people have worked with won't really be affected even now. Let me know when it's merged and I'll drop a patch here.

I'll be releasing a 1.51 which could also include this, but that will have to wait until the other recently requested features are done as well--will be released as several patches for testing in the meantime.
Title: Re: REXPaint art for CDDA
Post by: Ununsept on August 24, 2020, 04:35:15 PM
My commit was merged a few moments ago, so the colors in COLOR.md should be correct now.
Title: Re: REXPaint art for CDDA
Post by: Kyzrati on August 25, 2020, 12:58:51 AM
Excellent, thanks for letting me know.

The correct export values will be included in the next release (1.60), but until then, anyone who needs to export CDDA art can download this patch(edit: patch removed since this is now included in 1.60 (https://www.gridsagegames.com/forums/index.php?topic=1486.0)) and simply overwrite your regular install's .exe with this one to apply the fix.