angband-import / angband-trac

Test importing Trac events into Angband
0 stars 0 forks source link

Add trap detection indicator #31

Closed angband-import closed 4 years ago

angband-import commented 4 years ago

Reported by takkaria on 21 Mar 2007 14:23 UTC Patch available: [http://entai.co.uk/angband/patches/dtrap-vanilla.v1.diff]

Related to #18.

angband-import commented 4 years ago

Attachment from takkaria on 16 Jun 2007 12:05 UTC Old patch as a basis for future work REPLACE THIS TEXT WITH UPLOADED FILE ./attachments/TRAC_19_GIT_31/dtrap-vanilla.v1.diff

angband-import commented 4 years ago

Comment by takkaria on 1 May 2007 13:01 UTC Related idea:

http://angband.oook.cz/forum/showpost.php?p=223&postcount=28

Shouldn't be so hard; just need yet another flag.

angband-import commented 4 years ago

Comment by andrewdoull on 10 May 2007 13:16 UTC You've got 8 bits and 8 flags...

There are three ways to do this:

  1. Change cave_info into a 16 bit array. Add CAVE_SAFE flags for where you have detected traps.

  2. Add a second 8 bit play_info array. Separate out 'player'-related flags into the play_info array and keep 'cave'-related flags in the cave_info array. Add PLAY_SAFE flags for where you have detected traps.

  3. Have dun_rooms[by][bx] array preserved after generating the dungeon, have a set of room_flags[n], and convert cave_info[y][x] & (CAVE_ICKY) into room_has_flag(ROOM_ICKY). This has the added benefit of allowing you to expand out to other types of room flags. ROOM_GREATER_VAULT springs to mind, for recording when you enter a vault as a part of the notes patch.

Add CAVE_SAFE flags for where you have detected traps.

3 is more of a hack than 1 or two, but cuts down on the total in memory (note you have to save very few of the cave_info flags, so on disk storage shouldn't be a problem). Note this saving applies only until you have to another flag (unless it's a room based flag like CAVE_GREATER_VAULT).

2 is better than 1 from the perspective of the code in update_view() relies on having very fast byte lookups, which may not be the case any more on modern processors.

angband-import commented 4 years ago

Modified by takkaria on 3 Jun 2007 16:03 UTC

angband-import commented 4 years ago

Comment by takkaria on 8 Jul 2007 17:10 UTC see [115e4ba] (SVN r305).

angband-import commented 4 years ago

Modified by takkaria on 29 Apr 2008 03:27 UTC