Author Topic: RPG-style attribute scores  (Read 1602 times)

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
RPG-style attribute scores
« on: 4 May 2009, 03:35:20 »
   I came upon an epiphany today that ties in several of the proposed GAE implementations: RPG-style attribute scores.  This ties together evasion (with an agility score), conversion (to be resisted by a willpower score), disease effects (resisted by fortitude) and character variability (because they would be somewhat random).  How my idea works is that when one unit performs an action on another (like an attack), it compares the relevant variables to determine success.  For example, when an Archer attacks a Swordman, the Archer's relevant score (agility, or maybe aim or something like that) against the Swordman's relevant score (agility) are compared and the difference affects whether or not the attack hits.  Let's say the Archer's score is a 12 and the Swordman's is an 11.  That would give the Archer perhaps a 10% better chance of hitting with his attack.  Other applications for this include variable HP and EP amounts, attack power, and range, all of which could be modified by different scores, depending on the unit.  A Guard would have a higher or lower attack depending on his strength score, while a Battlemage would have a higher or lower attack depending on his intellect or willpower.  This is what it might look like in XML form:
Code: [Select]
<unit>
<parameters>
<size value="1"/>
<height value="2"/>
<max-hp value="700" regeneration="3"/>
<max-ep value="500" regeneration="15"/>
<max-ep-dep value="intellect"/>
BLAH BLAH BLAH
</parameters>
<attributes>
<strength value="9"/>
<strength-var value="2"/>
<agility value="10"/>
<agility-var value="2/>
<fortitude value="9"/>
<fortitude-var value="2"/>
<willpower value="12"/>
<willpower-var value="3"/>
<intellect value="12"/>
<intellect-var value="3"/>
</attributes>
<skills>
<skill>
<type value="attack"/>
BLAH BLAH BLAH
<attack-strenght value="140"/>
<attack-strenght-dep value="willpower"/>
<attack-var value="40"/>
<attack-range value="7"/>
<attack-range-dep value="none"/>
<attack-type value="energy"/>
<attack-check value="willpower"/>
<defend-check value="agility"/>
BLAH BLAH BLAH
</unit>
   In this example, the Battlemage's EP score varies according to his intellect, his HP vary according to his fortitude (I think this would be universal, so it doesn't have to be defined in the XML.), and the strength of his attack vary according to his willpower.  The range of his attack doesn't depend on anything, so it remains constant.  When he attacks a unit, his willpower is checked against the defending unit's agility to see if he hits.
   An alternative way of doing this would be as follows:
Code: [Select]
<unit>
<parameters>
<size value="1"/>
<height value="2"/>
<max-hp value="600+(fortitude*10)" regeneration="3"/>
<max-ep value="400+(intellect*10)" regeneration="intellect+5"/>
BLAH BLAH BLAH
</parameters>
<attributes>
SAME AS ABOVE
</attributes>
<skills>
<skill>
<type value="attack"/>
BLAH BLAH BLAH
<attack-strenght value="100+(willpower*15)"/>
<attack-var value="40"/>
<attack-range value="7"/>
<attack-type value="energy"/>
<attack-hit-chance value="50+((willpower-target_agility)*10)"/>
BLAH BLAH BLAH
</unit>
Unfortunately, I don't know enough about XML or about the Glest engine to know if this is even remotely possible to have equations like that, so the first example seems easier to implement.

daniel.santos

  • Guest
Re: RPG-style attribute scores
« Reply #1 on: 4 May 2009, 19:04:32 »
These ideas are good, but the path to implementing something like this isn't as straight forward or easy to summarize as your examples (or at least, the 1st example).  GAE is a game engine.  The rules for what "game" you want to play are defined by the "tech" you specify -- this might as well be renamed something like "game" or "game type".  Each game will have different rules, so what is needed is a mechanism to accommodate very different rule sets.  Lua scripting is one path to that.  However, I caution that too much scripting can result is a big bloated game that's slow or has frequent pauses as scripted code is interpreted.  Thus, in my opinion, scripted code should be kept to a minimum, mostly where performance issues are concerned (i.e., functions that are performed several times a second).

So calculating how much damage to do or rather or not a hit succeeds is not what I would consider a very high-use function, but if a scripted function for this calculation becomes excessively large due to an increased complexity in game rules, it can become a performance problem.  Adding scripted functions to calculate energy & hit point regeneration can get ugly because that would get run for every unit once per second (and you can have hundreds of units in a game).

I'm not opposed to the concept of "attributes" and, in fact, attributes are already embedded in the various skill definitions.  Eventually, I think that user-definable attributes will be the way to go.  Further examination of this concept in relation to the concepts of hit points (HPs), energy points (EPs) and "locally stored resources" is in order however, since there may be some overlap.  The end result may be that hit points and energy points may be removed as inherent concepts of the game and be replaced by game-defined attributes which are affected by attack & repair skills, etc.  The game's definition would then contain the rule that if your hit points reach zero or lower then your unit dies.  I wont say right now because unfortunately, I'm still tied up in the network changes which in my opinion is one of the most important things that need to be completed right now.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: RPG-style attribute scores
« Reply #2 on: 5 May 2009, 20:55:17 »
Being a BIG (and I mean big) RPG fan, stats is a better name. Of course I support these, and FF style stats are probably the best (attack, strength, magic, stamina, etc;).
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

 

anything