Version 4 (modified by nckmccnnll, 6 years ago) (diff)

Add file re-org planning bit

This is a place for planning the major code restructure. Currently it's just a fairly disorganised list. Please add as you see fit.

  • Command code redo - the main part of the core/UI split (takkaria)
  • Dungeon generation code generalisation - largely allowing greater control over monster generation (Nick)
  • Trap layer (so traps are no longer terrain) (Nick)
  • CAVE_* layer bitflagising and list-*.h-ing (probably unnecessary, and low priority) (Nick)
  • Removal of FEAT_* as much as possible, replace with terrain flags and/or feature predicates (cave_is*, feat_is*, feature_is*) (Nick)
  • Moving game data and code out of switches and into tables and edit files (where possible and appropriate) (molybdenum)
    • effect_do() (effects.c)
    • make_attack_normal() (melee2.c)
    • project_*() (spells1.c)
    • x-spell.c
    • tval stuff (from all over)
  • Extract inventory code into its own module (molybdenum)
  • Decouple a lot of the player spell stuff to make it more flexible (molybdenum)
    • Spell count controlled by number of B rows in p_class.txt (instead of fixed at PY_MAX_SPELLS)
    • Add "book" sections (or edit file) to control contents and ordering of spells in a book (instead of I rows in spell.txt)
    • Consolidate all spells IDs into one list instead of per-realm (will probably break save files)

Some ideas about how to re-organise files and code among them (Nick):

  • files thematically grouped, whether in directories or just by name
  • one possible grouping is low-level, ui, game, command, world, monster, object, character, wizard
  • low-level .c files (mainly the z-*.c) would still have their own .h files
  • all those included in a single file (angband.h?) for easy inclusion
  • not sure about .h files for others - but certainly not cross-grouping, and try to include sparingly
  • probably either one .h per .c or one .h per group make sense, but other ideas _really_ welcome