Implementing the changes from the 4.1 feature branches

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PowerWyrm
    Prophet
    • Apr 2008
    • 2986

    #16
    Seems like the previous stuff needs to be updated for all detection effects. For example, you can cast Detect Doors to reveal some doors, then a monster destroys one of them (knowledge is not updated), but when casting Detect Doors again you still see the now destroyed door. At this point, the door should be forgotten (knowledge should be updated).

    Something like this:

    Code:
    /* Detect doors */
    if (square_isdoor(cave, y, x)) {
    square_memorize(cave, y, x);
    /*square_light_spot(cave, y, x);*/
    doors = TRUE;
    }
    
    /* Forget unknown doors in the mapping area */
    if (square_isdoor(cave_k, y, x) && square_isnotknown(cave, y, x)) square_forget(cave, y, x)
    
    ...
    
    /* Fully update the visuals */
    /* Redraw map, ... */
    Last edited by PowerWyrm; February 15, 2016, 14:01.
    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

      #17
      Cave stuff is now properly implemented in PWMAngband. Time to fix traps before attacking the object part.
      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

        #18
        Player trap knowledge is now fully implemented in PWMAngband! Players now only update their knowledge of traps when seeing or detecting them. Display/targeting use the memorized trap. This also includes glyphs.

        As I feared, I had to add a trap structure to player->cave and copy the trap from cave when memorizing it. This means I'll have to do the same thing for objects and get rid of the player->obj_marked system in favor of a new object structure in player->cave. At first sight, it seems easy to implement: copy the object from cave when memorizing it (seeing or detecting) and remove "marks" otherwise, use the memorized object for display and targeting. Unfortunately, there's the squelch system...
        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

          #19
          First part of object knowledge implemented. It seems to work, but sometimes I get memory overwrite errors. I'll have to investigate...

          For now, floor_pile_sense() only updates detection if the object is not known, which means that sensing stays "truly" fuzzy: like ignored items, items that have disappeared from cave for any reason (crushed, picked up, breathed on...) still appear as * on the map. This is probably the most consistent behavior.

          In floor_pile_know(), I've simplified the system to only update knowledge if known and real objects are not identical. For that I added a function that compares two objects (currently in Angband, comparison is done at pointer level which cannot work since the known object is a "copy" of the real one) and use it to forget and/or update knowledge.

          Now I'll have to apply the new system to detection, targeting and object list. Then I'll implement the "known" part of the object structure...
          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

            #20
            On to the "known" part of the object structure...

            Originally posted by PowerWyrm
            The PWMAngband system... not so trivial ("known" field on the object, "obj_marked" array on the player):
            - object is generated: object is added to list, known object is null, obj_marked is null for every player
            - object is detected by player: known object can be anything (could remain null to spare memory), obj_marked is set to "unknown object" for that player
            - object is seen by player: known object can be anything (could remain null to spare memory), obj_marked is set to something (flag? tval? object?) for that player
            - object is picked up (and worn): object is removed from list and added to gear, known object is created with learned properties, obj_marked is null for every player that can "see the pickup"
            - object is dropped: object is removed from gear and added to list, obj_marked is set for every player that can "see the drop"
            Unfortunately I will have to create obj->known at the same time as obj. This will double the memory required for object management, but will simplify the whole system. So:
            - object is created: known object is set with base properties (kind, tval and such)
            - something is learned about the object: known object is updated
            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

              #21
              Commit 04e0edd: in slay_power(), due to this change, known objects will be considered having no brands and slays.

              Instead of

              Code:
              	/* Count the known brands and slays */
              	if (!known && obj->known) {
              		brands = obj->known->brands;
              		slays = obj->known->slays;
              	} else {
              		brands = NULL;
              		slays = NULL;
              	}
              it should be

              Code:
              	/* Count the known brands and slays */
              	if (!known) {
                         if (obj->known) { 
              		brands = obj->known->brands;
              		slays = obj->known->slays;
              	  } else {
              		brands = NULL;
              		slays = NULL;
                        }
              	}
              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

                #22
                Player knowledge is now fully implemented. I'll give me up to the end of the week to fix remaining bugs before a new PWMAngband release (need it for a couple critical bugs, especially to fix the visible password problem).

                Up to now I've got one crash on the client when wearing an amulet from the floor, but that's it. Unfortunately, I've not been able to reproduce it yet. I hope I didn't slow down the game further with the new changes... Seems to be ok when playing locally, would need to connect to a distant server to test the game in multiplayer mode.
                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...
                😀
                😂
                🥰
                😘
                🤢
                😎
                😞
                😡
                👍
                👎