Cthangband 7.0 Changes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dean Anderson
    Adept
    • Nov 2009
    • 193

    Cthangband 7.0 Changes

    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.
  • iggy_hunter
    Apprentice
    • Sep 2021
    • 97

    #2
    Source Code

    Is there a repository for the source code for the latest C# version for continued development?

    Comment

    • Dean Anderson
      Adept
      • Nov 2009
      • 193

      #3
      Originally posted by iggy_hunter
      Is there a repository for the source code for the latest C# version for continued development?
      Yes. It's on my hard drive and my back-up devices, and continued development is happening.

      By the way, the post you responded to is quite out of date. Since making that post I've released Cthangband 6.5, which doesn't include the changes mentioned in my post above because again I wasn't happy with the results so reverted them again.

      Currrently I'm playing Cthangband 6.6, but I've not released that version yet - it's still a development version.

      Comment

      • alaras12
        Rookie
        • Sep 2021
        • 2

        #4
        Was one of those changes to 6.5 the elimination of the options menu? I couldn't find it anywhere after installing!

        Comment

        • iggy_hunter
          Apprentice
          • Sep 2021
          • 97

          #5
          Continued Development

          Ah. Got it. I'm not really thinking of doing a separate variant. Are you interesting in working as a team with development needs and upgrades? I've been a lover of Rogue, Moria and Angband since 1984 ... and would love to add to the product.

          Comment

          • Dean Anderson
            Adept
            • Nov 2009
            • 193

            #6
            Originally posted by iggy_hunter
            Ah. Got it. I'm not really thinking of doing a separate variant. Are you interesting in working as a team with development needs and upgrades? I've been a lover of Rogue, Moria and Angband since 1984 ... and would love to add to the product.
            I think I may have to let you down gently, here.

            While I'm totally open to suggestions, and would be happy to receive patches and bugfixes now that other people can compile the code for themselves and make their own changes (after all, that's the whole point of making the code public), Cthangband is "my baby" that I've been working on (on and off) for the last twenty four years, and - for better or worse - all the decisions on its direction so far have been mine.

            I don't think I'm ready to let go of the reins and let other people decide what goes into the game and how it should work.

            As I say, I'm totally fine with people compiling the game for themselves and making their own experimental changes (I'm not talking about making a full-blown variant here, although people can if they want) and then suggesting that those changes go into the main code - but I think I want to have that final line where people can suggest things (anywhere from general "this would be nice" suggestions to specific code changes) but ultimately I get to decide which suggestions to take and which not to.

            Comment

            • iggy_hunter
              Apprentice
              • Sep 2021
              • 97

              #7
              I curious about what might be a bug in the pawn shop. I'm refactoring the shop code https://github.com/marcjohnston/Cthangband. The PriceItem method appears to support both mark down and a mark up (flip parameter). Is the pawn shop mark up (flip = false) divide by 3 (/ 3) correct. The pricing in the pawn shop appears weird. I'm thinking it is supposed to be * 3 (like the * 2 for the black market).

              Comment

              • Dean Anderson
                Adept
                • Nov 2009
                • 193

                #8
                Originally posted by iggy_hunter
                I curious about what might be a bug in the pawn shop. I'm refactoring the shop code https://github.com/marcjohnston/Cthangband. The PriceItem method appears to support both mark down and a mark up (flip parameter). Is the pawn shop mark up (flip = false) divide by 3 (/ 3) correct. The pricing in the pawn shop appears weird. I'm thinking it is supposed to be * 3 (like the * 2 for the black market).
                That's by design - it's a pawn shop, so it both buys and sells cheaply.

                The whole idea is that if you need cash you can pawn items (for less money than you could sell them for), in the knowledge that the shop will hold onto them and then buy them back later for the amount you pawned them for.

                If retrieving your items from the pawn shop had a markup then you'd be better off just selling them normally and buying new ones to replace them.

                Comment

                • iggy_hunter
                  Apprentice
                  • Sep 2021
                  • 97

                  #9
                  Super appreciated your comments. I'll add those notes to my fork.

                  Comment

                  • iggy_hunter
                    Apprentice
                    • Sep 2021
                    • 97

                    #10
                    I've submitted a few issues on the Gurbintroll/Cthangband GitHub repository. Not sure if they have been noticed.

                    Comment

                    • Dean Anderson
                      Adept
                      • Nov 2009
                      • 193

                      #11
                      I hadn't noticed (the reports go to an email address that I only check once in a blue moon), but I have now.

                      Thanks.

                      Comment

                      • Dean Anderson
                        Adept
                        • Nov 2009
                        • 193

                        #12
                        Originally posted by iggy_hunter
                        I've submitted a few issues on the Gurbintroll/Cthangband GitHub repository. Not sure if they have been noticed.
                        I've made the fixes you suggested - thanks for submitting them.

                        Comment

                        • iggy_hunter
                          Apprentice
                          • Sep 2021
                          • 97

                          #13
                          I see the issues are still open ... would you be so kind as to apply a quick comment so that I can apply the same changes to my fork?

                          Thanks

                          Comment

                          Working...
                          😀
                          😂
                          🥰
                          😘
                          🤢
                          😎
                          😞
                          😡
                          👍
                          👎