New to Angband programming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BreathesFire
    Rookie
    • Aug 2011
    • 9

    New to Angband programming

    I've played this game since 2.9.x, enjoyed it (almost beat it =p), and I am interested in contributing. I actually can code, but after viewing the size and scope of the bug tracker and source code, it's a little overwhelming. Is there a good place to start? I haven't found any master design or flow documentation.

    I have a bunch more questions as well:

    1- Does angband implement threading? I've noticed multi-hue monsters have an option to flicker, and actions can have delay intervals, which would suggest it exists
    2- What exactly is going on in Makefile.inc? The for loop in particular. I'm new to makefiles (sheltered by IDEs, I know), and I just couldn't figure this code out.
    3- Is there a way to run the MingGW shell, cd, and run makefile all within an editor such as NotePad++?
    3b- Should I just work and compile in MSVS?
    4- Should I be concerned with AngbandBase?
    5- If I wanted to access the game fonts, should I be looking at the lib/xtra/font files, or should I be looking elsewhere?
    6- Let's pretend I am overambitious and want to build a opengl "port" of the game. Should I be hacking apart z-term.c or should I be working a layer underneath?
    7- Do the "z-" files denote something important?
    8- How does the GNU GPL interact with the Tolkien part of this game?
    9- How do you beat Sauron without pillar dancing?
    10- Is the codebase attempting to switch to OO design?

    Sorry to bother anyone!
  • fizzix
    Prophet
    • Aug 2009
    • 3025

    #2
    Originally posted by BreathesFire
    I've played this game since 2.9.x, enjoyed it (almost beat it =p), and I am interested in contributing. I actually can code, but after viewing the size and scope of the bug tracker and source code, it's a little overwhelming. Is there a good place to start? I haven't found any master design or flow documentation.

    I have a bunch more questions as well:

    1- Does angband implement threading? I've noticed multi-hue monsters have an option to flicker, and actions can have delay intervals, which would suggest it exists
    2- What exactly is going on in Makefile.inc? The for loop in particular. I'm new to makefiles (sheltered by IDEs, I know), and I just couldn't figure this code out.
    3- Is there a way to run the MingGW shell, cd, and run makefile all within an editor such as NotePad++?
    3b- Should I just work and compile in MSVS?
    4- Should I be concerned with AngbandBase?
    5- If I wanted to access the game fonts, should I be looking at the lib/xtra/font files, or should I be looking elsewhere?
    6- Let's pretend I am overambitious and want to build a opengl "port" of the game. Should I be hacking apart z-term.c or should I be working a layer underneath?
    7- Do the "z-" files denote something important?
    8- How does the GNU GPL interact with the Tolkien part of this game?
    9- How do you beat Sauron without pillar dancing?
    10- Is the codebase attempting to switch to OO design?

    Sorry to bother anyone!
    I can't answer nearly all of your questions, but I can answer two of them.
    3. I don't know about running MinGW from notepad++, but I do all my programming in Notepad++ and compile with MinGW in the command line with the windows Makefile. The only problem (and it may be a killer) is that I can't get debug tools to work with MinGW. Of course, if you succeed with this, I'd love to know how you did it.
    9. Have enough healing. Sauron wastes a lot of moves with stupid spells that don't hurt you much, like fireballs. If you have enough healing you can heal when he manastorms you. Also, you'll need to deal with the summons, but there are plenty of ways to do that.

    Comment

    • Derakon
      Prophet
      • Dec 2009
      • 9022

      #3
      Nobody's trying to switch to an OO design at the moment. That'd be a monumental task, and if you're going to go to that much effort you might as well simply rewrite the game in a friendlier language -- an effort that's been started probably a dozen times now and never really made it all that far. Sorry.

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        #4
        Originally posted by BreathesFire
        I've played this game since 2.9.x, enjoyed it (almost beat it =p), and I am interested in contributing. I actually can code, but after viewing the size and scope of the bug tracker and source code, it's a little overwhelming. Is there a good place to start? I haven't found any master design or flow documentation.
        Welcome - I hope you get to the stage of enjoying adding some code. There's no master design or flow documentation because the code has evolved over >20 years, and its original authors had no idea what it would become. There is a group of people who hang out on #angband-dev at irc.freenode.net - few of us know every single quirk but between us we have a pretty good knowledge of how the code fits together. If you are happy to use IRC, please drop by. Was there are particular aspect of the game you were interested in improving?
        1- Does angband implement threading? I've noticed multi-hue monsters have an option to flicker, and actions can have delay intervals, which would suggest it exists
        2- What exactly is going on in Makefile.inc? The for loop in particular. I'm new to makefiles (sheltered by IDEs, I know), and I just couldn't figure this code out.
        3- Is there a way to run the MingGW shell, cd, and run makefile all within an editor such as NotePad++?
        3b- Should I just work and compile in MSVS?
        4- Should I be concerned with AngbandBase?
        5- If I wanted to access the game fonts, should I be looking at the lib/xtra/font files, or should I be looking elsewhere?
        6- Let's pretend I am overambitious and want to build a opengl "port" of the game. Should I be hacking apart z-term.c or should I be working a layer underneath?
        7- Do the "z-" files denote something important?
        8- How does the GNU GPL interact with the Tolkien part of this game?
        9- How do you beat Sauron without pillar dancing?
        10- Is the codebase attempting to switch to OO design?
        1. I don't think so, but I'm not an expert on this - the flicker option was added recently by d_m (last year or two), so he can give more info, but I don't think it uses threading, just waits for a keypress. The delay factor is solely to do with animations, and I'm pretty sure that doesn't involve threading.

        2. AFAIK Makefile.inc is used only by the OSX build - almost all the others use Makefile.src. The primary OSX dev is myshkin, who may be able to explain what's going on in Makefile.inc.

        Can't help with 3. as I don't use Windows.

        4. Not at the moment. At the moment AngbandBase is derived from V and offered as a quickstart for variants. Personally I think it would be good in future if AngbandBase was developed first and V followed, but not sure when or how that shift would happen.

        5. Yes, the fonts are all in lib/xtra/font. The exception is the X11 port, which uses X-windows system fonts (ugh). But note that both the X11 and GTK ports should be going soon - both are on borrowed time (and have no champion).

        6. You arrive in the midst of takkaria's ambition to split the UI from the core game completely - see this article for more details. The layers are not yet properly split, so you would need to help work on that before you could easily build an opengl front-end. If you were impatient, you could just try writing main-gl.c instead ...

        7. Yes, they are all intended to define a set of underlying mechanisms rather than aspects of the game itself. Theoretically you could rip them all out, replace them with completely different functions doing the same things, and the gameplay would be the same.

        8. My understanding is that there is no official Tolkein connection, nor any official D&D connection. Both are obvious significant influences on the game, but no licensing or copyright adventures have ever been undertaken (c.f. the change from PernAngband to ToME to ToME4 because of copyright hassle). If there are copyright restrictions on using names like Sauron and Morgoth, nobody has bothered enforcing them for the last twenty years. The game is now entirely GPL, though it is dual-licenced for the benefit of variants which require the original pre-GPL licence. Note that certain additional resources are non-GPL (in particular Dubtrain's sound pack uses CC-BY-NC-SA, and Shockbolt's tiles will too).

        9. At the moment he's still vulnerable to acid, so hitting him over the head enough times with a Scythe of Slicing of Acid usually does the trick.

        10. Not systematically, no. Our current ambition is to move from static arrays to linked lists, which perhaps shows you how far we have to go.

        Good luck - and please feel free to ask more questions!
        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

        Comment

        • takkaria
          Veteran
          • Apr 2007
          • 1951

          #5
          Originally posted by Derakon
          Nobody's trying to switch to an OO design at the moment. That'd be a monumental task, and if you're going to go to that much effort you might as well simply rewrite the game in a friendlier language -- an effort that's been started probably a dozen times now and never really made it all that far. Sorry.
          Hmm, while I wouldn't say we're trying to switch to an OO design, code refactorings are certainly moving in that direction, slowly.
          takkaria whispers something about options. -more-

          Comment

          • d_m
            Angband Devteam member
            • Aug 2008
            • 1517

            #6
            Originally posted by BreathesFire
            1- Does angband implement threading? I've noticed multi-hue monsters have an option to flicker, and actions can have delay intervals, which would suggest it exists
            No we aren't using threading for this. The way I implemented flickering was to use "half blocking" for keypresses, and update flickering monsters in-between those intervals (so e.g. every 100ms or so it stops waiting, updates display, goes back to waiting for key press).

            Originally posted by BreathesFire
            6- Let's pretend I am overambitious and want to build a opengl "port" of the game. Should I be hacking apart z-term.c or should I be working a layer underneath?
            This would be awesome!

            For starters, I would just try to implement something like main-sdl.c but using your GL library (e.g. Glut) for graphics.

            If (or really, when) you hit points where you can't do the things you want, you'll then want to burrow down and refactor the underlying z-term code (as well as possibly other code) to allow the flexibility you want.

            While Takkaria does have a UI upgrade planned, I personally would not wait on that if I had a good idea for a new front-end. In fact, having an ambitious front-end design goal would probably help guide/motivate that refactor itself.

            Originally posted by BreathesFire
            10- Is the codebase attempting to switch to OO design?
            No, not so far. The current movement (at least from my POV) is really toward "modern" software design. That is, reducing the number of global variables, enforcing something like the Law of Demeter, reducing the degree to which developers must "keep in their heads" the dependencies between seemingly unrelated things, etc.

            The old design requires a lot of setting variables in concert, knowing exactly when certain functions need to be called to recalculate things, etc. The goal is to move to a world where a developer doesn't need to know these things, but rather can look at an API and figure out which function to call to effect the desired outcome.

            We're simultaneously trying to reduce the total number of lines of code, improve documentation, and add exciting features. What could possibly go wrong?

            Originally posted by BreathesFire
            Sorry to bother anyone!
            Not at all. Thanks for asking. As Magnate said, if you use IRC come hang out in #angband-dev on Freenode and you can ask more questions in real time!
            linux->xterm->screen->pmacs

            Comment

            • nppangband
              NPPAngband Maintainer
              • Dec 2008
              • 926

              #7
              Originally posted by d_m
              No we aren't using threading for this. The way I implemented flickering was to use "half blocking" for keypresses, and update flickering monsters in-between those intervals (so e.g. every 100ms or so it stops waiting, updates display, goes back to waiting for key press).
              @d_m - by the way, when I put the flicker monsters feature in NPP, I couldn't find any any code changes for the mac port (main.crb). It that not supported at this time, or did somebody eventually figure out how to do it?
              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

              • d_m
                Angband Devteam member
                • Aug 2008
                • 1517

                #8
                Originally posted by nppangband
                @d_m - by the way, when I put the flicker monsters feature in NPP, I couldn't find any any code changes for the mac port (main.crb). It that not supported at this time, or did somebody eventually figure out how to do it?
                Honesty I think I forgot to do it. Shameful!

                I will let you know when I get main-cocoa and main-crb fixed.
                linux->xterm->screen->pmacs

                Comment

                • nppangband
                  NPPAngband Maintainer
                  • Dec 2008
                  • 926

                  #9
                  Originally posted by d_m
                  Honesty I think I forgot to do it. Shameful!

                  I will let you know when I get main-cocoa and main-crb fixed.
                  I haven't tried to create a cocoa port of NPP. When was that created? It wasn't in Angband 3.1.2v2.

                  Thanks, and I hope your home is on high ground & not underwater these days.
                  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

                  • Max Stats
                    Swordsman
                    • Jun 2010
                    • 324

                    #10
                    Originally posted by BreathesFire
                    9- How do you beat Sauron without pillar dancing?
                    For me, I usually choose a missile weapon with extra shots combined with acid-branded ammo. This usually at least gets him softened up.
                    If beauty is in the eye of the beholder, then why are beholders so freaking ugly?

                    Comment

                    • d_m
                      Angband Devteam member
                      • Aug 2008
                      • 1517

                      #11
                      Originally posted by nppangband
                      I haven't tried to create a cocoa port of NPP. When was that created? It wasn't in Angband 3.1.2v2.
                      It was contributed by Peter Ammon (http://ridiculousfish.com) on August 30th (which also happened to be my birthday).

                      Originally posted by nppangband
                      Thanks, and I hope your home is on high ground & not underwater these days.
                      We have been getting a ton of rain, but so far Philadelphia's mostly been OK (especially West Philly which is on higher ground).
                      linux->xterm->screen->pmacs

                      Comment

                      • BreathesFire
                        Rookie
                        • Aug 2011
                        • 9

                        #12
                        Thanks for the responses. I will look at the main SDL entry code and see if I can learn from there. I guess the first hurdle will be setting up the compiler/makefile to handle a different main and then figuring out where I can spam print messages for error tracking =p

                        I assumed some of the code was object designed when going through some of the z-files, since most files had all functions with similar object pointers. I'm used to coding pseudo-objects in lua, which essentially operate in that manner.

                        As for acid branded weapons, I'm sure I can find one within my museum... I mean my home. I just assumed that all the high end nasties resisted all elements.

                        Comment

                        • artes
                          Adept
                          • Jun 2011
                          • 113

                          #13
                          Welcome to the development department, BreathesFire. One way to begin developing would be to search the bug tracker for the ticket that seems to be the easiest. Find the specific place in the code where a change is needed and make the change. After solving a few tickets, you will have got more used to how the code is organized and will understand it better.

                          Comment

                          • Nick
                            Vanilla maintainer
                            • Apr 2007
                            • 9634

                            #14
                            Originally posted by Magnate
                            6. You arrive in the midst of takkaria's ambition to split the UI from the core game completely - see this article for more details. The layers are not yet properly split, so you would need to help work on that before you could easily build an opengl front-end. If you were impatient, you could just try writing main-gl.c instead ...
                            Just a thought on this. Rather than Core-UI split, might it be useful to think in terms of Game-Base-UI split? So there's game code (obvious), base code (file handling, text handling, RNG, parser, etc etc ... preferably made into a library ...) and UI (comes in various flavours).
                            One for the Dark Lord on his dark throne
                            In the Land of Mordor where the Shadows lie.

                            Comment

                            • Magnate
                              Angband Devteam member
                              • May 2007
                              • 5110

                              #15
                              Originally posted by Nick
                              Just a thought on this. Rather than Core-UI split, might it be useful to think in terms of Game-Base-UI split? So there's game code (obvious), base code (file handling, text handling, RNG, parser, etc etc ... preferably made into a library ...) and UI (comes in various flavours).
                              I had been thinking along these lines too. In my world, low-level bitflag handling goes in the library, but the effects of object flags go in the game code - with calls to the UI for any input requirements or display consequences.
                              "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                              Comment

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