# ASCII/Retro tilesets

**URL:** <https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676>\
**Category:** The Lab\
**Created:** [October 27, 2013, 5:19pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676 "2013-10-27T17:19:28Z")\
**Posts on this page:** 20\
**Page:** 8

<div class="post-metadata">

**Author:** ![Antistar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/antistar/32/1687_2.png) [@Antistar](https://discourse.cataclysmdda.org/u/Antistar)\
**Post date:** [February 28, 2014, 6:43am UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/141 "2014-02-28T06:43:10Z")

</div>

[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. 🙂

> [@Sean Mirrsen](#):
>
> I’ve only [got as far as creatures for now](https://dl.dropboxusercontent.com/u/4152380/retrodaystiles.png), because holy crap there is a lot of tiles…

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

> [@CIB](#):
>
> Just PR’d something that might help: [Implemented category fallback for tile rendering by CIB · Pull Request #6349 · CleverRaven/Cataclysm-DDA · GitHub](https://github.com/CleverRaven/Cataclysm-DDA/pull/6349)

That sounds cool; looking forward to that.

---

<div class="post-metadata">

**Author:** ![HRose](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Post date:** [February 28, 2014, 12:40pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/142 "2014-02-28T12:40:23Z")

</div>

> [@CIB](#):
>
> It’s much more generic, though. In high detail tilesets like Waldo’s, ASCII fallback and colors wouldn’t be very useful(would look very out of place), so I went for this solution first. There are solutions more specific to iconic tilesets like this one that can be implemented. Namely, falling back to ASCII instead of “unknown”, and color-swapping combined with grouping(so you could, say, have a single zombie sprite, then have it automatically color-swapped for you depending on what the color of the zombie is in ASCII)…

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.

---

<div class="post-metadata">

**Author:** ![Sean\_Mirrsen](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Sean\_Mirrsen](https://discourse.cataclysmdda.org/u/Sean_Mirrsen)\
**Post date:** [February 28, 2014, 2:28pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/143 "2014-02-28T14:28:09Z")

</div>

> [@HRose](#):
>
> [quote=“CIB, post:139, topic:3676”]It’s much more generic, though. In high detail tilesets like Waldo’s, ASCII fallback and colors wouldn’t be very useful(would look very out of place), so I went for this solution first. There are solutions more specific to iconic tilesets like this one that can be implemented. Namely, falling back to ASCII instead of “unknown”, and color-swapping combined with grouping(so you could, say, have a single zombie sprite, then have it automatically color-swapped for you depending on what the color of the zombie is in ASCII)…

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.

---

<div class="post-metadata">

**Author:** ![HRose](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Post date:** [February 28, 2014, 4:47pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/144 "2014-02-28T16:47:09Z")

</div>

> [@Sean Mirrsen](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Sean\_Mirrsen](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Sean\_Mirrsen](https://discourse.cataclysmdda.org/u/Sean_Mirrsen)\
**Post date:** [February 28, 2014, 5:38pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/145 "2014-02-28T17:38:10Z")

</div>

> [@HRose](#):
>
> [quote=“Sean Mirrsen, post:143, topic:3676”]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.[/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](https://dl.dropboxusercontent.com/u/4152380/RetroDaysTileset.zip) 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.

---

<div class="post-metadata">

**Author:** ![Chase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/chase/32/6463_2.png) [@Chase](https://discourse.cataclysmdda.org/u/Chase)\
**Post date:** [February 28, 2014, 6:59pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/146 "2014-02-28T18:59:10Z")

</div>

> [@Sean Mirrsen](#):
>
> I can also confirm (having IRC’d with the guy in question) that his SDL branch with support bitmap ASCII sheets. At least, that was his intention as far as I gathered.

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).

---

<div class="post-metadata">

**Author:** ![Sean\_Mirrsen](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Sean\_Mirrsen](https://discourse.cataclysmdda.org/u/Sean_Mirrsen)\
**Post date:** [February 28, 2014, 7:31pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/147 "2014-02-28T19:31:33Z")

</div>

> [@Chase](#):
>
> [quote=“Sean Mirrsen, post:138, topic:3676”]I can also confirm (having IRC’d with the guy in question) that his SDL branch with support bitmap ASCII sheets. At least, that was his intention as far as I gathered.

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? 😕

---

<div class="post-metadata">

**Author:** ![HRose](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Post date:** [February 28, 2014, 7:46pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/148 "2014-02-28T19:46:17Z")

</div>

> [@Chase](#):
>
> 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).

Nope, that’s not needed.

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

> <https://github.com/CleverRaven/Cataclysm-DDA/issues/4236>
>
> I explained this on the forums. Right now it's just not possible to complete a t…ileset and maintain it. You just need a million of hours and every time stuff is added you have to go through a lot of busywork.
> 
> Here's the suggested refactoring to make this work:
> \## 
> 
> I just spent a VERY long time going through all "books.json" to add ALL entries to the tileset. It's insane work.
> 
> This is something that needs to be refactored and that is more important than categories: we need a way to bind tiles NOT through IDs, but through ASCII+color.
> 
> It's just not remotely possible to bind every single ID for the billion of objects in the game. The real problem here is that there are like 50 books that have different IDs but that are all shown as a pink "?". So I don't want to use 50 entries IDs in my tiles file pointing to the same tile. I just want to bind the pink "?" ASCII to a tile. Once. All objects that are shown as a pink "?" will then default to that tile.
> 
> So, basically, we should build tiles for all used ASCII+color combinations. There should be an automatic method/output file that lists every combination and what it is associated to. Something like the green "/" represents this list of objects. And then let tile-makers bind one tile to the green "/", and not IDs (unless overridden with a specific ID).
> 
> So the "tile\_config.json" should first have a mandatory block where you bind all ASCII and colors in use (surely a MUCH SMALLER number than all the IDs in the game). THEN an optional block where you bind single IDs, if you want.
> 
> That way every time you add stuff to the game, you ALWAYS have tile mode working perfect, because it always knows how to output that ASCII+color combination by default.
> \## \<bountysource-plugin\>
> 
> Want to back this issue? \*\*\[Post a bounty on it!\](https://www.bountysource.com/issues/1366793-tile-mode-needs-refactoring?utm\_campaign=plugin&utm\_content=tracker%2F146201&utm\_medium=issues&utm\_source=github)\*\* We accept bounties via \[Bountysource\](https://www.bountysource.com/?utm\_campaign=plugin&utm\_content=tracker%2F146201&utm\_medium=issues&utm\_source=github).
> \</bountysource-plugin\>

> [@Sean Mirrsen](#):
>
> (not currently, but it’s definitely doable) - I don’t think that’s a problem.

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

---

<div class="post-metadata">

**Author:** ![Chase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/chase/32/6463_2.png) [@Chase](https://discourse.cataclysmdda.org/u/Chase)\
**Post date:** [February 28, 2014, 7:53pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/149 "2014-02-28T19:53:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sean\_Mirrsen](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Sean\_Mirrsen](https://discourse.cataclysmdda.org/u/Sean_Mirrsen)\
**Post date:** [March 1, 2014, 6:26am UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/150 "2014-03-01T06:26:29Z")

</div>

[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. 😑

---

<div class="post-metadata">

**Author:** ![Robik](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/robik/32/1349_2.png) [@Robik](https://discourse.cataclysmdda.org/u/Robik)\
**Post date:** [March 1, 2014, 7:00am UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/151 "2014-03-01T07:00:22Z")

</div>

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. 🙂

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!)

---

<div class="post-metadata">

**Author:** ![HRose](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Post date:** [March 2, 2014, 3:29pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/152 "2014-03-02T15:29:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sean\_Mirrsen](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Sean\_Mirrsen](https://discourse.cataclysmdda.org/u/Sean_Mirrsen)\
**Post date:** [March 2, 2014, 3:41pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/153 "2014-03-02T15:41:35Z")

</div>

[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.

---

<div class="post-metadata">

**Author:** ![HRose](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Post date:** [March 2, 2014, 3:43pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/154 "2014-03-02T15:43:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![HRose](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Post date:** [March 2, 2014, 4:37pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/155 "2014-03-02T16:37:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Sean\_Mirrsen](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Sean\_Mirrsen](https://discourse.cataclysmdda.org/u/Sean_Mirrsen)\
**Post date:** [March 2, 2014, 4:57pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/156 "2014-03-02T16:57:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![HRose](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Post date:** [March 2, 2014, 5:00pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/157 "2014-03-02T17:00:28Z")

</div>

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 to`SDL\_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 to`SDL\_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 to`SDL\_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 to`SDL\_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 to`IMG\_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 to`SDL\_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 to`SDL\_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 to`SDL\_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 to`SDL\_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 to`SDL\_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

---

<div class="post-metadata">

**Author:** ![HRose](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Post date:** [March 2, 2014, 5:12pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/158 "2014-03-02T17:12:32Z")

</div>

Or not.

![](http://www.cesspit.net/misc/catabug.gif)

---

<div class="post-metadata">

**Author:** ![Sean\_Mirrsen](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Sean\_Mirrsen](https://discourse.cataclysmdda.org/u/Sean_Mirrsen)\
**Post date:** [March 2, 2014, 5:16pm UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/159 "2014-03-02T17:16:59Z")

</div>

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. 😕

---

<div class="post-metadata">

**Author:** ![HRose](https://avatars.discourse-cdn.com/v4/letter/h/ed655f/32.png) [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Post date:** [March 3, 2014, 2:03am UTC](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676/160 "2014-03-03T02:03:42Z")

</div>

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.

[Previous page](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676.md?page=7)

[Next page](https://discourse.cataclysmdda.org/t/ascii-retro-tilesets/3676.md?page=9)
