adonthell-devel
[Top][All Lists]
Advanced

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

[Adonthell-devel] Characters


From: Kai Sterker
Subject: [Adonthell-devel] Characters
Date: Sun, 5 Jan 2003 13:48:13 +0100

To get the discussion going, here's some thoughts about characters.

Types of characters:
====================

Basically we'd have three different types: 

* player character (the one controlled by the player)
* NPCs (people and creatures that can talk to the player)
* Beasts (all the rest)

There's no practical difference between player and NPC. They're both
controlled via schedule scripts (one waiting for keyboard input, the
other containing predefined activities). If we allow to switch the
player controlled character (when having a party of multiple
characters), NPCs may become player characters and vice versa. All it
needs is exchanging schedules.

The difference between player/NPC and beasts is that latter do not talk,
hence they need no dialogue and portrait. They'd still have a schedule
though, and I could well imagine the player taking on the role of a
beast by means of magic.

All characters will be able to fight, so all of them need at least those
attributes required by the combat system. 

All of them might carry items, so they all would have an inventory too.

In brief, we'd have one character class that will handle all types of
characters, whether they're intelligent or not, good or evil, humanoid
or animal. Not all of them need all the functionality provided by the
character class, but probably most of it.


Character attributes:
=====================

There are basically two types of attributes: engine and game specific
attributes. Engine specific attributes are those that are required by
the game engine to work properly. Like an id for each character, the
position on the map, a schedule and possibly others. Nothing speaks
against hard-coding those into the engine. Especially efficiency speaks
for it.

Game specific attributes aren't needed by the engine. They're probably
unique to each game. That includes all the skills and properties needed
by the role playing system. They'll have to be customizable and can't be
added directly to the engine. One idea would be to extend the character
class on Python side with whatever attributes and method needed for a
certain game. As they will be used in other python scripts only, that
wouldn't be a problem. And it would offer much more flexibility than the
current list of <string,int> pairs each character has for properties and
the like.


Character implementation:
=========================

I'd suggest the following design:

    +---------------------+
    |   character_base    |  The most basic attributes/methods
    +---------------------+
               ^
               |
    +---------------------+
    |    character_map    |  Everything for walking around
    +---------------------+
               ^
               |
    +---------------------+
    |    character_gfx    |  Everything for actually rendering
    +---------------------+  the character
               ^
               |
 ------------------------------------------------------------
               |
    +---------------------+
    |      character      | Game specific attributes/methods
    +---------------------+

Everything above the line would be part of the engine, coded in C++.
Things below the line are part of the game, coded in Python.


How does that sound?

Kai




reply via email to

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