So, after releasing 6.4 as a bugfix version, I've started work on Cthangband 7.0.
The intent is that this will be a very big change.
The first big thing is that I'm putting graphics back in. Last time I tried this, I gave up and reverted the game back to its previous version because I didn't like the results. That was because I tried to do too much. What I did then - and it worked - was to take off the UI and make the graphics fill the screen, and put in a mouse interface with a drag-and-drop inventory and the like.
The problem was that it fell between two stools. It wasn't professional-enough looking to stand against other games of that type, and the interface didn't feel like Angband.
This time, though, I'm introducing graphics in a more classic manner, in that the main interface will remain text-based and it's just the overhead view that will be graphical.
To do this (remember, Cthangband is in C# rather than C) I've written my own "MonoRogue" library that uses MonoGame. The good thing with using MonoGame is that I can get good enough performance out of it.
The way I'm doing it is I'm using 32x32 tiles (the David Gervais set) for both graphics and text - I've created a bitmap font for it - and because of the 6.2 change to screen resolution I have an 80x45 display of square tiles that fits perfectly with the 16:9 aspect ratio of most widescreen monitors.
What I do is have a number of layers which I can turn on and off. The simplest type of layer is a "Background" layer, which simply contains a single image, and the most complex are the "Tile" layers that contain 80x45 tiles, each of which is taken from a tilemap and drawn with its own tint and a "Text" layer that contains swappable screens of 80x45 characters taken from the bitmap font and drawn with their own tint.
For Cthangband, I have a set of background layers for the different backgrounds (menu, game, map/journal/character, game-over screen, winner screen, and so forth) of which I only ever have one switched on; and then five tile layers (floor, feature, object, monster, sfx); and then a text layer on top.
Every layer has its own in-memory texture to which it draws that is 2560x1440 in size - the exact size to hold eighty by forty five 32x32 tiles or glyphs at 1:1 size. I only need to redraw to one of these textures when the contents of the specific layer changes. When I need a screen redraw, I draw each of the pre-drawn layer textures in turn onto a 2560x1440 buffer - again at a 1:1 scale - and then when I'm finished I draw that fixed-scale buffer onto the screen or window. It is only with this last draw that any scaling is done, so I never get any artifacting or visible tile borders like I would if I tried to scale the individual tiles as I drew them.
This system also means that I can colour or shade each cell of each layer independently to indicate light levels/colours or similar so that I don't need to have separate tiles for different light levels and I can do things like displaying the floor tile in a dim colour due to low light while drawing a monster seen by ESP at full brightness, or draw any tile with a subtle yellow tint for torchlight rather than just having select tiles drawn in bright yellow instead of their normal colour.
The library is finished and working, although I'm still wiring it up to the game it at the moment, but so far it's looking pretty good. On my 1920x1080 reolution screen the tiles are all being reduced from 32x32 to 24x24 but you don't notice the loss of resolution because the whole screen is being anti-aliased by the graphics card as it does it.
The intent is that this will be a very big change.
The first big thing is that I'm putting graphics back in. Last time I tried this, I gave up and reverted the game back to its previous version because I didn't like the results. That was because I tried to do too much. What I did then - and it worked - was to take off the UI and make the graphics fill the screen, and put in a mouse interface with a drag-and-drop inventory and the like.
The problem was that it fell between two stools. It wasn't professional-enough looking to stand against other games of that type, and the interface didn't feel like Angband.
This time, though, I'm introducing graphics in a more classic manner, in that the main interface will remain text-based and it's just the overhead view that will be graphical.
To do this (remember, Cthangband is in C# rather than C) I've written my own "MonoRogue" library that uses MonoGame. The good thing with using MonoGame is that I can get good enough performance out of it.
The way I'm doing it is I'm using 32x32 tiles (the David Gervais set) for both graphics and text - I've created a bitmap font for it - and because of the 6.2 change to screen resolution I have an 80x45 display of square tiles that fits perfectly with the 16:9 aspect ratio of most widescreen monitors.
What I do is have a number of layers which I can turn on and off. The simplest type of layer is a "Background" layer, which simply contains a single image, and the most complex are the "Tile" layers that contain 80x45 tiles, each of which is taken from a tilemap and drawn with its own tint and a "Text" layer that contains swappable screens of 80x45 characters taken from the bitmap font and drawn with their own tint.
For Cthangband, I have a set of background layers for the different backgrounds (menu, game, map/journal/character, game-over screen, winner screen, and so forth) of which I only ever have one switched on; and then five tile layers (floor, feature, object, monster, sfx); and then a text layer on top.
Every layer has its own in-memory texture to which it draws that is 2560x1440 in size - the exact size to hold eighty by forty five 32x32 tiles or glyphs at 1:1 size. I only need to redraw to one of these textures when the contents of the specific layer changes. When I need a screen redraw, I draw each of the pre-drawn layer textures in turn onto a 2560x1440 buffer - again at a 1:1 scale - and then when I'm finished I draw that fixed-scale buffer onto the screen or window. It is only with this last draw that any scaling is done, so I never get any artifacting or visible tile borders like I would if I tried to scale the individual tiles as I drew them.
This system also means that I can colour or shade each cell of each layer independently to indicate light levels/colours or similar so that I don't need to have separate tiles for different light levels and I can do things like displaying the floor tile in a dim colour due to low light while drawing a monster seen by ESP at full brightness, or draw any tile with a subtle yellow tint for torchlight rather than just having select tiles drawn in bright yellow instead of their normal colour.
The library is finished and working, although I'm still wiring it up to the game it at the moment, but so far it's looking pretty good. On my 1920x1080 reolution screen the tiles are all being reduced from 32x32 to 24x24 but you don't notice the loss of resolution because the whole screen is being anti-aliased by the graphics card as it does it.
Comment