[comp.sources.games.bugs] Another omega core dump bug

still@usceast.UUCP (Bert Still) (02/22/88)

In article <1988Feb18.231022.19805@jarvis.csri.toronto.edu> sam@csri.toronto.edu ("S. Weber") writes:
]I just found another bug (or two) in Omega.  Ok, I'm running around
]below level 33.  I keep finding treasure rooms.  A detect monster
]shows nothing, nor can I see any monsters (even with true sight on).  However,
]x'ing squares beside me shows a monster there.  I can fight them, but if I
]don't, then they don't do anything.  When I walk through those squares, the
]monsters show up on the square I just left (but still don't do anything).
]
	This is strange. I get the same problem... except that the monsters can
attack me (boy, am I tired of the Militant priests destroying my hard won magic
items), but I cannot attack them. I have discovered that this happens only after
you save the game ON THAT LEVEL and then restore it later. So, my advice (until
a fix is found :-) is to save the game after all the monsters on that level have
been "dealt with" and BEFORE you descend to the next level. It seems to provide
a "fix" for now... I've been perusing the code, but I'm not yet sure of what
exactly causes the problem.

]Bug 2 (or 1 1/2?):  I find these altars lying around (no surprise), again
]with nothing appearing on top of them.  However, as before, an x, or
]walking through the square reveals a monster.  The monster's name is
]gibberish (one was 'an injured(level three)', and others were even
]worse garbage).  (Sounds like a wild pointer to me.)  I tried fighting
]in tactical mode with one, with the result that after ordering my
]commands, I was flung back into normal mode.  A ball lightning spell
]on the square resulted in a core dump signal.
]
	I can't get the program to core dump from this, but I can't seem to
kill the High Priest either. I have a suggestion that would greatly help: put
a piece of code in the signalexit() routine that will tell us which signal is
being caught... I suspect that it's a null pointer reference, but have no way
of comfirming this as my copy doesn't actually dump core.

]I suspect that these garbage monsters are supposed to be Renyard the Fox,
]etc., and that it will be hard to win the game if killing the guy
]you are asked to results in a core dump. *sigh*
]-- 
]                              -Sam Weber
]UUCP: {ihnp4 utzoo decwrl uw-beaver}!utcsri!sam
]ARPA: sam@csri.toronto.edu

	Only too true. The missing beasties (which are called a "(level two) ."
in my copy of the game) are in fact the High Priest(s/esses) for the various
deities (Set, Hecate, Odin, Athena) and you need to kill one in order to take 
the title for yourself.

	I would like to take tis oppurtunity to publicly thank Lawrence Brothers
for all of the work and effort he has put into this game, so that the rest of
us can play. :-) I can honestly say that I have given up on the other frp games
that I have seen because they pale horribly by comparison. Now if I can only
figure out why the VAX Curses are so pathelogically different, I can get the
game to run under VMS... (You can play, but you don't get to see a screen :-(
Kind of wrecks the game... )
	Again, thanks Lawrence.

						Bert
						still@cs.scarolina.edu

sheppard@convex.UUCP (02/26/88)

Here is a simple fix for the "I can't attack a monster on a level in a
restored game" problem. The problem is that the monster gets created just
fine, but no link is made between the dungeon location and the monster.
This can happen in any game where you save a level that has monsters on
it. For example, start up a new game, save it, and then go try to talk to
one of the guardsmen at the jail.


*** old_olev.c	Thu Feb 25 09:51:06 1988
--- new_olev.c	Thu Feb 25 09:51:01 1988
***************
*** 817,822
      ml->m->status = read_int(fd);
      ml->m->x = read_int(fd);
      ml->m->y = read_int(fd);
      ml->m->click = read_int(fd);
      ml->m->attacked = read_int(fd);
      ml->m->talkf = read_int(fd);

--- 817,823 -----
      ml->m->status = read_int(fd);
      ml->m->x = read_int(fd);
      ml->m->y = read_int(fd);
+     Dungeon[level][ml->m->x][ml->m->y].creature = ml->m;
      ml->m->click = read_int(fd);
      ml->m->attacked = read_int(fd);
      ml->m->talkf = read_int(fd);


The altars down on levels 34-whatever should indeed have the high priests of
the appropriate deity (each one has a level) on them. The high priest should
also be carrying the holy symbol of the deity. There are at least three
problems here. One is that the NPC get created okay, but the name doesn't
get initialized properly. Another problem is that the level for the NPC in
the omega.hiscore file is listed as 0 - this translates to 0 hit points for
the NPC. These two problems wind up giving you a "grievously injured (level
two)", when it really should say "Tybalt" or some other NPC. The last problem
is that even if this was all done okay, the holy symbol doesn't get created.
The fixes that I have incorporated are to make the levels in omega.hiscore
some arbitrarily large number - I think they are currently set to 10. You
also need some new code. Here is an entire new version of make_hiscore_npc
that should replace the one in omon.c:


