Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: New Pickup Code Proposal



I have never liked the existing pickup options.  It always struck me as
a kludge to sort of pick up want the sort of stuff you wanted.

It strikes me that in this whole discussion of pickup options that it
was never questioned whether the current pickup options make any real
sense from the player's perspective.  The question before us is whether
the game correctly allows selecting the most useful pickup options in
a way that is clear to the player.  I suggest the current pickup command
fails this test since "pickup 5" certainly doesn't carry any obvious
indication of what is going to be picked up.

I suggest the correct way of doing pickup is to have a flag for each
object type which the player can set to specifically select which objects
are to be picked up.  The command which sets this pickup_flags should not
take numeric arguments, but should instead take symbolic (ie name of the
object type) arguments.  The command should allow selecting or unselecting
individual object types.  For ease of use there should be generic names
such as "magical" which is a shortcut means of setting numerous values.

There should be an additional option to the pickup command of AND or OR
DENSITY [x] where x is gp per kg (or whatever measurement).  If option is
AND DENSITY [x] then item is picked up if it meets whatever previously set
object type pickup selections and is worth at least the desired density
value.  If option is OR DENSITY then item is picked up if it meets either
object type or the density criteria.

Lastly, a coding style warning - to say you don't want to add object types
and instead want to resuse bits of another object type which renders that
data type into a combination of bit flags and numeric value indicates real
problems with your programming style.  It appears your natural preference
is to write unmaintainable code.  I do not intend to discourage you from
writing code.  I do hope to push you to think out how are implement
improvements so that they do not become problems going forward.


> Date: Sun, 4 Jun 2000 12:38:47 -0700
> From: "Darren O. Benham" <gecko@benham.net>
> To: Mark Wedel <mwedel@scruznet.com>
> Cc: Crossfire Mailing List <crossfire@ifi.uio.no>
> Mime-Version: 1.0
> User-Agent: Mutt/1.0.1i
> Subject: Re: CF: New Pickup Code Proposal
> 
> On Sun, Jun 04, 2000 at 12:07:51PM -0700, Mark Wedel wrote:
> >  Just as a note, keying an item type will likely have problems down the 
road as
> > item types are added, removed, and changed.  I know some of the code 
currently
> > use that mechanism, but if something can be developed that does it in a 
more
> > generic fashion, that would be good.
> I was hoping that the type codes in define.h were pretty static.  Adding,
> types I knew that the pickup code might have to be modified.  I was going to
> use an array that keyed a pickup mode.
> 
> > > I always felt that mode 4 (all magic) was sort of a cheat since at the 
time
> > > of pickup, you didn't know if it was magic.  I figured it was better to 
hand
> > > pick the items and include known magic items but excluding known cursed
> > > items.  OTOH, as a player, I like being able to set the machine to
> > 
> >  I think that is wrong - looking at the code, it uses the KNOWN_MAGICAL 
and
> > KNOWN_CURSED flags, so uses the same information the player has.  I think 
that
> > is the right behaviour.
> My base point is the latest release (0.95.5).  I can go into some dungeon or
> another and kill the monsters.  Then set to mode 6 and walk over everything
> and I'll pickup a bunch of weapons and armor (at least) that have not been
> identified but will later show magic when I get them back to the store to
> sell them.
> 
> > > The low byte of 'mode' holds the density value.  This does lower the 
highest
> > > available density filter from 65535 (ish) down to 255.  (this is one 
point,
> > > in particular, I wasn't sure how high people set this to on an practical
> > > basis).
> > 
> >  I usually set it at 10.  In fact, one problem currently with the setup is 
you
> > have a minimum value density of 8 or so.  It would be better to have one 
of the
> > bits in the pickup mode toggle if we are on value density so the complete 
range
> > is available.
> 
> Under the code I wrote last night, density can be set anywhere from 0 to
> 255.
> 
> > > Also, this setup removes the "and stop" and "stop before" type 
features..  To
> > > implement them, we'd have to do away with one of the flags or take a bit
> > > away from the density (leaving a max of 127 or even 63).
> > 
> >  Instead of subverting the meaning of the high bits, I think it makes more 
sense
> > to just add a 'pickup_flags' field to the player structure which controls 
this
> > information.  I think that will also result in clearer code than grabbing 
the
> > high bits off the current mode field.
> 
> Ok, I'll look at the structures.  On the first pass, I did not want to
> change any structure.
> 
> The code that I've written is up and running on crossfire.debian.net.
> Please feel free (and encouraged) to head there and try it out.  The help
> isn't written yet but there is a description in the MOTD.  And please,
> provide feedback.
> 
> -- 
> Please cc all mailing list replies to me, also.
> * http://benham.net/index.html        <gecko@benham.net>           <><  *
> * Debian:                             Software in the Public Interest:  *
> *   Project Secretary                   Treasurer                       *
> *   Webmaster Team                                                      *
> *   BTS Team                          siteROCK:                         *
> *   Lintian Team                        Linux Infrastructure Engineer   *