ASCII/Retro tilesets

Well, I tweaked the colors mostly because I don’t like the almost fluorescent greens and magenta, but the text colors are in data/raw you can always change them as you like.

I’ll probably keep updating that version from time to time, but in this case is just tweaks to the tileset, not code. But if you download an incomplete zip it’s because I’m uploading a new one.

http://www.cesspit.net/misc/cataf5.zip

The problem with RetroDays tileset is that he “overdrew” it. All the things look very nice when you look at them on the tileset, but in the game they often look like an unreadable smudge of pixels. The problem is that he uses too much single pixels and sometimes even more than one color, all things that I tried to avoid exactly because they are too small to look good. So at times I tweak his tiles to be more stylized and less detailed, or to use colors with more contrast, or even to remove the reference, so that we get the straight ASCII.

Also changed the item highlight box to be less intrusive I expect many won’t like it.

Understandable and thank you. Also not sure if you knew this but even though the menu screens act a bit glitchy, it seems that driving lags but only tried this out on one world so far. No worries though, still glad you did this. Thanks again.

Seems to be fine in windowed in terms of the menu’s acting weird though.

Is there any chance the ASCII fallback parts of this could be moved into mainline? These changes would be an incredible boon to ALL of Cata, not just for tilesets, but people making new content of any kind; it seems a shame to not use that potential to it’s fullest. I understand the actual tiles part of this can’t be included until we get the red tape out of the way, but until then a lot of people could benefit from the hard work you’ve done on the code side of this.

On a personal note HRose, let me say I’m VERY impressed with how much you’ve been able to accomplish on this by yourself, on a problem that so many people have been unable to resolve for so long. This has become much more than a really cool tileset, it’s a massive improvement to the entire graphics engine.

[quote=“Natures Witness, post:203, topic:3676”]Is there any chance the ASCII fallback parts of this could be moved into mainline? These changes would be an incredible boon to ALL of Cata, not just for tilesets, but people making new content of any kind; it seems a shame to not use that potential to it’s fullest. I understand the actual tiles part of this can’t be included until we get the red tape out of the way, but until then a lot of people could benefit from the hard work you’ve done on the code side of this.

On a personal note HRose, let me say I’m VERY impressed with how much you’ve been able to accomplish on this by yourself, on a problem that so many people have been unable to resolve for so long. This has become much more than a really cool tileset, it’s a massive improvement to the entire graphics engine.[/quote]

I was going to ask the same thing…

[quote=“Zireael, post:204, topic:3676”][quote=“Natures Witness, post:203, topic:3676”]Is there any chance the ASCII fallback parts of this could be moved into mainline? These changes would be an incredible boon to ALL of Cata, not just for tilesets, but people making new content of any kind; it seems a shame to not use that potential to it’s fullest. I understand the actual tiles part of this can’t be included until we get the red tape out of the way, but until then a lot of people could benefit from the hard work you’ve done on the code side of this.

On a personal note HRose, let me say I’m VERY impressed with how much you’ve been able to accomplish on this by yourself, on a problem that so many people have been unable to resolve for so long. This has become much more than a really cool tileset, it’s a massive improvement to the entire graphics engine.[/quote]

I was going to ask the same thing…[/quote]Same here. Nice work, HRose.

Although I’ve been wondering. Looking (more like sneaking a peek) at your code, it looks like you’re essentially generating a tileset for the game to use on the fly. That is, pretty much doing exactly the same thing that Chase’s tileset editor is (now) doing, except done within the game and in C++ instead of Java. Maybe you could reuse some of the algorithms that are used there? (though I suspect you have more of the thing figured out than I have)

Even if this took hours and hours and hours in the last few days, I’ve written something like three lines of stupid code.

I’ve simply merged the content of the ASCII png into the tileset png so we just load one. Then used this chunk of code written by someone else to retrieve symbol+color of an object:

bool fuck = false; long sym = 0; nc_color col = c_white; if (it == tile_ids->end()) { if (category == "furniture") { if (furnmap.count(id) > 0) { const furn_t &f = furnmap[id]; sym = f.sym; col = f.color; fuck = true; } } else if (category == "terrain") { if (termap.count(id) > 0) { const ter_t &t = termap[id]; sym = t.sym; col = t.color; fuck = true; } } else if (category == "monster") { if (MonsterGenerator::generator().has_mtype(id)) { const mtype *m = MonsterGenerator::generator().get_mtype(id); sym = m->sym; col = m->color; fuck = true; } } else if (category == "vehicle_part") { if (vehicle_part_types.count(id.substr(3)) > 0) { const vpart_info &v = vehicle_part_types[id.substr(3)]; sym = v.sym; col = v.color; fuck = true; } } else if (category == "field") { for(int i = 0; i < num_fields; i++) { if(field_names[i] == id) { sym = fieldlist[i].sym; col = fieldlist[i].color[0]; fuck = true; } } } else if (category == "item") { if (item_controller->has_template(id)) { const itype *i = item_controller->find_template(id); sym = i->sym; col = i->color; fuck = true; } } }

