adonthell-devel
[Top][All Lists]
Advanced

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

Re: [Adonthell-devel] Thoughts on character implementation


From: Kai Sterker
Subject: Re: [Adonthell-devel] Thoughts on character implementation
Date: Sat, 8 Mar 2003 14:19:33 +0100

On Sat, 08 Mar 2003 13:14:34 +0100 Alexandre Courbot wrote:

> I'm fine with that. Character implementation has to be done as items
> are done: a handler class on the C++ side (with all the basic stuff
> we'll always need), and all the game-specific stuff on the Python
> side. Don't know if you had that in mind, but we could make a
> hierarchy of classes that describes the different character classes,
> their base attributes, ranges and capabilities. 

[...]

> The "humanoid" class would put the commons of all humanoid types.
> "elves" would describe elves more accurately, and every type you make
> an instance of an elf, you can tune it's attribute. That way our
> protagonists description will be much like in real life, which would
> probably make work easier for us.

Well, since we're dealing with a scripting language, and since different
character types would only differ marginally (some had more attributes
than others), I wanted to go without inheritance. Instead, the basic
character class would be modified at runtime to hold exactly those
attributes the desired character needs. This means a little less
work, and has basically the same effect that inheritance would have.

The attributes a certain character has would be defined in a data file
(together with the maximum rank of each attribute, and how many points
it takes to gain a rank in that attribute). When instanciating a
character, one would look what "type" it is, read what attributes that
tyoe has, and finally load the actual character data.

As both maximum ranks and points to gain a rank would be needed
throughout the game, each type description (or template) would be loaded
once at the start of the game and kept in a global storage. That'll make
access quite fast. At least faster than reading the info from a file
each time it is needed.


Actually, there'd be a second type of character description or template.
However, this one would only be required for characters that can carry
items, cast spells or use fighting feats. It would define what equipment
a randomly generated character of certain class (i.e Bandit or Sorcerer,
etc.) and level would carry. Depending on the character, that'll include
armour and weapon the character uses, fighting feats and spells, etc ...

I hadn't too many thoughts about that yet, but I think it would be
required to properly generate characters randomly. Again, all the
premade characters and boss monsters will have their items assigned
beforehand, of course.

Kai




reply via email to

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