monster knowledge

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tibarius
    Swordsman
    • Jun 2011
    • 429

    monster knowledge

    Still working on a variant version, which restricts itself to modifying /lib/gamedata files.

    My goal ... to modify the monsters in monster.txt.

    To make a complete redo of that, i have to redo monster_base.txt as well.

    While i change monster_base.txt the monster knowledge information available with '~' => monster knowledge seems to be hardcoded in some way.

    version 3.5.1: i redo monster_base.txt but monster knowledge seems hardcoded
    version 4.0.4: same as in 3.5.1, ancient dragons and dragons show up below the same group in monster knowledge, is that hardcoded??? (cause i noticed no file in gamedata which seems to define those groups)
    version 4.2.0: now suddenly a new 'group' shows up not defined in monster_base.txt, for example 'Men' group for 'townfolks' group.

    Anyone can tell me if changing monster_base.txt can cause conflicts with (still) hardcoded tables?

    I got some issues starting a new game in version 3.5.1 if i use an opened player file (no issues in the 1st try using a new player file).
    Blondes are more fun!
  • wobbly
    Prophet
    • May 2012
    • 2633

    #2
    Hardcoded

    For 4.x in ui-knowledge.c

    Code:
    /**
     * ------------------------------------------------------------------------
     *  MONSTERS
     * ------------------------------------------------------------------------ */
    
    /**
     * Description of each monster group.
     */
    static struct
    {
    	const wchar_t *chars;
    	const char *name;
    } monster_group[] = {
    	{ (const wchar_t *)-1,   "Uniques" },
    	{ L"A",        "Ainur" },
    	{ L"a",        "Ants" },
    	{ L"b",        "Bats" },
    	{ L"B",        "Birds" },
    	{ L"C",        "Canines" },
    	{ L"c",        "Centipedes" },
    	{ L"uU",       "Demons" },
    	{ L"dD",       "Dragons" },
    	{ L"vE",       "Elementals/Vortices" },
    	{ L"e",        "Eyes/Beholders" },
    	{ L"f",        "Felines" },
    	{ L"G",        "Ghosts" },
    	{ L"OP",       "Giants/Ogres" },
    	{ L"g",        "Golems" },
    	{ L"H",        "Harpies/Hybrids" },
    	{ L"h",        "Hominids (Elves, Dwarves)" },
    	{ L"M",        "Hydras" },
    	{ L"i",        "Icky Things" },
    	{ L"FI",       "Insects" },
    	{ L"j",        "Jellies" },
    	{ L"K",        "Killer Beetles" },
    	{ L"k",        "Kobolds" },
    	{ L"L",        "Lichs" },
    	{ L"tp",       "Men" },
    	{ L".$!?=~_",  "Mimics" },
    	{ L"m",        "Molds" },
    	{ L",",        "Mushroom Patches" },
    	{ L"n",        "Nagas" },
    	{ L"o",        "Orcs" },
    	{ L"q",        "Quadrupeds" },
    	{ L"Q",        "Quylthulgs" },
    	{ L"R",        "Reptiles/Amphibians" },
    	{ L"r",        "Rodents" },
    	{ L"S",        "Scorpions/Spiders" },
    	{ L"s",        "Skeletons/Drujs" },
    	{ L"J",        "Snakes" },
    	{ L"l",        "Trees/Ents" },
    	{ L"T",        "Trolls" },
    	{ L"V",        "Vampires" },
    	{ L"W",        "Wights/Wraiths" },
    	{ L"w",        "Worms/Worm Masses" },
    	{ L"X",        "Xorns/Xarens" },
    	{ L"y",        "Yeeks" },
    	{ L"Y",        "Yeti" },
    	{ L"Z",        "Zephyr Hounds" },
    	{ L"z",        "Zombies" },
    	{ NULL,       NULL }
    };

    Comment

    • Tibarius
      Swordsman
      • Jun 2011
      • 429

      #3
      code snip

      Thanks Wobbly!
      Blondes are more fun!

      Comment

      • Pete Mack
        Prophet
        • Apr 2007
        • 6883

        #4
        Tibarius--
        Yeah those lists are hardcoded, and they kinda have to be. Some of the sets require special code for particular members of the list (like uniques have no specific letter associated with them.) But you should have seen the nightmarish original code--each set had its own special purpose menu code. It was utterly non-portable and non-maintainable, written with no function pointers. Just reams of prototypical spaghetti code.

        I cut thousands of lines when I cleaned it up--even whils adding 2 more datasets for the hell of it. All you need are an initializer, a couple comparators, and a lore function to add a new set.

        Comment

        Working...
        😀
        😂
        🥰
        😘
        🤢
        😎
        😞
        😡
        👍
        👎