X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=dungeon.c;h=feb98e79be2f7069dbf523049bfd0da20b0e6dde;hb=1ec3ef3855632d0c0a5ad7624978bccbb079c380;hp=a8b5f16e59af9a099160c63d2d64f2a55ac10095;hpb=64035d00262d3b10c126748be659d22394b7ed3b;p=open-adventure.git diff --git a/dungeon.c b/dungeon.c index a8b5f16..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