NPPAngband/NPPMoria QT port

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nppangband
    NPPAngband Maintainer
    • Dec 2008
    • 926

    NPPAngband/NPPMoria QT port

    The NPP Angband QT port now has a gihub page for its extremely modest start. There is not much to see so far. It just opens a basic window, makes a top menu, and a file menu for starting new games, opening, closing and saving game files, including a 5 most recently played characters section. The classic Angband start screen with the author and copyright information now appears in a dialog box under the "about" section. The open and save-as commands use the standard load/save widget that would found in any modern program, even though right now it just opens and closes simple .txt files.



    One major change so far: This port will give the player the ability to save and close a character, then open a new one without having to exit and re-start the game.

    As stated in other threads, my goal is to build a modern port of NPP using QT and C++ with modern menus and dialog boxes that should be easily used by Angband and other variants.

    Angband is a great game that basically runs off of a 25 year old custom-built game engine and game library designed for computers with the capabilities of 6-7 generations ago. I am trying to bring it up-to-date, give it a modern UI, and reduce the learning curve for new players, and eventually make a version playable on tablets. I think more than half of the source code will be eliminated and/or replaced before I am done.
    NPPAngband current home page: http://nppangband.bitshepherd.net/
    Source code repository:
    https://github.com/nppangband/NPPAngband_QT
    Downloads:
    https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57
  • Magnate
    Angband Devteam member
    • May 2007
    • 5110

    #2
    Originally posted by nppangband
    One major change so far: This port will give the player the ability to save and close a character, then open a new one without having to exit and re-start the game.
    I thought the problem with this was memory management? (i.e. making sure that all memory is freed between restarts) Is that solved?
    Angband is a great game that basically runs off of a 25 year old custom-built game engine and game library designed for computers with the capabilities of 6-7 generations ago. I am trying to bring it up-to-date, give it a modern UI, and reduce the learning curve for new players, and eventually make a version playable on tablets. I think more than half of the source code will be eliminated and/or replaced before I am done.
    You should get together with that Nick McConnell chappie, I hear he's doing something similar ...
    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

    Comment

    • buzzkill
      Prophet
      • May 2008
      • 2939

      #3
      Originally posted by nppangband
      ... my goal is to build a modern port of NPP using <snip> modern menus and dialog boxes that should be easily used by Angband and other variants.

      Angband is a great game that basically runs off of a 25 year old custom-built game engine and game library designed for computers with the capabilities of 6-7 generations ago. I am trying to bring it up-to-date, give it a modern UI...
      You go Jeff!!! A maintainer that speaks of maintainence. Incredibly rare 'round here. No offence intended to the fledgling, just a babe really, Vanilla maintainer, whom also seem to have some maintainer blood coursing through his veins. This could be the start of a Golden Era.
      www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
      My banding life on Buzzkill's ladder.

      Comment

      • nppangband
        NPPAngband Maintainer
        • Dec 2008
        • 926

        #4
        Originally posted by Magnate
        I thought the problem with this was memory management? (i.e. making sure that all memory is freed between restarts) Is that solved?
        It will be. Since I am starting with a blank slate and adding bits of NPP code at a time, it is just something I will have to manage. Whenever I add one of the global variables or arrays from Angband I will just make sure it is either freed or zeroed out in between games. This is more important in NPP because the player needs to be able to switch between NPPAngband and NPPMoria because there are a completely different edit files for each game.

        Fortunately, memory management is a little easier in C++ than in C, and QT Creator (the QT editor) includes Valgrind, so it seems achievable.


        Originally posted by Magnate
        You should get together with that Nick McConnell chappie, I hear he's doing something similar ...

        Nick and I have borrowed a lot of code from each other over the years. I don't think this will stop any time soon. Also, AnonymousHero is working on a QT port for a version of TOME. I am sure some of his work will make it into my codebase as well. @AnonymousHero - please feel free to hijack this thread occasionally to talk about what you are working on.
        Last edited by nppangband; December 28, 2013, 21:23.
        NPPAngband current home page: http://nppangband.bitshepherd.net/
        Source code repository:
        https://github.com/nppangband/NPPAngband_QT
        Downloads:
        https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

        Comment

        • nppangband
          NPPAngband Maintainer
          • Dec 2008
          • 926

          #5
          Originally posted by buzzkill
          You go Jeff!!! A maintainer that speaks of maintainence. Incredibly rare 'round here. No offence intended to the fledgling, just a babe really, Vanilla maintainer, whom also seem to have some maintainer blood coursing through his veins. This could be the start of a Golden Era.
          Yes, I look forward to seeing what he does with it. He has used plenty of NPP ideas in the past, so he clearly has impeccable taste.

          Oh, and Buzzkill, I should have mentioned that when I get around to tiles I will probably break up the tileset into hundreds of individual 32x32 files and load them at startup with a pre-set naming convention. That should make it easy to edit tiles and free us of all the mapping difficulties.
          NPPAngband current home page: http://nppangband.bitshepherd.net/
          Source code repository:
          https://github.com/nppangband/NPPAngband_QT
          Downloads:
          https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9634

            #6
            Originally posted by buzzkill
            You go Jeff!!! A maintainer that speaks of maintainence. Incredibly rare 'round here. No offence intended to the fledgling, just a babe really, Vanilla maintainer, whom also seem to have some maintainer blood coursing through his veins. This could be the start of a Golden Era.
            Actually quite a lot of maintenance has happened over the last few years - I'm just swanning in at the right point to grab all the glory.

            Originally posted by Magnate
            You should get together with that Nick McConnell chappie, I hear he's doing something similar ...
            My feeling on this is that the NPP and V approaches are different enough that it's best to keep them apart, then see what the end results are and probably try to use the best bits of both.

            Or else I'll revert to type and pinch the lot from Jeff
            One for the Dark Lord on his dark throne
            In the Land of Mordor where the Shadows lie.

            Comment

            • buzzkill
              Prophet
              • May 2008
              • 2939

              #7
              Originally posted by nppangband
              Oh, and Buzzkill, I should have mentioned that when I get around to tiles I will probably break up the tileset into hundreds of individual 32x32 files and load them at startup with a pre-set naming convention. That should make it easy to edit tiles and free us of all the mapping difficulties.
              I've got a program for that, GlueSprites. There are probably others that would work just as well, also I couldn't find a "clean" webpage or link to the program. It's a stand alone Windows executable. I can post it to my MediaFire page if you would like.
              www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
              My banding life on Buzzkill's ladder.

              Comment

              • nppangband
                NPPAngband Maintainer
                • Dec 2008
                • 926

                #8
                Originally posted by buzzkill
                I've got a program for that, GlueSprites. There are probably others that would work just as well, also I couldn't find a "clean" webpage or link to the program. It's a stand alone Windows executable. I can post it to my MediaFire page if you would like.
                I think my goal will be to write a quick function that reads the tile from tileset page, and then copies it to a 32x32.png file, and saves it with a descriptive name consistent with the naming convention I want to use.....something like 32xbabywhitedragon.png.

                Gluesprites just splits them up, right? Does it give the user any control over the names each file is called?
                NPPAngband current home page: http://nppangband.bitshepherd.net/
                Source code repository:
                https://github.com/nppangband/NPPAngband_QT
                Downloads:
                https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                Comment

                • nppangband
                  NPPAngband Maintainer
                  • Dec 2008
                  • 926

                  #9
                  Originally posted by Nick

                  My feeling on this is that the NPP and V approaches are different enough that it's best to keep them apart, then see what the end results are and probably try to use the best bits of both.

                  Or else I'll revert to type and pinch the lot from Jeff
                  I must have missed some posts upcoming Angband UI changes. What is your plan?

                  The switch to QT and C++ is definitely a commitment. I think it will work well but there is no going back. For example, all 'char' variables are being changed to QChar, all strings will be changes to QString, and all msg_print, msg_format, etc will be torn up as well. But it is nice. QT takes care of all buffer overflow issues, so you don't even have to declare length of strings. For example, instead of adding to a string with something like:

                  mystrcat(mon_desc, "resists fire", sizeof(mon_desc));

                  is simply:
                  mon_name.append = (" resists fire");
                  NPPAngband current home page: http://nppangband.bitshepherd.net/
                  Source code repository:
                  https://github.com/nppangband/NPPAngband_QT
                  Downloads:
                  https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                  Comment

                  • Nick
                    Vanilla maintainer
                    • Apr 2007
                    • 9634

                    #10
                    Originally posted by nppangband
                    I must have missed some posts upcoming Angband UI changes. What is your plan?
                    Well, one of my minions (takkaria ) is going to split all the UI stuff out of the game core, so we can have two separate systems (the core and the UI) which talk to each other. It's not technically a change to the UI, but it means that one could write a completely new UI, and the core essentially provides an API for doing that.
                    One for the Dark Lord on his dark throne
                    In the Land of Mordor where the Shadows lie.

                    Comment

                    • buzzkill
                      Prophet
                      • May 2008
                      • 2939

                      #11
                      Originally posted by nppangband
                      I think my goal will be to write a quick function that reads the tile from tileset page, and then copies it to a 32x32.png file, and saves it with a descriptive name consistent with the naming convention I want to use.....something like 32xbabywhitedragon.png.

                      Gluesprites just splits them up, right? Does it give the user any control over the names each file is called?
                      It's pretty bare bones. It names the files incrementally originalfile_split_xxxx.png where xxxx starts at 1000. There's no configuration for naming options.

                      I suppose you could then write a script that would rename the files based upon the tiles position derived from the split_file_name and cross reference that with the prf. Whew. Or just do that thing you said.
                      www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
                      My banding life on Buzzkill's ladder.

                      Comment

                      • nppangband
                        NPPAngband Maintainer
                        • Dec 2008
                        • 926

                        #12
                        My latest milestone: The QT port is still a shell, but it now reads and loads all of the edit files. C++ and Unicode strings did not like the parsing code in init1.c, and I would up practically re-writing the whole thing. And I was able to make it so a game can be closed and a new savefile opened without having to exit the game. NPP has the added difficulty of two different sets of edit files that require different array sizes. I thought that was going to be one of the more painful parts of the QT port, and it certainly was.

                        next up:

                        1) 24 bit color
                        2) loading and saving a savefile
                        NPPAngband current home page: http://nppangband.bitshepherd.net/
                        Source code repository:
                        https://github.com/nppangband/NPPAngband_QT
                        Downloads:
                        https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                        Comment

                        • Derakon
                          Prophet
                          • Dec 2009
                          • 9022

                          #13
                          Congrats on the progress. Being able to load a new savefile without having to restart the program is one of those weird things that really marks Angband as being an old game...

                          Comment

                          • nppangband
                            NPPAngband Maintainer
                            • Dec 2008
                            • 926

                            #14
                            The updated color system is now working. It now uses 24-bit RGB colors. Gone are the cryptic color letters like U, or b. The ~35 or so pre-set colors are all read out of the edit files with descriptive text (TERM_L_RED, for example). But the game can now work with and process any RGB color. The edit files can contain any <red>:<green>:<blue> (0-255 value) color as well.
                            NPPAngband current home page: http://nppangband.bitshepherd.net/
                            Source code repository:
                            https://github.com/nppangband/NPPAngband_QT
                            Downloads:
                            https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                            Comment

                            • Derakon
                              Prophet
                              • Dec 2009
                              • 9022

                              #15
                              This is probably a bit late, but if it helps these are the predefined colors that Pyrel uses:
                              Code:
                                  "BLACK": [0,0,0],
                                  "DARK": [0, 0, 0],
                                  "WHITE": [255, 255, 255],
                                  "SLATE": [128, 128, 128],
                                  "ORANGE": [255, 128, 0],
                                  "RED": [192, 0, 0],
                                  "GREEN": [0, 128, 64],
                                  "BLUE": [0, 64, 255],
                                  "UMBER": [128, 64, 0],
                                  "L_DARK": [96, 96, 96],
                                  "L_SLATE": [192, 192, 192],
                                  "L_PURPLE": [255, 0, 255],
                                  "YELLOW": [255, 255, 0],
                                  "L_RED": [255, 64, 64],
                                  "L_GREEN": [0, 255, 0],
                                  "L_BLUE": [0, 255, 255],
                                  "L_UMBER": [192, 128, 64],
                                  "PURPLE": [144, 0, 144],
                                  "VIOLET": [144, 32, 255],
                                  "TEAL": [0, 0, 160, 160],
                                  "MUD": [0, 108, 108, 48],
                                  "L_YELLOW": [255, 255, 144],
                                  "MAGENTA": [255, 0, 160],
                                  "L_TEAL": [32, 255, 220],
                                  "L_VIOLET": [184, 168, 255],
                                  "L_PINK": [255, 128, 128],
                                  "MUSTARD": [180, 180, 0],
                                  "BLUE_SLATE": [160, 192, 208],
                                  "DEEP_L_BLUE": [0, 176, 255]
                              Direct RGB tuples are also valid, as in your case.

                              Comment

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