David Haley
Wizard


Group: Members
Posts: 6,874
Joined: Jun 30, 2007
|
#16 id:43238 Posted Mar 10, 2010, 12:33 pm
|
I see little to no reason for races to be classes. A race, in nearly all cases, is a collection of properties, not a set of behaviors. What's the concrete gain in having the race "Human" derive from "Creature"?
Besides, as others have pointed out, treating races as data objects rather than as behavior classes affords you all kinds of flexibility. Shape-changing is just one of these aspects among very many, and no, inheritance is not a problem only when you can change the race during game-play. Indeed, the possibility of an undead orc vs. an undead human is very real; all undead things presumably share some properties as do all orcs and humans.
Using your inheritance scheme, you need either a ridiculous cross product (Human, UndeadHuman, Orc, UndeadOrc, ......) or you need to add every possible property to every "base race", so that all Humans have a flag "is undead". But what if you have different kinds of undead? What if you have weakling undead creatures vs. truly powerful undead creatures? (Maybe the necromancer was an amateur and so his creations are lousy.) Do you now have flags for each kind of undead? It rapidly becomes kind of silly.
Really, all of these things are just aspects of a creature, so to me it's difficult to argue that it should be anything other than composition of some sort, really. Of course, if none of that flexibility is applicable/relevant, then sure, you can do something simpler.
|
|
|
shasarak
Sorcerer


