Object Oriented Efforts in Game Design: Not Just for Programming Anymore
so, i’m in the process of building a ‘super cool web/turn based wonder game’ thing and i’ve been percolating on the underlying mechanics for about 9 months now. (with the help of the other guys at sas too….) i’ve been designing smaller games and larger corporate enterprise databases for a while now and i think the two are finally mixing it up and having it out in my head. just about a month ago, everything kind of congealed and i now have an alpha sort of release out. and that finally brings me to my point.
i'm taking a rather object oreiented approach to the actual game design as opposed to simply oop'ing the technical design. i'm thinking this is a bit weird and quite a different approach — by all means correct me if i'm wrong.
for example, i have a player object containing all of the usual suspects. i have attributes. and skills. and non-player entities.
the weirdness comes in that attributes are objects. skills are objects. and entities can be an oak tree, a player’s house, his sword or the monster he’s fighting. all this is possible because all these things stack neatly. well. with the help of ‘effects’, yet another object. (stay with me. it's the stackable effects and the costs assoctiated with them as opposed to typically 'tunable' effects that really stand out.)
these effects help me to stack everything up. so, skills, in the game, consist of everything from the mundane ‘hide’ to the seemingly odd fitting, but not really, lightning spell. spells are skills. divine stuff—skills. natural abilities? yep. still skills. skills in the sense that it is an ‘action’ that the character can take. (hmmm. maybe action is really a better term for it.)
anyway, these skills, well, you just hang effects on them. effects being pre-defined packages. for example, we have the effect ‘great physical damage’ which has a value of 10. we also have one for ‘moderate’ and ‘minimal’ having 6 and 2 values respectively. you’ll notice that the effect is also typed. so, physical, fire, mental, what-have-you. it also has an ‘affect’ type too. which can be either attributes or skills. the kicker? they have a cost.
so, here’s the theory: since effects are (really the only things that are) static and they have a cost, they are essential the building blocks of the whole structure.
you have a skill, lightning for example, and it needs some effects. you just hang a ‘great electrical damage’ on it with it’s value of 10 that affects an attribute (hit points, for example). say that effect has a cost (i’ll get to this soon. promise.) of 5. maybe an opposed skill of ‘electrical resistance’ or something. so, now, you can define this skill in it’s description something like this:
lightning, -10 electrical to hit points, 5 cost.
well. what if you hung a couple more on there? say, 2 more electricals and one physical damage effect?
great lightning, -30 electrical to hit points, 10 physical to hit points, 20 cost.
electrical resistance, +10 electrical to hit points, 5 cost.
hide, -20 to visibility, 10 cost.
spot, +40 to visibility, 20 cost.
that cost becomes an arbitrary, weightable value attached to things. after all, everything will have effects. so, by that, ‘great lightning’ requires 4 times as many [xp, money, whatever] to achieve/purchase. now, keep in mind, this is a fairly linear example to hopefully explain my thoughts more easily. you’d want to build in some sort of logarithmic cost factor (final cost = cost * number of effects?) but you get the point. we have a small set (less than 100) of in game objects to tweak as we need for balancing purposes.
where skills are the actions, attributes are the values acted upon. not only hit points, but strength, reputation, gold, all kinds of things. skills are then grouped and tied to attributes to essentially give them a base value. magic=intelligence, lifting=strength, hiding=dexterity, etc.
as this is getting pretty long, i’m gonna move quickly now. i’m hoping by now, you’re already forecasting where i’m headed.
so, skills and attributes, then, get stacked into the players. so, the total value of a character can be stated as the sum of all his attributes, skill costs and skill values (after all you still need to measure how well a character knows a particular skill, not just its effect).
these same things get applied to the other game entities too as they are as equal citizens to the game as characters. so, a sword is an object. it has a single effect of ‘moderate physical damage’ which gives it a cost of 3. maybe you want a magical sword. add a fire damage effect. maybe it’s also one of those ‘enhancing’ magical swords. attach the skill ‘sharpness’ which has 2 ‘moderate skill enhancement’ effects on it that add 12 to the ‘slashing weapons’ skill value.
so, trees end up with 500 hit points and no skills. lava pits have no hit points, but they have 500 ‘great fire damage’ effects attached to them. ogres have attributes like a player does.
the way it ends up is everything can be essentially compared internally by the game as a function of cost. this seemingly magical ‘cost’ value acts as game entity currency.
define a few effects. a few skills. a few attributes. stackety-stackety-stack and you have all kinds of players and entities built from the same blocks. all hundreds of thousands of game entities tunable and balancable by tweaking a few low level effect costs. magic too overpowered? just increase the cost a bit for magical effects. the rest of the world cumulatively steps in line.
where fun social things (i expect) will open up, is when you turn the players loose with a crafting system. ‘here. build anything you want.’ the effect cost will just dictate how hard it is to make with your crafting skill and, thus, how much the item is valued at. cost of components, time, where ever you want to go with it. clever players will start creating items that you would have never thought of by stacking different skill and effects on top of these object templates.
the best thing about it? in the early alpha stage it's at, it all seems to be working. crazy!