pmt make_hiscore_npc(npcid)
int npcid;
{
  pmt npc = (pmt)malloc(sizeof(montype));
  pob ob;
  char *s2;
  int i, treasures, behavior, level, combatype, competence, talktype;

  treasures = 0;
  *npc = Monsters[ML0+4];

  /* each of the high score npc's can be created here */
  switch (npcid) {
  case 0:
    s2 = Hiscorer;
    level = Hilevel;
    behavior = Hibehavior;
    break;
  case 1:
    s2 = Priest[ODIN];
    level = Priestlevel[ODIN];
    behavior = Priestbehavior[ODIN];
    treasures = 14;
    break;
  case 2:
    s2 = Priest[SET];
    level = Priestlevel[SET];
    behavior = Priestbehavior[SET];
    treasures = 17;
    break;
  case 3:
    s2 = Priest[ATHENA];
    level = Priestlevel[ATHENA];
    behavior = Priestbehavior[ATHENA];
    treasures = 16;
    break;
  case 4:
    s2 = Priest[HECATE];
    level = Priestlevel[HECATE];
    behavior = Priestbehavior[HECATE];
    treasures = 15;
    break;
  case 5:
    s2 = Priest[DRUID];
    level = Priestlevel[DRUID];
    behavior = Priestbehavior[DRUID];
    treasures = 18;
    break;
  case 6:
    s2 = Priest[DESTINY];
    level = Priestlevel[DESTINY];
    behavior = Priestbehavior[DESTINY];
    treasures = 19;
    break;
  case 7:
    s2 = Shadowlord;
    level = Shadowlordlevel;
    behavior = Shadowlordbehavior;
    break;
  case 8:
    s2 = Commandant;
    level = Commandantlevel;
    behavior = Commandantbehavior;
    break;
  case 9:
    s2 = Archmage;
    level = Archmagelevel;
    behavior = Archmagebehavior;
    break;
  case 10:
    s2 = Prime;
    level = Primelevel;
    behavior = Primebehavior;
    break;
  case 11:
    s2 = Champion;
    level = Championlevel;
    behavior = Championbehavior;
    break;
  case 12:
    s2 = Prime;
    level = Primelevel;
    behavior = Primebehavior;
    break;
  case 13:
    s2 = Duke;
    level = Dukelevel;
    behavior = Dukebehavior;
    break;
  }
  if (level < 1)
    level = 1;
  strcpy(npc->monstring, s2);
  npc->hp = level*20;
  npc->status = AWAKE+MOBILE+WANDERING;
  combatype = ((int) ((behavior % 100) / 10));
  competence = ((int) ((behavior % 1000) / 100));
  talktype = ((int) (behavior / 1000));
  npc->level = competence;
  if (npc->level < 2*Dlevel) npc->status += HOSTILE;
  npc->xpv = npc->level*20;
  if (npcid == 0) npc->xpv *= 10; /* high scorer worth more xpv */
  switch (combatype) {
  case 1: /* melee */
    npc->meleef = M_MELEE_NORMAL;
    npc->actions = competence;
    if (competence < 3)
      npc->tactics = MM_POOR;
    else if (competence < 6)
      npc->tactics = MM_AVERAGE;
    else npc->tactics = MM_GOOD;
    npc->dmg = competence*5;
    npc->hit = competence*3;
    break;
  case 2: /*missile*/
    npc->meleef = M_MELEE_NORMAL;
    npc->actions = max(2,(2 * competence / 3));
    if (competence < 5)
      npc->tactics = MM_POOR;
    else if (competence < 8)
      npc->tactics = MM_AVERAGE;
    else npc->tactics = MM_GOOD;
    npc->strikef = M_STRIKE_MISSILE;
    npc->dmg = competence*3;
    npc->hit = competence*2;
    break;
  case 3: /* spellcasting */
    npc->meleef = M_MELEE_NORMAL;
    npc->actions = max(2,(competence / 3));
    npc->tactics = MM_POOR+MM_TIMID;
    npc->dmg = competence;
    npc->hit = competence;
    npc->specialf = M_SP_SPELL;
    break;
  case 4: /* thievery */
    npc->meleef = M_MELEE_NORMAL;
    npc->actions = max(2,(2 * competence / 3));
    if (competence < 5)
      npc->tactics = MM_POOR;
    else if (competence < 8)
      npc->tactics = MM_AVERAGE;
    else npc->tactics = MM_GOOD;
    npc->tactics += MM_TIMID;
    npc->dmg = competence;
    npc->hit = competence;
    npc->specialf=M_SP_THIEF;
    break;
  case 5: /* flee */
    npc->actions = max(2,(competence / 3));
    npc->tactics = MM_TIMID+MM_AVERAGE;
    npc->meleef = M_MELEE_NORMAL;
    npc->specialf = M_MOVE_SCAREDY;
    break;

  }
  switch (talktype) {
  case 1: npc->talkf = M_TALK_EVIL; break;
  case 2: npc->talkf = M_TALK_MAN; break;
  case 3: npc->talkf = M_TALK_HINT; break;
  case 4: npc->talkf = M_TALK_BEG; break;
  case 5: npc->talkf = M_TALK_SILENT; break;
  default: mprint("Say Whutt? (npc talk weirdness)"); break;
  }
  if (treasures != 0) {
	ob = (pob)malloc(sizeof(objtype));
	make_artifact(ob, treasures);
	m_pickup(npc, ob);
  }
  npc->uniqueness = UNIQUE_MADE;
  return(npc);
}