Group: Members
Posts: 421
Joined: Nov 28, 2007
|
#17 id:43241 Posted Mar 10, 2010, 12:42 pm
|
deimos said:shasarak said:
(Either way, I'd say socket handling should be distinct from the Mind object).
For what reason(s)? You have to tie it in somewhere, and it's the mind/soul that you're actually controlling, which in turn is controlling the body. Or, at least, that's my reasoning. Where else would you put it?
Edit: I just realized that you may have meant that the actual implementation should be in, say, a Socket class, compositioned into the Mind/Soul class, rather than having the mind itself actually implement the socket-level behavior. Incidentally, this is how I currently have it designed, so if that's what you meant, then I agree.
Yes. I prefer any given class to have a relatively simple, small, closely-related set of functions. You should be able to usefully sum up what it does in one sentence! If (for example) a player Mind is responsible for tracking XP and skills (so that when you move the mind into a different body, the XP and skills go with it) then it's clearly doing something entirely different from managing socket handling, so there's no earthly reason to put them in the same class, and in fact it complicates things if you do.
|
|
......................... Hand over the chocolate and nobody gets hurt.
|
|
shasarak
Sorcerer


Group: Members
Posts: 421
Joined: Nov 28, 2007
|
#18 id:43242 Posted Mar 10, 2010, 12:51 pm
|
KaVir said:You did actually agree with the aggregation approach the last time we discussed it. Did you encounter a scenario that changed your mind?
No, no, I'm very much in favour of aggregation; I'm even in favour of using it to handle race (see post 10 in this thread). I just wasn't entirely convinced of its relevance to shape-shifting. But yes, the specific implementation of shape-shifting that you describe (where the physical properties of the new body are strongly influenced by the properties of the old one) probably does require Race or Species to be a body attribute.
When I think of a human being metamorphosed into a dragon, I guess I don't necessarily think in terms of a weedy human becoming a weedy dragon! Again, that might or might not be desirable, depending on thematic considerations. When Bruce Banner becomes The Hulk, you don't necessarily want him to be a weak Hulk simply because Banner is weak - it is precisely the contrast between the two states which makes the scenario interesting. Similarly, a weak person affected by lycanthropy shouldn't necessarily become a werewolf that is too weak to kill anybody; what makes lycanthropy interesting is a weak human becoming transformed into a powerful, lethal predator.
|
|
......................... Hand over the chocolate and nobody gets hurt.
|
|
shasarak
Sorcerer


Group: Members
Posts: 421
Joined: Nov 28, 2007
|
#19 id:43243 Posted Mar 10, 2010, 12:55 pm
|
David Haley said:But what if you have different kinds of undead?
Good point: zombie human, vampire human, lich human, etc. I definitely want to play a MUD which allows me to become a vampire dragon!
|
|
......................... Hand over the chocolate and nobody gets hurt.
|
|
|
|
Deimos
Conjurer


Group: Members
Posts: 220
Joined: Mar 8, 2010
|
#21 id:43249 Posted Mar 10, 2010, 1:56 pm
|
David Haley said:
A race, in nearly all cases, is a collection of properties, not a set of behaviors.
I know you qualified this by saying "in nearly all cases", but I just wanted to point out how easily you could be wrong. Someone may want "Djinn" (a race) to be the only thing in their game that can grant player wishes. Wish granting behavior can then be logically tied to Djinn, and Djinn is no longer just a set of properties. I'm not saying it has to be, or even that it should. On the contrary, it would be just as easy to have Djinn and WishGranter prototypes that you could add to a Creature. Race is really abstract in a MUD context, and it's not right or wrong to implement it in any given way. The reason I started the thread in the first place was to gain insights into these other ways, and I'm glad I did, as prototyping is the system I'll most likely end up going with.
|
|
......................... Any sufficiently advanced magic will run circles around technology.
|
|
KaVir
Wizard


Group: Members
Posts: 1,625
Joined: Jun 19, 2006
|
#22 id:43251 Posted Mar 10, 2010, 2:18 pm
|
shasarak said:When Bruce Banner becomes The Hulk, you don't necessarily want him to be a weak Hulk simply because Banner is weak - it is precisely the contrast between the two states which makes the scenario interesting. Similarly, a weak person affected by lycanthropy shouldn't necessarily become a werewolf that is too weak to kill anybody; what makes lycanthropy interesting is a weak human becoming transformed into a powerful, lethal predator.
It's hard to make any comparisons with the Hulk, because he's unique, but IMO it would make sense for him to be even stronger if Bruce Banner worked out.
I'd also apply the same reasoning to werewolves - a good example is the Werewolf WoD tabletop game, where human have stats in the range 1-5, and most people have 2 in all stats. Werewolves get +4 strength, meaning that the weakest possible werewolf (in wolfman form) is the same strength as the strongest human in the world. But if the strongest human were to become a werewolf, his strength would far outstrip the first werewolf.
deimos said:I know you qualified this by saying "in nearly all cases", but I just wanted to point out how easily you could be wrong. Someone may want "Djinn" (a race) to be the only thing in their game that can grant player wishes. Wish granting behavior can then be logically tied to Djinn, and Djinn is no longer just a set of properties.
From a design perspective I think it would still make a lot of sense not to tie the wish-granting behavior to the Djinn - otherwise, should you later wish to give other races that same ability (perhaps Djinn subraces, or special one-off mobs, or even half-Djinn) you'd need to rewrite code to do it.
|
......................... KaVir at God Wars II: godwars2.org 3000 Roomless world. Manual combat. Endless possibilities.
|
|
David Haley
Wizard


Group: Members
Posts: 6,874
Joined: Jun 30, 2007
|
#23 id:43252 Posted Mar 10, 2010, 2:18 pm
|
Perhaps I should have said that in sane designs, the race is a collection of properties. Of course, any property whatsoever can always be treated as a behavior, but to put it simply it would often be somewhat stupid to do so. While it seems somewhat silly to get into an argument about what is "right" or "wrong", it seems pretty clear that some approaches have advantages over others, and in order to justify abandoning those advantages one should provide fairly clear advantages in turn.
Even in this case, we start with Djinn, then we get DesertDjinn and MountainDjinn, oh wait and then there's the HillDjinn and his buddy the CaveDjinn, oh oh and there's also their cousins the Efreet and the BottleGenie, and we pretty rapidly see that one approach locks us in, making for rather silly workarounds, whereas another makes it far easier to do this sort of stuff.
|
|
|
David Haley
Wizard


Group: Members
Posts: 6,874
Joined: Jun 30, 2007
|
#24 id:43254 Posted Mar 10, 2010, 2:20 pm
|
My previous post was in reply to Deimos, if that wasn't clear.
KaVir said:It's hard to make any comparisons with the Hulk, because he's unique, but IMO it would make sense for him to be even stronger if Bruce Banner worked out.
I'd also apply the same reasoning to werewolves - a good example is the Werewolf WoD tabletop game, where human have stats in the range 1-5, and most people have 2 in all stats. Werewolves get +4 strength, meaning that the weakest possible werewolf (in wolfman form) is the same strength as the strongest human in the world. But if the strongest human were to become a werewolf, his strength would far outstrip the first werewolf.
Without agreeing or disagreeing with your statement, I think that these issues are purely thematic and not exactly an objective truth about all possible forms of shape-shifting.
|
|
|
Deimos
Conjurer


Group: Members
Posts: 220
Joined: Mar 8, 2010
|
#25 id:43259 Posted Mar 10, 2010, 2:50 pm
|
KaVir said:
From a design perspective I think it would still make a lot of sense not to tie the wish-granting behavior to the Djinn - otherwise, should you later wish to give other races that same ability (perhaps Djinn subraces, or special one-off mobs, or even half-Djinn) you'd need to rewrite code to do it.
Djinn subraces would inherit from Djinn, and thus have that behavior as well. In your other examples, if they applied to a particular game, or if the designer thought they may apply in the future then I will agree with you. I, personally, want to keep my design as open and flexible as possible, which is why this thread has prompted me to restructure some things.
David Haley said:
Even in this case, we start with Djinn, then we get DesertDjinn and MountainDjinn, oh wait and then there's the HillDjinn and his buddy the CaveDjinn, oh oh and there's also their cousins the Efreet and the BottleGenie, and we pretty rapidly see that one approach locks us in, making for rather silly workarounds, whereas another makes it far easier to do this sort of stuff.
As I mentioned to KaVir, all of these Djinns would be subclasses of Djinn, inheriting the wish granting behavior.
This is getting off-topic, though, so I'll leave it at that and let's get back to the "how" and leave the "why" to the philosophers
|
|
......................... Any sufficiently advanced magic will run circles around technology.
|
|
David Haley
Wizard


Group: Members
Posts: 6,874
Joined: Jun 30, 2007
|
#26 id:43265 Posted Mar 10, 2010, 4:05 pm
|
Well, this isn't just a philosophical question. What if you have undead Djinn, which inherit from several properties, or Efreeti, which aren't Djinni and thus wouldn't inherit from it? In the undead case, you end up in Ye Olde Crosse Producte problem again, which is nasty, and in the latter case, well, it becomes clear that granting wishes is separate anyhow.
The 'why' and 'how' aren't really so separate when the reason for the 'why' is that it will make the 'how' easier. (Incidentally I don't really think we were discussing 'why' as a philosophical question, other than to say 'why not' to adopt a certain approach.)
But if you want to talk strictly pragmatics, then it would be useful for you to say why it's better to have the wish-granting behavior be a class and not a property composable with other properties. You said "oh sure, we can do it this way though". But you didn't say why it should be done that way. We've presented you with several reasons why it shouldn't be done that way. Heck, even you said that it would be just as easy to use the component approach, so the argument isn't related to complexity.
|
|
|
KaVir
Wizard


