ID:151733
 
I wonder, if anyone would like to share her/his ideas on how to supplement for the lack of multiple inheritance in DM.
Yes, I could do this myself, but I am interested in other, maybe better ideas on a path I could choose that I have likely just not found yet.

Just as an example, the common (non animé) RPG problem of class and race (example of the example *grins*, Human-Ranger, Human-Mage/Elf-Ranger, Elf-Mage) where characters might inherit abilities and values from both class and race.
Working off your example: one way would be to make both a [class], and they get the preset for every verb you want that class to learn. Then you can manually give them the verbs for the race.
In response to Demon_F0rce
While it is a nice start, it by no means compensates for most of the advantages gained by true inheritance.
Variables and type path checking, just to name the two most obvious ones.
I would use has-a relationships for races and classes. Characters could have race and class datums. Races would have a common parent datum. Classes would have a common parent datum.

If I wanted to know all of a character's abilities and values then I'd loop through the character's races and classes. Any dependencies on other races/classes could be settled by passing the source character in.
In response to ACWraith
That was similar to how I thought I'd handle it, though it kind of prevents me from looping through some type-path only.
But I guess it's the best I can get :(
Thanks for the reply ;)
In response to Schnitzelnagler
I'm a little confused by your post. Are you using multiple inheritance as an analogy for a gameplay mechanic, or are you talking about the actual inheritance structure of the code?
In response to IainPeregrine
I am sorry for having been a bit unclear.
I meant multiple inheritance in an object-oriented programming languages (such as it is featured in C++, Perl,...).
However, you are kind of right, I pondered for the best way to translate multiple inheritance in gameplay mechanic to the programming language, where this concept is lacking.
In response to Schnitzelnagler
Hm... I think I understand where you're coming from now. You want to have mixed classes in your gameplay, such as 'monk' inheriting techniques from both 'priest' and 'warrior'. You've got these classes set up in your code as actual paths, so the priest gameplay class is actually a /mob/class/priest object, and the warrior gameplay class is actually a /mob/class/warrior object. Obviously the monk object cannot be of both types. To resolve this problem, I'd suggest that you look into making your classes data driven. I thought ACWraith had an article on this, but I can't seem to find it; I know he does a lot of this in his games...

As for multiple inheritance in the actual DM language, it does not exist (as you've discovered). However, there are some times (your case would not be one of them) where you can apply a 'fake interface' to a set of objects of diverse lineage, and then refer to a specific instance of one of them as a member of that interface. You millage may vary.
In response to IainPeregrine
IainPeregrine wrote:
Hm... I think I understand where you're coming from now. You want to have mixed classes in your gameplay, such as 'monk' inheriting techniques from both 'priest' and 'warrior'. You've got these classes set up in your code as actual paths, so the priest gameplay class is actually a /mob/class/priest object, and the warrior gameplay class is actually a /mob/class/warrior object. Obviously the monk object cannot be of both types.

Yes. Kind of. I was specifically thinking about race and class (e.g. a human ranger and an elf ranger, deriving information from the class - elf and the race -human/elf).
Though a similar problem could appear for multiple situations.


IainPeregrine wrote:
To resolve this problem, I'd suggest that you look into making your classes data driven. I thought ACWraith had an article on this, but I can't seem to find it; I know he does a lot of this in his games...

Hmm, do you mean structuring the information in datums.
I have considered this, but it comes with a few drawbacks (such as not being able to directly loop through subclasses), which is why I wondered if there would be a better method that I did not think of.
In response to Schnitzelnagler
Your idea sounds more like a Dynamic character class/race system, which is more difficult and more complex when compared to simply having direct code driven character classes/races/stats/etc.

Am I on the right track?
In response to Schnitzelnagler
Any drawbacks from putting information in datums is far outclassed by the drawbacks resulting from literal multiple inheritance. It is ALWAYS ugly, messy, and confusing, and in a language such as DM - with type paths - would be even worse, and would have an upper-limit of the "has-a" relationship you're expecting.

I mean, hell, it would NOT BE POSSIBLE to have sub-classes in true multiple inheritance. How do you inherit from ELF and FIGHTER and CLERIC when fighter and cleric both have HP, MP, and skills variables?

For what you want, the solution is to create a good system that works for what you need it to do, not ask somebody else to serve up a miracle.
In response to Garthor
Garthor wrote:
For what you want, the solution is to create a good system that works for what you need it to do, not ask somebody else to serve up a miracle.

Thank you for your reply, even though I did not ask anyone for a miracle. I politely asked for ideas, since I know that at least I am not perfect. And I was under the impression that this would be the main idea behind the design philosophy forum.
In response to UmbrousSoul
Actually, n, I was just theoretically wondering about plan 'hard-wired' class-race combinations.
In response to Schnitzelnagler
You can have the best of both worlds by making a sets of class and race datums (or objs if you prefer) and placing these into a list belonging to your player object. Each of these could modify the player's base hp and mp:

cleric: -4hp, +12mp
warrior: +8hp, 0mp
monk (both): +4hp, +12mp

If you use objs and the player's contents list (assuming your player object is a mob) then you can also give them skills in this way by placing the verbs (Blah... I must resist, not the time for an anti-verb discourse) on the class and race objs, which will then be made available to the mob.