Opened 11 years ago

Closed 10 years ago

Last modified 9 years ago

#19 closed change (fixed (in master))

Add trap detection indicator

Reported by: takkaria Owned by:
Milestone: 3.1.0 Keywords: ui patch
Cc:

Description

Attachments (1)

dtrap-vanilla.v1.diff (11.9 KB) - added by takkaria 10 years ago.
Old patch as a basis for future work

Download all attachments as: .zip

Change History (6)

comment:1 Changed 10 years ago by takkaria

Related idea:

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

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

comment:2 Changed 10 years ago by andrewdoull

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.
  1. 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.
  1. 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.

comment:3 Changed 10 years ago by takkaria

  • component changed from Interface to Main game
  • Keywords ui patch added

Changed 10 years ago by takkaria

Old patch as a basis for future work

comment:4 Changed 10 years ago by takkaria

  • Resolution set to fixed
  • Status changed from new to closed

see [115e4ba] (SVN r305).

comment:5 Changed 9 years ago by takkaria

  • Milestone changed from 3.2.0 to 3.1.0
Note: See TracTickets for help on using tickets.