Group: Members
Posts: 1,625
Joined: Jun 19, 2006
|
#27 id:43269 Posted Mar 10, 2010, 4:28 pm
|
David Haley said:Without agreeing or disagreeing with your statement, I think that these issues are purely thematic and not exactly an objective truth about all possible forms of shape-shifting.
I'm just arguing my personal preference. I know some systems work differently (for example the polymorph spell in D&D, where the shapechanger gains the physical stats of the new form), but I favour the idea of stat modifiers for different forms. This can still allow you to turn Conan into a weak frog (although he'll be much stronger than most other frogs), but it lets you retain the relative value of the different stats. If you play a werewolf, then your physical stats will be devalued if they're replaced while you're in wolf or wolfman form - if you spend most of your time in those forms, you might as well put your stat points into something else.
|
......................... KaVir at God Wars II: godwars2.org 3000 Roomless world. Manual combat. Endless possibilities.
|
|
Deimos
Conjurer


Group: Members
Posts: 220
Joined: Mar 8, 2010
|
#28 id:43271 Posted Mar 10, 2010, 4:37 pm
|
@David Haley:
I'm not one of those people who says "I'll leave it at that" and then doesn't leave it at that, sorry to disappoint :grin:
|
|
......................... Any sufficiently advanced magic will run circles around technology.
|
|
shasarak
Sorcerer


Group: Members
Posts: 421
Joined: Nov 28, 2007
|
#29 id:43273 Posted Mar 10, 2010, 4:45 pm
|
deimos said:Someone may want "Djinn" (a race) to be the only thing in their game that can grant player wishes. Wish granting behavior can then be logically tied to Djinn, and Djinn is no longer just a set of properties. I'm not saying it has to be, or even that it should. On the contrary, it would be just as easy to have Djinn and WishGranter prototypes that you could add to a Creature. Race is really abstract in a MUD context, and it's not right or wrong to implement it in any given way. The reason I started the thread in the first place was to gain insights into these other ways, and I'm glad I did, as prototyping is the system I'll most likely end up going with.
Under what circumstances is it actually preferable to wrap up wish-granting behaviour into the Djinn race class? I can't see that you could ever possibly gain anything by doing that, and you certainly lose flexibility - if you every do change your mind about Djinn being the only wish-granters then you've made extra work for yourself by encapsulating things badly the first time round.
|
|
......................... Hand over the chocolate and nobody gets hurt.
|
|
David Haley
Wizard


Group: Members
Posts: 6,874
Joined: Jun 30, 2007
|
#30 id:43281 Posted Mar 10, 2010, 5:46 pm
|
deimos said:@David Haley:
I'm not one of those people who says "I'll leave it at that" and then doesn't leave it at that, sorry to disappoint :grin:
You asked to get back to the 'how'. I asked you what that meant and tried to do that. If you're interested in discussing the 'how', then discuss the 'how'. Don't say you want to get back to it and then dismiss attempts to do so; that's a little rude, IMHO. If you feel that my comments did not address the 'how', it would be polite to say why not. In fact, I asked you a very direct pragmatic question (the same question Shasarak just posed) that you somewhat flippantly ignored. What exactly is it that you want to talk about?
|
Last edited Mar 10, 2010, 5:47 pm by David Haley
|
|