adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] equipping items


From: Kai Sterker
Subject: Re: [Adonthell-devel] equipping items
Date: Sun, 18 May 2003 11:26:32 +0200

On Sat, 17 May 2003 20:52:06 -0700 Mike Avery wrote:

> >Whatever you think is best. I believe that we wanted the manager to
> >do this, right?
> 
> I think the manager yeah.  I think the manager would always know up to
> date info on the character.  If The manager gathers info from
> save-state on startup, any subsequent effects to the character would
> be applied by the manager, so it would always have accurate data.  The
> manager, I assume, would also be the only code to actually "modify"
> the character state.

Yeah. Would make sense to apply all character modifications via the
manager. 
 
> I would like the manager to keep a structure of aggregate character
> data.  A"snapshot" of a character containing all character stats,
> equipped item stats, applied effects, etc.

This means that there would be a manager for each character, right? (I
assumed it would be static.)

In that case I would suggest that we separate character stats and
character. At present, the character class also contains the stats. If
they were separated, the manager could use the stats class to keep track
of accumulated stats, while a character could use the class to keep
track of its basic (unmodified) stats. Something like that:

   +-------------+            +-------------+
   |  character  |------------|    stats    |
   +------,------+            +-------------+
          |
          |
   +------'------+            +-------------+
   |   manager   |------------|    stats    |
   +-------------+            +-------------+
  
Actually, we could store the basic stats with the manager right from the
beginning. I believe this would make more sense, as the unmodified
character stats would only be required to init the manager stats right
at the beginning. Afterwards, they would probably never be touched
again. So you'd have:

   +-------------+
   |  character  |
   +------,------+
          |
          |
   +------'------+            +-------------+
   |   manager   |------------|    stats    |
   +-------------+            +-------------+

But maybe you already have some ideas of your own. In that case you
might want to ignore the above :).


> The structure would contain:
> 
> - Complete Character Stats and proficiencies
> - Equipped item base stats, and their categories
> - A list of effects currently applied to the character

Yes. That would be everything that is relevant for combat or other code
that needs to access the actual character stats.


> I don't know what your thoughts are on a combat <--> manager class
> association to access this structure, or if you would rather use a
> method which returns a copy of the structure, or a pointer to the
> manager's structure.

If that structure would really contain all the character stats and
skills, equipped items and so on, I wouldn't tie it too closely to
combat. After all, there would certainly be effects that modify skills
that aren't related to combat. Like charm or diplomacy that might be
relevant during dialogue, or the various thieving skills that need to be
accessed from various places.

As copying the entire structure might be a bit expensive, especially if
you only want to retrieve a value or two (and assuming that it would
mostly live on python side?), I guess returning a pointer would be just
fine.


How does that sound to you? The real difficulties and flaws usually show
up once you start coding, as I noticed yesterday ;). So my ideas should
probably be taken with care.

Kai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]