X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=dungeon.c;fp=dungeon.c;h=feb98e79be2f7069dbf523049bfd0da20b0e6dde;hb=3e19c39f579dacb20c1c9b6fc1a26c8d106f1365;hp=fea3c6d217cda8d48857e75ee6f88e4820190a80;hpb=c3a2816821512b59a09866a594a9bec699193271;p=open-adventure.git diff --git a/dungeon.c b/dungeon.c index fea3c6d..feb98e7 100644 --- a/dungeon.c +++ b/dungeon.c @@ -1,9 +1,88 @@ /* * The dungeon compiler. Turns adventure.text into a set of C initializers - * defining (mostly) invariant state. A couple of slots are messed with - * at runtime. + * defining invariant state. */ +/* Current limits: + * 12600 words of message text (LINES, LINSIZ). + * 885 travel options (TRAVEL, TRVSIZ). + * 330 vocabulary words (KTAB, ATAB, TABSIZ). + * 35 "action" verbs (ACTSPK, VRBSIZ). + * There are also limits which cannot be exceeded due to the structure of + * the database. (E.G., The vocabulary uses n/1000 to determine word type, + * so there can't be more than 1000 words.) These upper limits are: + * 1000 non-synonymous vocabulary words + * 300 locations + * 100 objects + */ + +/* Description of the database format + * + * + * The data file contains several sections. Each begins with a line containing + * a number identifying the section, and ends with a line containing "-1". + * + * Section 3: Travel table. Each line contains a location number (X), a second + * location number (Y), and a list of motion numbers (see section 4). + * each motion represents a verb which will go to Y if currently at X. + * Y, in turn, is interpreted as follows. Let M=Y/1000, N=Y mod 1000. + * If N<=300 it is the location to go to. + * If 300500 message N-500 from section 6 is printed, + * and he stays wherever he is. + * Meanwhile, M specifies the conditions on the motion. + * If M=0 it's unconditional. + * If 0