Menu

#645 Breeders are explosive

Devel
closed-fixed
5
2004-09-11
2004-05-19
Anonymous
No

The limits you are placing on breeders is not working.
They filled
the lawful quest, before I managed to work my way over
to the left
side of the screen. My character had ESP, and was
skilled at detect
monsters, so most monsters were detected all the time.

I assumed that this was a feature of the lawful quest,
until I found
that they had overflowed in large numbers to the branch
level of the
main dungeon, and then proceeded to grow from there.

I suspect that part of the problem is that for all
other monster actions it
doesn't really matter if the think they are close, when
they are not.

Attempting to hunt down the breeders is complicated by
the fact that
if there is not room for the offspring adjacent to the
parent, then it
is placed as close as possible, often behind the
player, even if the
player is in a doorway. Eventually they will fill the
entire level as
they are placed further away from the parents.

In looking at the code, I can find no place where
(struct monst).mux
and (struct monst).muy is initialized, if the player's
position is not
known to the monster. This means that they are using
the values of
the last allocation of the struct. (i.e. garbage from
before the call to
newmonst()). The other place where this runs into
trouble is when the
character moves out of range. This causes the breeder
to believe that
the character is nearby, and continue to breed. As the
breeder can't
move, due to its neighbors, it just continues to breed.

I would suggest that you change your breeder goals to
allow breeding
when not near the player, but restrict it to be less
explosive in
other ways.
- All children must be placed next to their parent(s).
- Only those animals which are not too crowded may breed.
- For example, only a pair with no other neighbors
breeds.
- Children occupy all open squares which are
adjacent to both
parents.
- This would allow bugs to loosely fill a room, but
they would not
be able to breed in corridors, except at
intersections and
turns.
- Breeding only happens once animals reach a certain
age, and with a
limited frequency.

Discussion

  • J. Ali Harlow

    J. Ali Harlow - 2004-05-19

    Logged In: YES
    user_id=64456

    If you could specify which version of Slash'EM was giving
    you these problems and the type of monster(s) involved that
    would allow some investigation to be done.

    By the way, all monsters created with newmonst() are
    initialised (all fields, including mux and muy) within a
    couple of lines of the call to newmonst(). In the case of
    clone_mon() this means the parent's values of mux and muy
    are inherited.

     
  • Nobody/Anonymous

    Logged In: NO

    Sorry about the missing version. It is 0.0.7E6F2. I'm on
    Windows in case it matters.
    Both giant fleas and giant louses were present initially.
    The fleas grew to encompass the entire quest level, then
    later the branch level.
    I think I have the sources which go with this version, but I
    can't be sure, as I don't have a compiler. However the
    patchlevel file indicates that I have the correct version.

    The place I suspect, the call to newmonst() is at line 1237
    of makemon.c. Neither mux nor muy appears textually in the
    file.

    The only occurances I can find appear to either be for pets
    (in dog.c), or used to inform the monster it has found the
    player. I can't see that they ever lose the player, they
    just have their last best guess.

     
  • J. Ali Harlow

    J. Ali Harlow - 2004-05-21

    Logged In: YES
    user_id=64456

    Thanks for the extra details. I'll do some simulations in
    due course.

    If you look at how newmonst() is called from clone_mon() you
    will see the following:

    m2 = newmonst(0);
    *m2 = *mon; /* copy condition of
    old monster */

    The second line sets all the fields of the new monster
    (including mux and muy) to the values that the first monster
    has. The following lines then sets specific fields for which
    the old monster's values would not be appropriate.

     
  • J. Ali Harlow

    J. Ali Harlow - 2004-05-21
    • labels: --> All platforms
    • milestone: --> Devel
     
  • Dave

    Dave - 2004-05-24

    Logged In: YES
    user_id=1048205

    I guess I'm too old. When I learned C, you couldn't count
    on struct assignment if you wanted portability, so I didn't
    look for it.

    So much for that guess, maybe my other guess is relevent,
    who knows. Both times I did the Lawful quest, I ran into
    the same problem. I suspect it relates to the proximity
    created by the maze, without an ability to actually reach to
    kill the bugs.

     
  • Nobody/Anonymous

    Logged In: NO

    A friend of mine also ran across this bug. In his case, it
    happened after polymorphing a vampire into a giant flea in
    the crypt version of Mine's End. The vampire turned into an
    invisible giant flea, and soon the entire level was full of
    invisible giant fleas (incidentally, should they really all have
    been invisible since it was probably a cloak of invisibility
    which made the vampire invisible in the first place?), which
    quickly wiped out his character.

    We later stumbled across it as a bones level while playing
    together with his laptop connected to a TV so we could both
    see. Even when his square was Elberethed with a wand of
    fire and the fleas couldn't attack him they continued to
    multiply as fast as they were killed. Eventually we waded our
    way to the stairs, but (possibly because they were originally
    a vampire) the adjacent ones actually followed him up the
    stairs and filled the level above it, finally ripping his poor
    character to shreds.

    Basically, there are two points to this. First, could the fact
    that the giant flea was something else polymorphed have an
    effect? And second, should the giant flea and its offspring
    that result really keep the invisibility and ability to follow
    characters upstairs of the original creature? I can
    understand that the first one might, but unless my friend
    accidentally fathered an unstoppable race of intelligent giant
    fleas to spread across the world it seems odd that the
    offspring would inherit the intrinsics of their parents rather
    than being generated as the default.

    Eric "Critic of the Dawn"

     
  • J. Ali Harlow

    J. Ali Harlow - 2004-09-11
    • assigned_to: nobody --> j_ali
     
  • J. Ali Harlow

    J. Ali Harlow - 2004-09-11
    • status: open --> closed-fixed
     
  • J. Ali Harlow

    J. Ali Harlow - 2004-09-11

    Logged In: YES
    user_id=64456

    Finally found the problem. Although the comments said that
    breeders could only multiply if they were next to you they
    could actually multiply if they were within 6 squares of
    you. If you are in anything like an open space that can be a
    lot of breeders each cloning themselves every turn (or
    faster if you're slower than them).

     

Log in to post a comment.