What would be a good way to code up a character class?
Right now I have this:
Entity
Character Extends Entity
Dwarf, Elf and Human all Extend Entity.
I suspect this is a bad approach. It'll lead you down the old-school approach of a massive inheritance hierarchy for your characters with all the usual problems that brings (some of which you're already finding with the classes/races setup). In particular it's nice to be able to swap the race/class at runtime - the classic example being "polymorph self", where your character becomes a different race/animal for a limited period. That's easy if the race is a sub-object or data-driven, but very hard if your Character is actually a DwaftCharacter object and you want to change it into a WolfCharacter.
Ascii dreams has
this rather interesting approach:
I suspect that the vast majority of games would be satisfied with five core data structures: player, enemies, playing field, pick-ups and effects. You may even be able to collapse e.g. player and enemy together.
This is exactly what I'm doing for
Albion and it's working quite well so far. I have a single Character class which represents both player characters and monsters (and later, NPCs). All differentiation (skills, racial traits, stats) are either data members or attached sub objects. Your Character could reference a Class and an Race, and both would contribute objects deriving from a Skill interface.
This has parallels with the component-based entity systems that are gaining popularity. You might want to search the forum for the old threads we've had on that in the past.