Implementing the restructure changes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9637

    Originally posted by PowerWyrm
    The problem with average items is obvious: there is nothing to learn. That's why they are immediately identified.
    There aren't flags to learn, but there are still ID_ flags to set. So an average item when picked up but not sensed should still have, for example, its ID_TO_H flag not set, so neither its name nor its description should include that information.

    Once it is sensed, it then becomes clear that it doesn't have a + to hit (etc), and it gets recognised as average and completely identified.

    This is the way I intended it to work, anyway.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • PowerWyrm
      Prophet
      • Apr 2008
      • 2986

      Onto the next batch of updates: say goodbye to player inventory, say hello to player gear. This is clearly going to be a huge pain in the ass in my variant, which needs to maintain two separate sets of player gear, one for the client, one for every player on the server.
      PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9637

        Originally posted by PowerWyrm
        Onto the next batch of updates: say goodbye to player inventory, say hello to player gear. This is clearly going to be a huge pain in the ass in my variant, which needs to maintain two separate sets of player gear, one for the client, one for every player on the server.
        Wait until the bit where the object list gets removed
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • PowerWyrm
          Prophet
          • Apr 2008
          • 2986

          Originally posted by PowerWyrm
          Onto the next batch of updates: say goodbye to player inventory, say hello to player gear. This is clearly going to be a huge pain in the ass in my variant, which needs to maintain two separate sets of player gear, one for the client, one for every player on the server.
          I've implemented the first big changeset (18fbf7d). The code compiles cleanly, the server starts, but the client crashes instantly when trying to generate a character. I hope it's just a problem with gear updates done too soon (before the character is actually "alive").

          Edit: pfft, it was just a malformed scanf on the client...
          Last edited by PowerWyrm; May 7, 2015, 12:45.
          PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

          Comment

          • PowerWyrm
            Prophet
            • Apr 2008
            • 2986

            At this point, the code combines equipped and non-equipped items (the starting wielded torch and the ones in inventory), doesn't update equipped items properly (equipment shows nothing) and then makes the character wield the scroll of word of recall in the inventory next time it loads from the savefile...

            I'm gonna take a 2-week break (holidays) and I suppose this is gonna be fun to fix all these when I come back (hoping most of this stuff is fixed with the next changesets).
            PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

            Comment

            • PowerWyrm
              Prophet
              • Apr 2008
              • 2986

              Originally posted by PowerWyrm
              Actually the old code was doing this:

              1) Compute dice power (simply does power for xdy, independently of brands and slays)

              2) Add power once for all objects (to take into account the dice)

              3) Compute an averaged "slay" multiplier: 1 for objects with no slays/brands, something greater than 1 for objects with slays/brands

              4) Add power again for all objects (multiplier * dice power)

              So the dice power was indeed added twice. Was that a bug or not, no idea... But the current code (part 4) now adds 0 for items without brands and 1+x for items with brands. If you don't want to add the power twice for items with slays/brands, you need to substract 1 to the best multiplier when computing the averaged multiplier for slays.
              I was looking at that code again and it's more tricky than I thought. The old code was actually doing this:
              - list all slays/brands, if none, multiplier = 0
              - list all "known" slays/brands, if none, multiplier = 1, if some, multiplier > 1
              - power = dice power + multiplier * dice power

              The new code in slay_power() should then do:

              Code:
                  int num = 0;
              
                  /* Count the brands and slays */
                  while (brands)
                  {
                      num++;
                      brands = brands->next;
                  }
                  while (slays)
                  {
                      num++;
                      slays = slays->next;
                  }
              
                  /* If there are no slays or brands return */
                  if (num == 0) return p;
              
                  /* Count the known brands and slays */
                  ...
              
                  /* If there are no known slays or brands return */
                  if ((num_brands + num_slays + num_kills) == 0) return p + dice_pwr;
              PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

              Comment

              • PowerWyrm
                Prophet
                • Apr 2008
                • 2986

                Originally posted by PowerWyrm
                At this point, the code combines equipped and non-equipped items (the starting wielded torch and the ones in inventory), doesn't update equipped items properly (equipment shows nothing) and then makes the character wield the scroll of word of recall in the inventory next time it loads from the savefile...

                I'm gonna take a 2-week break (holidays) and I suppose this is gonna be fun to fix all these when I come back (hoping most of this stuff is fixed with the next changesets).
                And my 2-week break is over...

                I've implemented everything up to May 26, 2014 -- which means I'm exactly one year behind. Most gear problems are now fixed and I'm starting to implement the gold changes. Found a little simplification that could be made in place_monster(), line 801:

                Code:
                obj = make_gold(player->depth, lookup_kind(TV_GOLD, kind->sval)->name);
                At this point, "kind" is already some gold because of the "tval_is_money_k" check. This could be simplified as:

                Code:
                obj = make_gold(player->depth, kind->name);
                PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

                Comment

                • Nick
                  Vanilla maintainer
                  • Apr 2007
                  • 9637

                  Originally posted by PowerWyrm
                  At this point, "kind" is already some gold because of the "tval_is_money_k" check. This could be simplified as:

                  Code:
                  obj = make_gold(player->depth, kind->name);
                  Thanks, that was dumb. Good to have you back
                  One for the Dark Lord on his dark throne
                  In the Land of Mordor where the Shadows lie.

                  Comment

                  • PowerWyrm
                    Prophet
                    • Apr 2008
                    • 2986

                    Just a minor change in gameplay: in 3.5, ego weapons of "Slay Undead" were limited to sval=18 for hafted weapons, which is not the case in 4.0. This means that pointless Maces of Disruption of Slay Undead can be generated.
                    PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

                    Comment

                    • PowerWyrm
                      Prophet
                      • Apr 2008
                      • 2986

                      Originally posted by PowerWyrm
                      Just a minor change in gameplay: in 3.5, ego weapons of "Slay Undead" were limited to sval=18 for hafted weapons, which is not the case in 4.0. This means that pointless Maces of Disruption of Slay Undead can be generated.
                      This is also true for MoD of *Slay Undead*.

                      In the same changeset, sval limit for DSM of Resistance/Elvenkind of 29 was replaced by individual DSMs, including PDSM which sval was 30 and therefore should not be included.
                      PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

                      Comment

                      • PowerWyrm
                        Prophet
                        • Apr 2008
                        • 2986

                        Changeset 26d9993:

                        In do_cmd_knowledge_ego_items(), one line of code has been wrongly deleted:

                        Code:
                        				/* Ignore duplicate gids */
                        				if (j > 0 && gid == default_join[e_count - 1].gid) continue;
                        This means that when you find some arrows of Acid, the menu will display three "of Acid" lines (checked with the latest angband-v4.0beta-265-g3a93c47 release).
                        PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

                        Comment

                        • PowerWyrm
                          Prophet
                          • Apr 2008
                          • 2986

                          Here's a little bug I've found while implementing the gear changes: when you inspect a ring of digging +5 worn on the right hand while having another ring on the left hand, it will say "clears granite in 19 turns"; if you inspect it while having nothing on the left hand, it will say "clears granite in 9 turns".

                          This problem arises because the code makes a copy of the object and puts it in the "wield_slot". If the ring is on the right hand, the "wield_slot" becomes the left hand, and so the calculation is made as if the character was wielding two rings, not one.

                          The old code was doing a check that was removed during the restructure:

                          Code:
                              /*
                               * Hack -- if we examine a ring that is worn on the right finger,
                               * we shouldn't put a copy of it on the left finger before calculating
                               * digging skills.
                               */
                              if (o_ptr != &p_ptr->inventory[INVEN_RIGHT]) inven[sl] = *o_ptr;
                          The easiest way to fix the problem is simply to make the copy only if the object is not already equipped.
                          PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

                          Comment

                          • PowerWyrm
                            Prophet
                            • Apr 2008
                            • 2986

                            Time to port the new spell code. You can easily imagine the pain with a variant that has TEN spell realms...
                            PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

                            Comment

                            • Nick
                              Vanilla maintainer
                              • Apr 2007
                              • 9637

                              Originally posted by PowerWyrm
                              Time to port the new spell code. You can easily imagine the pain with a variant that has TEN spell realms...
                              It should make them easier to deal with later though - that's the intent, anyway...
                              One for the Dark Lord on his dark throne
                              In the Land of Mordor where the Shadows lie.

                              Comment

                              • PowerWyrm
                                Prophet
                                • Apr 2008
                                • 2986

                                Spell code ported! Now to atomic effects...

                                Just looking at the new code, unifying item and spell effects seems to have removed the chance of cancelling item effects when the effect couldn't be applied so that the item wouldn't be wasted. For example, reading a scroll of Rune of Protection would do:

                                Code:
                                return warding_glyph(player);
                                while casting the Rune of Protection spell would do:

                                Code:
                                warding_glyph(player);
                                return TRUE;
                                In the first case, returning FALSE would tell the code not to use up the scroll.

                                In the new code, the second case is always used. Now items are always used up... Feature or bug?
                                PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

                                Comment

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