On Tiles and Why We Don't Have Them (But we're progressing. Thanks utunnels)

There is currently not a tileset system. There used to be, thanks to the awesome coder Gremour, but he has retired. We would love for there to be one again, but none of us have the time on top of all the other things that need to be done. We all agree we should have support for tilesets available, though, and it isn’t actually as difficult as one might suspect because a good portion of the work has been done for us. There is still work to do, however.

And you can help.

If you want to see tileset support, start here: http://whalesdev.com/forums/index.php?topic=1170.0
Anyone who can bring Gremours support up to date or come up with their own implementation, it WILL go in the game. So get 'er done! Linked in his thread are also the two most advanced tilesets available, one of which we will likely end up packaging with the “default graphics pack” version of the game on the front page. But none of that can be done until the code is made compatible with DDA.

So come on and help us out, and get tiles working with the game! Post your results in the Mod forum and if it works well, we’ll roll it into mainline.

I’m not sure in what state current line is, so thoughts below are based on code that’s in my branch https://github.com/gim913/Cataclysm

I was thinking about it some time ago, but the problem is Cataclysm intermix logic with “rendering”.
This was the reason I had some problems when doing ‘native windows console’ port, and also the reasons why I’ve made small ‘hacks’ (i.e. for animations).

This really IS a problem.
It even is a little bit worse, logic and rendering are intermixed, and Cataclysm’s ‘animations’ are also intermixed somewhere between those two.

So before starting any tileset support, I would start with separating rendering part from logic.
(This would allow having different frontends: *nix curses, windows console, libtcod perhaps, sdl/gl)

But I think this is quite overwhelming task and I don’t suppose anyone is willing to make that effort.

That, along with rewriting how the save files work, and how the maps work, are high up on my ‘things I really want’ list. Fixing them opens up a lot of interesting options, but the actual fix work itself is long and boring so kinda get ignored :frowning:

I’dd be willing to do some work, but I don’t know what to do and where to start.

If you’ll notice, someone already DID. It just needs to be brought up to date.

I’ve seen it, it is similar to what I’ve done with windows console, it just implements
ncurses api using gl functions, this is just another ‘hack’ and I still don’t think this is way to go.

Main game loop should look more or less like:

while (! end)
{
  collectInput();
  processGameLogic();
  processRendering();
}

and that’s it. But this would really be HUGE change (if I’m not mistaken almost every file), and one more thing that’s problematic is how cataclysm handles all menus+input :confused:

I also wanted to work on that, I’ve even started it at some point, but I was basically getting nowhere, and when I saw the amount of work required,
I’ve simply gave up :frowning:

Exactly my friend, exactly…

(I’m quite sure at some point someone would even do HTML+JS frontend, which could bring cataclysm popularity to totally new level ;))

If you give me a decent API, I am 100% capable of re-implementing the visual components in html and javascript. That’s actually the closest thing to a specialty I have, after all.

Someone worked on the input collecting recently, and for the process game logic, we’ve got that in 2-3 methods in the loop, but rendering is done everywhere from what I understand. So its that part that needs working on the most before there can be a tile set system, sine at that point we would have draw { drawmap; drawui; drawmenu; } and just either draw glyphs or tileset

-drawmap would iterate through the different arrays we have and draw the terrain, then items and then monsters/npcs/player. Each terrain type, item and monster/npc/player would have a corresponding glyph and tileset offset, either defined in the class itself, (i.e monstertype/npc/player, glyph code, tileset offset) or as a variable in the object itself (ie thing->icon, icon could be a type ie Icon { glyphCode, tilesetOffSet })

-drawui would draw the ui as it is now (no tile sets in the ui… ?), also for the “cursor line” we’ve got in 'V’iew, draw it here over maptiles, unless the 'V’iew interface is a menu.

-drawmenu would draw the requested menu (no clue how to handle this, would need a common menu interface, but dunno how to handle the selections/returns, not sure how it’s done ATM)

