How are ASCII games usually implemented? Are they actual text output using extended ASCII like you would write to a console? Or do they draw ASCII characters to a window using a tileset image?
|
|
# ¿ Nov 22, 2020 20:23 |
|
|
# ¿ Apr 23, 2024 19:11 |
Yeah I was thinking specifically games with a graphics window like DF and Caves of Qud. I assume they just split the screen up into an X * Y set of tiles and use ASCII graphic tilesets as the graphics.
|
|
# ¿ Nov 22, 2020 20:40 |
I've been experimenting both ways. First I tried a "true" ASCII game where I used ncurses, that was the most simple/direct way to get something up and running that looked like a proper ASCII game but I pretty quickly started running into problems when I wanted to do anything more complex like handling terminal resizing. I've restarted this time using the SFML library. I still want to have ASCII graphics, so I load in an image containing all the Code Page 437 characters which are parsed into 16x16 individual images and then use a vertex array to create a map of those images indexed by a 2d array. It looks pretty good and I think doing it this way will pay off down the road as you can easily swap out ASCII image sets to use different colours. I figured this is the basic jist of how most ASCII games these days do it, as once you get the basic structure down it's nice to work with a graphics library to get a little fancier with UIs and such.
|
|
# ¿ Nov 24, 2020 00:45 |