DaJAngband -I'm in over my head

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • will_asher
    DaJAngband Maintainer
    • Apr 2007
    • 1124

    DaJAngband -I'm in over my head

    Well, I've successfully done a few minor changes to the code, but whenever I think of something more major I'd like to change (like add a store or add a school of magic) I'm in over my head. I can't do it without knowing C. It kindof makes me want to learn C, but teaching myself a programming language without personally knowing anyone else who knows the language is extremely hard. I have a tutorial in pdf format which I download from somewhere.
    I figured out how to make another building on the map in the generate.c file, but actually adding a new store or a school of magic seem to be very complicated (at least for someone who doesn't know C).
    Also, I made a change somewhere that made it crash, so I undid the change and it still crashed. Since I hadn't backed the source up after each change, I had to start over making my changes again to the original code. This time, I couldn't get it to put my new weapons in the shops even though it worked before and I'm doing it the same way.
    DaJAngband is still a decent semi-variant which I have fun playing with only the minor changes, but there was more I would've liked to do.
    Last edited by will_asher; December 19, 2007, 09:38.
    Will_Asher
    aka LibraryAdventurer

    My old variant DaJAngband:
    http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)
  • zaimoni
    Knight
    • Apr 2007
    • 590

    #2
    Originally posted by will_asher
    Also, I made a change somewhere that made it crash, so I undid the change and it still crashed. Since I hadn't backed the source up after each change, I had to start over making my changes again to the original code.
    1) If you can install a version control server, undoing changes correctly becomes a matter of self-discipline. (I've paid the learning curve for SVN. Just about anything that intentionally improves on CVS is both better than nothing, and should give a good first experience with source code control.)

    2) I really can't imagine doing savegame format changes without a series of readonly reference files. Recovering from file import bugs can be a real pain.
    Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
    Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
    Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

    Comment

    • Marvel@ourden.org

      #3
      The game is not downloadable from http://www.geocities.com/will_asher/...DaJAngband.htm. I wish you better hosting, and i can provide you space at http://rogue-life.ourden.org. I guess u can host files at Roguelike Temple or whereever you like, and it would be better than geocities.
      Last edited by Guest; February 13, 2008, 20:40.

      Comment

      • will_asher
        DaJAngband Maintainer
        • Apr 2007
        • 1124

        #4
        Wow, DaJAngband is on a roguelike games website, thanks for posting it there! The download works now, it was just a slight mistake on my part in the html code. I'd like to get it downloadable from that rogue-life site too, how can I do that?
        Will_Asher
        aka LibraryAdventurer

        My old variant DaJAngband:
        http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

        Comment

        • Antoine
          Ironband/Quickband Maintainer
          • Nov 2007
          • 1010

          #5
          Originally posted by will_asher
          Well, I've successfully done a few minor changes to the code, but whenever I think of something more major I'd like to change (like add a store or add a school of magic) I'm in over my head. I can't do it without knowing C. It kindof makes me want to learn C, but teaching myself a programming language without personally knowing anyone else who knows the language is extremely hard. I have a tutorial in pdf format which I download from somewhere.
          I figured out how to make another building on the map in the generate.c file, but actually adding a new store or a school of magic seem to be very complicated (at least for someone who doesn't know C).
          Also, I made a change somewhere that made it crash, so I undid the change and it still crashed. Since I hadn't backed the source up after each change, I had to start over making my changes again to the original code. This time, I couldn't get it to put my new weapons in the shops even though it worked before and I'm doing it the same way.
          DaJAngband is still a decent semi-variant which I have fun playing with only the minor changes, but there was more I would've liked to do.
          I think your next goal should be to get your best changes into V (and/or other variants).

          A.
          Ironband - http://angband.oook.cz/ironband/

          Comment

          • will_asher
            DaJAngband Maintainer
            • Apr 2007
            • 1124

            #6
            Originally posted by Antoine
            I think your next goal should be to get your best changes into V (and/or other variants).
            how would this happen except that someone plays my game (or at least reads the change list), likes an idea, and puts it in their variant? Doesn't sound like it's something that I do, that's up to other people if they feel like it.

            BTW, the text you quoted/replied to is kindof out of date


            EDIT: On the original topic of this old thread: I just made a change in the code which added an item flag which makes the item prevent hp regeneration (for certain cursed artifacts like the One Ring -I always thought it should have more of a drawback). Then I compiled and loaded my saved game. Suddenly my character was not attacking monsters. I moved into a monster and it didn't attack. How could this happen when the code change I made had nothing to do with attacking?
            Will_Asher
            aka LibraryAdventurer

            My old variant DaJAngband:
            http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

            Comment

            • Pete Mack
              Prophet
              • Apr 2007
              • 6883

              #7
              Originally posted by will_asher
              how would this happen except that someone plays my game (or at least reads the change list), likes an idea, and puts it in their variant? Doesn't sound like it's something that I do, that's up to other people if they feel like it.

              BTW, the text you quoted/replied to is kindof out of date


              EDIT: On the original topic of this old thread: I just made a change in the code which added an item flag which makes the item prevent hp regeneration (for certain cursed artifacts like the One Ring -I always thought it should have more of a drawback). Then I compiled and loaded my saved game. Suddenly my character was not attacking monsters. I moved into a monster and it didn't attack. How could this happen when the code change I made had nothing to do with attacking?
              It can't, if you added it to preexisting values. If you changed any existing values, you may have changed something like FA into Fear (eg.)
              In any case, this is where version control would help a lot.

              svn or cvs would show you your changes vs your previous accepted work. svn.

              Comment

              • will_asher
                DaJAngband Maintainer
                • Apr 2007
                • 1124

                #8
                I had it backed up so undoing the changes is no problem (I learned from last time). I just wondered how something like that could happen.

                Which pre-existing values are you talking about? What I did was search everywhere DRAIN_EXP was in the code, and added the equivelent for NOREGEN (excepting the part that actually drained hps). Where there was an "XXX4" next to the bad flags, I used that spot when I added NOREGEN. isn't something like "XXX4" just a placeholder for something to be added later?
                and I found out that DRAIN_EXP was connected to
                "p_ptr->exp_drain" so I did the same thing for that,
                then I made it so that the player would not regenerate if
                "p_ptr->noregen" was true. None of it had anything to do with attacking, and in the game, it didn't say I was afraid or anything.
                Last edited by will_asher; February 14, 2008, 07:21.
                Will_Asher
                aka LibraryAdventurer

                My old variant DaJAngband:
                http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

                Comment

                • will_asher
                  DaJAngband Maintainer
                  • Apr 2007
                  • 1124

                  #9
                  I just tried to add a player state that would be caused by a monster or potion and have certain effects.
                  Other player states are in struct player_type in types.h, so I added them there,
                  as "s16b slime; /* DAJ: slimed state */" just like the other player states are.
                  And I made the nessesary additions in save.c and load.c, and thats all I changed before I compiled just to see if it would run right with that changed. When I ran the game, the display was completely messed up. How in the world would that change mess up the display? The thing I changed had nothing to do with the display.
                  I just don't get it, maybe it's time I gave up on trying to do new things by hacking the code. I just don't have the time to learn to understand all the C code, and I'd be more motivatied to learn it if things made sense.
                  Will_Asher
                  aka LibraryAdventurer

                  My old variant DaJAngband:
                  http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

                  Comment

                  • pav
                    Administrator
                    • Apr 2007
                    • 793

                    #10
                    You started a new character? I'd worry you broke the savefile format.
                    See the elves and everything! http://angband.oook.cz

                    Comment

                    • will_asher
                      DaJAngband Maintainer
                      • Apr 2007
                      • 1124

                      #11
                      Yes, I started a new character. I thought the change would probably break savefiles.
                      Will_Asher
                      aka LibraryAdventurer

                      My old variant DaJAngband:
                      http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

                      Comment

                      • zaimoni
                        Knight
                        • Apr 2007
                        • 590

                        #12
                        Originally posted by will_asher
                        I just tried to add a player state that would be caused by a monster or potion and have certain effects.
                        Other player states are in struct player_type in types.h, so I added them there,
                        as "s16b slime; /* DAJ: slimed state */" just like the other player states are.
                        And I made the nessesary additions in save.c and load.c, and thats all I changed before I compiled just to see if it would run right with that changed. When I ran the game, the display was completely messed up. How in the world would that change mess up the display? The thing I changed had nothing to do with the display.
                        Did you do a *clean* build (no object files)? I've had to do that once or twice to get rid of side effects like that. If that doesn't work, you've got something writing to an array out-of-bounds; the code change moved where the bad writes were happening to where they trashed the display.

                        Also: if you forked from after V3.0.6, or imported the new event-code from V3.0.8+, it might be worth proofreading game_events.c against V SVN (there was a hairy size error to malloc that took down Zaiband on Vista/MingW32 with full Data Execution Prevention but was no-effect on W2K/MingW32 build; Zaiband 3.0.8 alpha will have this fixed.)
                        Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
                        Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
                        Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011

                        Comment

                        • will_asher
                          DaJAngband Maintainer
                          • Apr 2007
                          • 1124

                          #13
                          wow. thanks for reminding me to try this. it seems to run fine now with those same changes. wow. how stupid of me. thanks.

                          it'd be nice if the compiler automatically created new .o files each time.
                          Will_Asher
                          aka LibraryAdventurer

                          My old variant DaJAngband:
                          http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

                          Comment

                          • takkaria
                            Veteran
                            • Apr 2007
                            • 1951

                            #14
                            Originally posted by will_asher
                            wow. thanks for reminding me to try this. it seems to run fine now with those same changes. wow. how stupid of me. thanks.

                            it'd be nice if the compiler automatically created new .o files each time.
                            Which compiler are you using?
                            takkaria whispers something about options. -more-

                            Comment

                            • will_asher
                              DaJAngband Maintainer
                              • Apr 2007
                              • 1124

                              #15
                              Dev C++
                              It works just fine for everything else.
                              Will_Asher
                              aka LibraryAdventurer

                              My old variant DaJAngband:
                              http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

                              Comment

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