ASCII/Retro tilesets

[quote=“HRose, post:136, topic:3676”]As far as I’m concerned I’m not doing any more work until devs support the features I’ve asked (as I’ve said again and again).

Since it won’t happen you can do whatever you want with what’s left. My attention is elsewhere.[/quote]

I’m glad you don’t mind; thanks. :slight_smile:

Holy yikes you’re not kidding; look at that. I’ve got my work cut out for me.

That sounds cool; looking forward to that.

I need a mode where it displays exactly what you see in ASCII. We are a long way from that.

I don’t need “grouping”, I need the fallback to look to the specific object and check both its glyph and color, and display that.

I need a mode where it displays exactly what you see in ASCII. We are a long way from that.

I don’t need “grouping”, I need the fallback to look to the specific object and check both its glyph and color, and display that.[/quote]As far as I’m aware the new SDL2 build will do exactly that. Also, assuming Chase’s tileset editor goes opensource or he himself adds that feature, we would be able to just auto-pad the missing tiles with matching ASCII as a temporary measure in the meantime.

The problem isn’t generating the .png, but generating the tile_config.json as stuff is constantly added or modified.

The problem isn’t generating the .png, but generating the tile_config.json as stuff is constantly added or modified.[/quote]Since the program scans all .jsons in the game folder and can create a list of missing tiles - and then fill those missing tiles with exact ASCII replicas of the console version, adjusted for your preferred ASCII bitmap tilepage (not currently, but it’s definitely doable) - I don’t think that’s a problem.

Just keep working on tiles as you need, then anytime you do a release, just copy your set, run the program’s ASCII generator for missing tiles, and you have a complete set. If anything is added, say with a mod, all anyone would have to do is run the program on the tileset again. It does generate the .json file for the tileset, that’s the only reason I started playing again - I couldn’t bear to play with so many missing tiles before, and the console version refused to cooperate with square-shaped tiles of non-obnoxious size - and now I’ve generated the missing tiles, and, in absence of that function I mentioned, manually replaced all generated creature tiles I could see with colored ASCII from your example sheet. So far it works like a charm - I’m no longer chased around town by angry blue sharps.

Here is what I’m playing with now. A lot of the item graphics are not replaced, and some creature tiles are inaccurately colored (light pink and light grey are easy to mistake for white at that size), but it’s miles above the existing versions of either ASCII/Retro or the RetroDays tilesets for playability.

When did I say that??? Did I say that?? What? I am not sure I even know what “bitmap ASCII sheets” means here.

My point behind the SDL2 conversion is to convert it to SDL2. Seriously, that is it. Please do not project onto me.

I said there was a “possibility” for ASCII character fallback. This is because we already store most characters in textures in SDL2, which means a fallback mode wouldn’t be overly difficult. (Though they would end up either being their default size, or stretched/crunched).

When did I say that??? Did I say that?? What? I am not sure I even know what “bitmap ASCII sheets” means here.

My point behind the SDL2 conversion is to convert it to SDL2. Seriously, that is it. Please do not project onto me.

I said there was a “possibility” for ASCII character fallback. This is because we already store most characters in textures in SDL2, which means a fallback mode wouldn’t be overly difficult. (Though they would end up either being their default size, or stretched/crunched).[/quote]Hmm. pulls up logs

[00:01:21] Ah. I was planning to approach that by creating a fallback system. [00:03:16] My idea, basically, is a tileset would be set up with an ASCII replacement set, which doesn't necessarily have to be proper text [00:03:45] If you're familiar with Dwarf Fortress, I wanted to set up something like what it does. [00:04:08] An ASCII bitmap tile page, plus graphics of matching size. [00:04:53] Ah, yeah. that's basically what I'm talking baout [00:04:55] about*

Well, the name’s certainly different. Are there two people working on separate SDL2 branches? :confused:

Nope, that’s not needed.

Please look here for a simpler method, and if you think you can code it:

Everything is doable. The point is that four months passed and no one did anything about it.

I am not “Graywolfe” nor am I, well you. I go by “Chase-san” in chat.

