[xoreos-devel] Proposal of a new class design for KotOR games

Vsevolod Kremianskii vkremianskii at gmail.com
Sat Feb 23 04:06:12 CET 2019


I'm currently evaluating how party members and areas work in KotOR games,
and this is what it looks like:

Area – basically, a container of creatures. Creates, destroys and manages
interactions with them.
Module – owns the area, but also owns the party members and controls the
player character.
Creature – represents both the physical object within an area and it's
characteristics (stats, equipment, etc).
CharacterGenerationInfo – a structure describing RP and visual attributes
of the player character. Interestingly, it is buried in the GUI folder and
knows how to create both the player creature and the player model.

Here is the problem I'm having with this design: party members need to be
managed separately. Currently, they are not interactable and cannot execute
actions. Also, we have an unnecessary circural dependency between the
Creature class and CharacterGenerationInfo.

What I propose instead is the following:

Creature class should only represent the physical object within an area.
All stats and equipment information should be moved to a separate structure
(CreatureInfo?).

All creatures should be owned by an area. Module should only own the info
of the party members and recreate their characters on every area change.

Management of the party leader should probably be moved to a separate class
(PlayerController?).

CharacterGenerationInfo should be moved outside the GUI folder and should
not have responsibility of creating a character or a model.

Any thoughts on this, DrMcCoy?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://xoreos.org/pipermail/xoreos-devel/attachments/20190223/c83a0afb/attachment.html>


More information about the xoreos-devel mailing list