I agree with gim on the topic of the existing tileset system, it’s not really the way we would want to go, I would rather see that amount of work put into designing a proper rendering engine with no tilesets (reckon at this point tilesets would be very doable) instead of hacking the old tileset system into DDA.

Any comments on the design I suggested ? Flaws, missed issues, technical issues, design issues ?

I’m not sure what you mean by “use a proper rendering system with no tilesets”

He means, I think, to abstract out all the rendering code we have so that it is isolated into a handful of functions but still use the current rendering system to actually draw the ascii.

That way it’s nice and clean, all the data is past to the various render functions rather than pulled out by them, and it would be easy* for someone else to write a tile/3d/audio/whatever renderer at some point in the future.

[sub]*for varying degrees of easy[/sub]

I spoke to kevin and I was enlightened on how drawing works right now.

Pretty much any function that needs something drawn calls the to draw on a curse window i.e mvwputch(window, x, y, color, char) window being w_terrain, w_HP, w_minimap, and then calls wrefresh(); when done.

This is done so you can draw stuff w/o having to go back in the game loop, i.e the user uses 'V’iew, it doesnt have to make the whole system move, just get the items, draw the window and draw the cursor.

Not sure how we could make this work with a whole unified drawing system while not making the whole system loop. Maybe having the rendering system “look” at arrays and objects, and just have the method call “update” to trigger a screenrefresh, with the renderer doing most of the grunt work (positioning chars, borders, text, etc)

Small OT here, please take a look at this topic: http://www.cataclysmdda.com/smf/index.php?topic=352.0
as I think that’s something that should be done before any attempts to do changes in rendering system…

I ported Gremour’s tiles to the latest DDA

https://github.com/tasetase/CZSplusDDA/tree/tiles

There are a few bugs, like you can’t resize the window from the default size, you cant move your view (HJKL) and horizontal walls (and perhaps other horizontal things) don’t get a texture.

I don’t know how to compile it on windows, I tried via Cygwin and it will not compile no matter what Opengl lib I install.

On Linux you can compile it after installing mesa-common-devel and libglu1-dev (this was on Linux Mint 14)

Just do “make tiles” then run ./catatiles

PS: You’ll need a tileset, I used Deon’s and it works fine, just copy all the files you need from the data folder (aka everything you don’t already have in your data folder). Don’t copy his catatiles.

Here is Gremour’s thread : http://whalesdev.com/forums/index.php?topic=1170.0

Someone get a windows download for this tileset! I want version 0.2.1!

Someone should ask Derek Yu to do a tileset, hes an amazing pixel artist and he did the ‘Doom RL’ tileset

in my opnion, what makes the “cataclysm” its no tiles.

Though, I have nothing to contribute I want to add this comment.

Some people like the ASCII graphics, others like the tileset.
I personally like to play more with the tileset over ASCII.
Be it DF or Cataclysm.

In the end if tileset support does get added I am sure it will all be optional.

My personal view (which I’ve said a few times) is that tiles make a game much more accessible and playable, both to the ‘outside world’ and to all players in general. With ASCII you’re limited to a char. set which only contains a certain number of symbols and as such, in game objects sometimes have to be represented with the same char (guns for instance). This makes searching through stuff tedious (especially in a game like Cata where you’re doing a lot of picking up/searching) whereas with tiles you can just say ‘there’s a shotgun, and a pistol. I’m terrible at shotguns so I’ll go towards the pistol’ instead of having to search both tiles individually. Stone soup is a prime example of this working well, and I don’t think it would have gotten nearly as popular without them.

I understand the ‘nostalgia’/‘I just like it’ value of ASCII, but other than the ‘it helps my imagination’ argument (which to be fair, tiles still require some imagination) I really see no reason whatsoever not to have tiles, other than how fiendishly difficult it is too put in and how fully featured/good a tileset needs to be to make it easy on the eyes.

Also the fact that tilesets slow development, because adding stuff is harder.

Tiles were destroyed in the apocalypse. Sorry guys.