[quote=“Chase, post:149, topic:3676”]I am not “Graywolfe” nor am I, well you. I go by “Chase-san” in chat.[/quote]Well then, I guess that means that either someone else is/was working on a SDL2 branch with ASCII fallback in parallel to your own fallback-less SDL2 branch, or someone was pretending to.

Either way, it seems I will have to wade through that code myself after all. Dammit, I have enough things to do already. :expressionless:

I was working on tileset editor which would parse game jsons and fill missing tiles with prepared font-tiles as well as generate new tileset json. But being lazy as fuck and currently addicted to my Tweaker character, I can’t pull myself out of playing.

And I can live with blue sharps from RetroDays tileset for now. :slight_smile:

Once I die, I will finish it. Promise!

(Big props to HRose for starting the tileset and Antistar for continuing it. I have a blast!)

So, I’ve seen SDL2 is in, along with the category output.

Can now figure out how to do what I’m asking instead (display the exact ASCII glyph and color)?

I think the major hurdle is to actually implement loading two .png images to use them separately.

[quote=“HRose, post:152, topic:3676”]So, I’ve seen SDL2 is in, along with the category output.

Can now figure out how to do what I’m asking instead (display the exact ASCII glyph and color)?

I think the major hurdle is to actually implement loading two .png images to use them separately.[/quote]The game already builds a bitmap sheet for use in non-tiled SDL output, out of a system font or PNG sheet. The project I tried to undertake involved splicing that non-tile SDL output function with the tiles, so that instead of using unknown tiles it’d fall back to the same ASCII - except it wouldn’t use the bitmap ASCII for the menus, which just looks bad. I kinda fell away from the project for IRL reasons, and partly because I thought that what I wanted to do was already being worked on by a more competent programmer. I guess I’ll have to revisit my project, but I really don’t have the time nowadays.

edit: I literally just wanted to kludge the two functions together, so that both sets of tile data are prepared, and if the tiled output fails (i.e. results in “unknown”) it passes the tile to the SDL output. It’d be part of the same Draw function that calls the tile draw function now, but instead of drawing an unknown the tile draw function would return 0 and the Draw function would call the ASCII draw function instead.

Btw, this is the way I’d complete my tile compared to what Antistar is doing:

I’m not going to draw a symbol for each object. Not because I’m lazy, but because the purpose is to have individual objects stand out clearly against the background and be easily recognizable. You need to notice at glance where’s the stuff that is relevant all across the screen.

So for all generic tiles that are repeated over the place like walls, trees, doors, tables, beds, fences, grass and so on, all of these can be drawn because they are part of the scene and don’t have individual value. But for all items that you usually interact with and can pick up to use, those need to stand out clearly, so ASCII is perfect.

And that’s why I need an ASCII fallback that can display exactly the item.

And once this kind of support is done, we could also make custom combinations, so that, for example, you could make so all monsters use ASCII instead of a sprite, if you like it better that way.

Actually, this could be supported entirely on Chase’s editor:
You just let me load another .png with my ASCII, then use the editor to auto-complete all the different combinations. It would be the editor to go through each object, find the ASCII+color and assign the corresponding tile to that entry.

I was attempting to compile, since maybe with SDL2 it would work. This on Windows and MinGW:

In file included from src/animation_tiles.cpp:5:0:
src/cata_tiles.h:7:17: fatal error: SDL.h: No such file or directory
#include “SDL.h”

SDL.h should be in SDL2/SDL2.h on Windows. So why is it looking in the root?

Stupid question, but to get the obvious possibility out of the way - you did download and set up the SDL, SDL_ttf, and SDL_image sources and libraries, right?

If you did, then you might need to tinker with the environment variables - look at the #ifdef’s in the top of, say, the catatiles.cpp file. Notice how SDL2 is only included if some specific requirements are met.

I moved the headers to the root directory and it compiles everything fine, but then fails on the linker:

objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x599): undefined reference to SDL_RenderClear' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x671): undefined reference to
SDL_CreateRGBSurface’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x1566): undefined reference to
SDL_FreeSurface' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x1587): undefined reference toSDL_DestroyTexture’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x27a6): undefined reference to
SDL_DestroyTexture' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x2900): undefined reference toSDL_CreateRGBSurface’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x2925): undefined reference to
SDL_UpperBlit' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x2933): undefined reference toSDL_CreateTextureFromSurface’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x2941): undefined reference to
SDL_FreeSurface' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x2b89): undefined reference toSDL_FreeSurface’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x2d8d): undefined reference to
IMG_Load' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x2d9d): undefined reference toIMG_Load’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x30e3): undefined reference to
SDL_RenderCopy' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x31c4): undefined reference toSDL_RenderCopy’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x32d3): undefined reference to
SDL_RenderCopyEx' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x7a88): undefined reference toSDL_CreateRGBSurface’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x7ab5): undefined reference to
SDL_MapRGBA' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x7ac9): undefined reference toSDL_FillRect’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x7ad7): undefined reference to
SDL_CreateTextureFromSurface' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x7ae2): undefined reference toSDL_FreeSurface’
objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x8a2d): undefined reference to
SDL_RenderSetClipRect' objwin/tiles/cata_tiles.o:cata_tiles.cpp:(.text+0x8bda): undefined reference toSDL_RenderSetClipRect’
d:/codeblocks/mingw/bin/…/lib/gcc/mingw32/4.8.1/…/…/…/…/mingw32/bin/ld.exe:
objwin/tiles/cata_tiles.o: bad reloc address 0x20 in section `.rdata’
d:/codeblocks/mingw/bin/…/lib/gcc/mingw32/4.8.1/…/…/…/…/mingw32/bin/ld.exe:
final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
make: *** [cataclysm-tiles.exe] Error 1

No idea how to fix this mess. I was never able to compile Cataclysm. I can compile everything else, but Cataclysm ALWAYS fails every time I tried.

EDIT: Nevermind. It wanted
SDL2-2.0.1\i686-w64-mingw32

instead of
SDL2-2.0.1\x86_64-w64-mingw32

Or not.

I compile it fine in Code::Blocks. Well, “fine”. It ends up requiring DLLs for SDL and the other two sublibraries, but works as intended as far as I can see. Not sure how to set up MinGW to work. :confused:

I managed to compile the thing, though it’s not working with the font I’d normally use.

The issues I had:

  • SDL include headers need to be in root directory, since the default SDL2/sdl.h doesn’t work
  • SDL package needs to be i686-w64-mingw32 and NOT x86_64-w64-mingw32
  • zlib1.dll conflicts with MinGW version of the library, so you have to pull the one in the SDL package in the root directory of the game. Otherwise the game will crash.
  • Compiled successfully with make NATIVE=win32 TILES=1 RELEASE=1

Anyway. Blending the tiles function with the one used for the rest of the UI wouldn’t work. Because the point here is to draw the graphic window with a different size than normal text. So if we use the normal text to fill the gaps of the graphic window we just don’t respect the cell size.

So, code-wise, what we should do is load up TWO .png and use the other one only when needed for the ASCI fallback. So, ideally, I’d simply duplicate the functions that load one tileset. And then manually override the draw function to use the second tileset only in those cases where a sprite isn’t available.

I know very little C++, even less figuring out someone else’s code.

Right now I have:
sdltiles.cpp
cata_tiles *tilecontext;
cata_tiles *tilecontext2;

So we have two pointers.

under curses_init I added:
tilecontext2 = new cata_tiles(renderer);

So again duplicating the memory content. We have two pointers pointing to two different memory spaces.

Then the next instruction seems to be:
tilecontext->init(“gfx”);

The init function is in cata_tiles.cpp and it calls:
get_tile_information(load_file_path, json_path, tileset_path);

I think that what happens in that function is only about storing the right paths. Then:
load_tileset(tileset_path);

This handles first a tile_atlas, that is part of the cata_tiles object, so if the plan is to duplicate the tileset then I don’t need to change anything here, since both tilesets will have their respective tile_atlas.

So what I did was create an init2 duplicate function that simply initializes a different .png
Up to this point it compiles:
Could not locate tileset file at gfx/HoderTileset/hellobeta.png

I guess I’ll continue tomorrow.