1

I'm a game programmer and currently working on a generic system that works for most type of games. I have a generic piece of code, that I use on anything that could increase/decrease called EffectCauser - It has a bunch of parameters for it to work:

  1. The target component (health, mana, speed, stamina, etc)
  2. The effect methodology (OneHit, Overtime, Permanent, etc)
  3. The effect type (Positive/Negative)
  4. The effect amount.

First let me explain how this works in a couple of simple examples so that you understand better:

Let's say I wanted to create a first aid kit. I create an EffectCauser which will cause its effect on the Health component of the target object, I specify the methodology of the effect of type OneHit and the type of the effect to be Positive and an amount I choose, lets say 100 for a full heal.

Another example, if I wanted to create a Mana spell that decreases mana overtime: I would create an effect causer that targets the Mana component of a target, select a methodology of Overtime (temporarily in other words) (filling the appropriate time values), an effect type of Negative this time, and an amount, like 50. (Imagine a spell in an RPG game where an enemy cast it at you, so you get -50 mana over a 10 sec time period)

And so on and so forth. I could do this for a Speed component, Agility, Stamina, etc.

The main thing for this to work is that all these things (Health, Mana, Speed, Stamina, etc) have to implement a common interface. I'm not being able to find the name of that interface.

One common thing between all these things, is that they increase and decrease. I thought of IChangable but that's very generic, maybe IIncreasableDecreasable but that's very long, and screaming "there's a better word than me"

Note that the convention of naming interfaces, is "IXXXable" (IMovable, ICombinable, ITransformable, etc)

So, what can I use here? what is the word that satisfies my needs?

Thanks a lot.

EDIT: To make it easy, it need not be an interface. I could create an abstract class. Interfaces define behavior, while a class is for something that exists. I just have to change my way of thinking.

Ex: an abstract Character, with Player and Enemy as children. Player and Enemy are a Character. (Character is an abstract term for Enemy and Player)

So... what are Health, Mana, Speed, etc? For one thing, they're Components but what else? (I can't use Component here due to ambiguity as well). What about PlayerAttribute? well, for one thing I can attach Health to an enemy, not just the player. So... CharacterAttribute is good? nop, still ambiguous. (Attribute means a total separate thing in .NET)... I'm out of words :(

If you ever played an RPG game, what would a common name be to all your player stuff? (health, mana, agility, stamina, speed, dexterity, etc)

2
  • 1
    'Effecter' might be a better choice than 'EffectCauser', too - they mean the same thing. Then you can have the corresponding 'Effectee', for the thing that receives the effect.
    – Beejamin
    Dec 20, 2013 at 3:31
  • changeable seems fine to me. May 6, 2015 at 11:45

2 Answers 2

3

A few ideas: IVariable (don't think it will suit your needs here due to "variable" ambiguity), IAdjustable, IModifiable, IMutable.

8
  • Thanks for your answer. You are right, I can't use IVariable. But all the words you suggested, are still all too general (for example, when somebody reads that X is "Adjustable" or "Modifiable", he can't really tell that X is something that has a value, which he could increase/decrease (perform adding/subtraction operations on)). Could there be something else in common, between those components that I could use instead of increasing/decreasing? (i.e. the Health, Mana, etc)
    – vexe
    Dec 19, 2013 at 10:03
  • How about iGauge
    – mplungjan
    Dec 19, 2013 at 10:10
  • Hm, if I see that a numeric value is changeable, modifiable etc., I assume that this value can be subject to a change. It can be subtraction, addition, division, multiplication... Unless you want to underline that only subtraction and addition are only possible here, then it is quite hard to come up with such word. I'll think about it more :)
    – Vilmar
    Dec 19, 2013 at 10:13
  • @mplungjan Doesn't fit the convention "IXXXable", sadly
    – Vilmar
    Dec 19, 2013 at 10:13
  • 1
    @vexe, as for your edit: in the RPGs I played these are mostly referred to as "attributes", which you said you cannot use. Sometimes they are called "abilities", "characteristics" or "statistics". How about CharacterStats?
    – Vilmar
    Dec 19, 2013 at 10:58
1

Attribute is the accepted term in RPGs - it predates computer-based RPGs, for sure.

As you rightly say, Attribute is too generic in a software context, and PlayerAttribute is too specific. I think CharacterAttribute is a good balance - the player is a character, an NPC is a character (a Non-Player Character), and all those values (health, mana, etc) are related to that entity being a character, and not an inanimate object like a crate, or an abstract entity like a zone.

Traditional RPG's make a distinction between NPCs and Monsters, so whether monsters/enemies are characters in the strict sense I don't know. I'd argue that all living things are potentially characters in a game design, though - just that monsters have a very simple personality.

-- Additional info...

The type of value you're talking about is a Scalar Value - it has a magnitude (amount), but no direction. To put it another way, it has a single value along only one axis. Scalar values can be plus or minus zero.

With that in mind, your interface could be called 'IScalable' - indicating that it changes a scalar value.

2
  • Thanks for your reply. I'm actually willing to use the very same thing on enemies, the player, etc. Pretty much everything that could have an "Attribute" on it (health, mana, etc) - I'm also not sure if there's a real distinction between Character and monster, but let's assume there is. Since I'm gonna be using the same system on Monsters, is there something even more abstract than the term Character? (so that I could use this term, to cover characters and monsters, much like Character, covers Enemy and Player)
    – vexe
    Dec 19, 2013 at 16:29
  • I'd stick with Character, personally - anything more generic is going to be less obvious to anyone reading the code. It's not that monsters and creatures aren't characters - just that old D&D games made a distinction - I don't think you have to stick with that.
    – Beejamin
    Dec 20, 2013 at 3:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.