Now this fix for make_hiscore_npc causes another problem in that hiscore
NPC's are not saved/restored properly. An easy way to get the holy symbol
is to get down to an appropriate level, save/restore the game, and what
you get is some wimp NPC carrying the holy symbol. I've got a fix for that,
but it's somewhat more complex.

There are a lot more bugs that I've found that I have fixes for. I did
send a list of them to Laurence, who tells me that fixes for them (and
others) will be out shortly in the next version of Omega. Here's the a
partial list of the bugs that I've found:


a. The level that you join a guild on is not saved when you save a game.

b. The pawn shop item list is not saved.

c. Unique monster/item flags are not saved.

d. Monsters are not restored properly. They show up on the screen, but
they don't really exist until they move - you can walk right through
them.

e. Monster corpses are not restored properly. They appear to be empty
items in your pack. You can get any corpse converted for 10 gp because of
this.

f. The "jailed" status is not saved.

g. If you are the wizard, terminating shadowform (^f) asks if you want
to toggle wizard mode.

h. Casting shadowform on level 39 says that some force blocks the spell,
but it works anyway.

i. The Thieve's Guild won't accept Morgon's badge.

j. Bringing the heart of the Eater Of Magic back to the Collegium causes
a coredump.

k. Bringing the crown of the Lawbringer back to the Circle causes a
coredump.

l. Purchasing a non-existant item in the pawn shop causes a coredump.

m. Leaving money in a condo causes a coredump.

n. You sometimes stay in tac mode even after the monster is dead.

o. If your omega.log and omega.lognum files don't accurately reflect
each other, omega will hang when trying to create an NPC for a new level.

p. An item given to a monster doesn't get removed from your pack, even
though it is actually given to the monster.

q. Hi-score NPC names don't get set properly.

r. Hi-score NPC's don't get saved properly.

s. There are lots of little formating problems that aren't worth mentioning
here.

t. Holy symbols don't appear to ever get made. The high priests (Drogo
Mooncalf, Captain Krunch, etc) should probably have them in their possession.

u. An item sold to the pawn shop causes the first item in the pawn shop
list to get blown away to make room for the new item, even if empty slots
exist in the list.


Hope this helps.


------------------------------------------------------------------------
Andy Sheppard
Convex Computer Corporation
{ihnp4,mcnc,sun,uiucdcs}!convex!sheppard

sam@utcsri.UUCP (S. Weber) (02/28/88)

In article <2531@usceast.UUCP> still@usceast.UUCP (Bert Still) writes:
>In article <1988Feb18.231022.19805@jarvis.csri.toronto.edu> sam@csri.toronto.edu ("S. Weber") writes:
>]I just found another bug (or two) in Omega.  Ok, I'm running around
>]below level 33.  I keep finding treasure rooms.  A detect monster
>]shows nothing, nor can I see any monsters (even with true sight on).  However,
>]x'ing squares beside me shows a monster there.  I can fight them, but if I
>]don't, then they don't do anything.  When I walk through those squares, the
>]monsters show up on the square I just left (but still don't do anything).
>]
>	This is strange. I get the same problem... except that the monsters can
>attack me (boy, am I tired of the Militant priests destroying my hard won magic
>items), but I cannot attack them. I have discovered that this happens only after
>you save the game ON THAT LEVEL and then restore it later. 

No.  This is a DIFFERENT BUG.  Nothing to do with saving the game.  Only
monsters in the treasure rooms in those levels have this property. I don't
know whether the recently posted fixes cure this or not--it takes a while
to get a character strong enough to find out.

Also another bug to report:  when you are a student at the College, if
you apply for promotion and are rejected your intelligence goes up!

Also, when you are a gladiator, after you fight the champion, the next
creature to fight is yourself.  However, when you start fighting you
instead find yourself fighting a ROUS.  Something doesn't seem right, there.
-- 
                              -Sam Weber
             "As long as people will accept crap, it will be
           financially profitable to dispense it" --Dick Cavett
UUCP: {ihnp4 utzoo decwrl uw-beaver}!utcsri!sam
ARPA: sam@csri.toronto.edu
CSNET: sam@toronto