It basically goes through the categories and takes out the values. Since I didn’t know those structures were available, or even existed, I couldn’t have written that piece of code.

Then I simply override the tile value before the draw function is called:

if (fuck) { int whatc = color_to_int(col); if(sym > 256 || sym < 0) sym = 666; if(whatc > 15) whatc = whatc % 16; display_tile->fg = 1744 + sym + (256 * whatc); display_tile->bg = 0; if(sym == 666){ display_tile->fg = 54; } }

This last bit is the piece of code I made. The basic formula takes 1744 (where the ASCII tile starts), the symbol which is the number of the ASCII, and then 256*whatc that is basically an offset for the color.

So right now the ASCII fallback itself would only work on the tileset I use. If you load a different tileset it wouldn’t have an ASCII png and wouldn’t work properly. Even if you added ASCII into a tileset it wouldn’t work because the code uses hardcoded numbers.

I doubt this will be included in mainline anytime soon, because the code needs to be fixed and they didn’t even like how I made it work.

The “history” of this thing is here: https://github.com/CleverRaven/Cataclysm-DDA/issues/4236

New build with lots of changes on top of the latest experimental. The default changed: if you boot the game as it is you see the full ASCII fallback in action.

If instead you want to have the tileset you have to copy the content of the “/gfx/RetroDaysTileset - full” over to the standard “RetroDaysTileset”.

http://www.cesspit.net/misc/cataf6.zip

New test version:
http://www.cesspit.net/misc/catatileless.zip

This is entirely WITHOUT tiles. It’s just ASCII rendering as in straight ASCII mode, but it loads by default Terminus font for the UI and a 9x9 font for the map.

I’ve included various other fonts for the map 8x8, 9x9, 10x10, 15x15. To switch them you have to edit data/fontdata.json

Okay, so after a brief test run (which involved a random new character finding three gunshops back-to-back on the edge of the city… much shooting ensued), here’s what I think.

Mighty well done! :slight_smile:

The bonus here (compared to my “implementation” :P) is that it allows you to choose your color scheme, and the colors look quite nice (even if they take a bit of getting used to). Plus of course it’s blisteringly fast (but no zoom :frowning: ), and doesn’t require much doing to use.

Of the downsides (besides no zoom), I can note that it doesn’t seem to use altered tiles for walls? Is that a limitation, or will it also be worked out later?

On my end, it suffers from the same slowdown the experimental does. Is it related to viewport size or something? Although 0.A on the same settings runs quickly…

EDIT: Reducing the viewport size slightly solved the problems.

Yeah, the same issues affecting ASCII affect this mode. So it can get slow on a big window and there’s no zoom.

I wasn’t even aware of a zoom mode.

And the wall tiles?

All code is merged, so both ASCII png and ASCII fallback are in the last experimental.

This is a small package that includes the required .dlls (otherwise you’ll get crashes) three ASCII sets (9x9 used by default, a 8x8 and a 15x15), and my last tweak of RetroDays tileset with built-in ASCII fallback. Plus my color definitions.

By default the game will run in a 1120x736 window with standard Terminus font for UI and a 9x9 ASCII set for map graphic. To switch to graphic tile just use the game option.

To switch UI or map font you have to edit /data/fontdata.json
To change default colors /data/raw/colors.json

http://www.cesspit.net/misc/asciitile.zip
The file should be unzipped in the main Cataclysm directory after you unpack the latest experimental: http://ci.narc.ro/view/Cataclysm-DDA/job/Cataclysm-Matrix/Graphics=Tiles,Platform=Windows/lastSuccessfulBuild/

Do ASCII png and tileset png where tile size is different work with each other?

In this package the ASCII png is used on the map, so it replaces tiles. As I said by default it’s Terminus on text, ASCII 9x9 on the map.

If you use tiles you don’t need any ASCII png, you use the tiles png.

Bump.

What needs to be done to get this tileset in an official release? I work full time as a C++ developer, I’d be happy to help.

I don’t think this is working with the latest experimental. Tried writing the original experimental and the game doesn’t start. I noticed a file logg.txt that says:


Initializing SDL Tiles context
Attempting to Initialize JSON and TILESET path information from [gfx]
JSON path set to [gfx/RetroDaysTileset/tile_config.json].
TILESET path set to [gfx/RetroDaysTileset/retrodaystiles.png].
Attempting to Load JSON file

Never mind, I’m an idiot. Was downloading stable, not experimental.

will you post an updated 20x version ?

Not sure if it’s exactly what you’re after, but I updated this tileset as ‘RetroDays’; 10x and 20x versions.