Author Topic: Representing agility  (Read 29718 times)

Rusty

  • Newcomer
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Representing agility
« on: August 21, 2009, 02:51:14 PM »
I want to have an "agility" stat that can be used to distinguish "fast" and "agile" characters from "slow" and "sluggish" characters, like the difference between the Scout and the Heavy in Team Fortress 2.  I'm interpreting agility as mainly a defensive* stat that allows a character to dodge attacks and circle around his opponents more easily.  However, I can't figure out a mechanic for agility that doesn't conflict with a bunch of requirements I have.

I don't want agility to just increase a character's "defense" stat; that's what constitution and armour is for.  I also don't want a random to-hit chance that agility affects like it does in many other games.  I'm going to have all attacks always hit and hit for full damage, modified by defense, to encourage a bit more strategic play.  Any randomness in combat will instead be introduced through critical hits and other effects.

The only other way of expressing agility that I can think of is by introducing a speed/time system, where more agile characters get more turns to move than others, but I'm not really satisfied by this either.  I made a prototype once that had a speed system, where there was a type of monster that moved half as fast as my character (I had two turns per turn the monster had).  I found it a little cheap when I figured out how to damage the monster without getting hit myself.  As for the monsters faster than myself, I think the only reason those were tolerable is because the AI wasn't smart enough to take advantage of their speed, not because the speed system itself was "balanced."  On top of that, my stats are going to be in the range 5-20**, which is probably too high a resolution for speed differences to be noticeable.

So, what do you guys think is a good way of representing "agile" characters?

* I'm also going to have an offensive equivalent to agility that represents how precisely aimed a character's attacks are.  This will probably manifest as affecting the character's critical hits.
* 5-20 is actually a range for "mortal" characters.  I hope to make my game balanced for any power level, even up to the hundreds, for when I make my Dragon Ball Z roguelike.

george

  • Rogueliker
  • ***
  • Posts: 201
  • Karma: +1/-1
    • View Profile
    • Email
Re: Representing agility
« Reply #1 on: August 21, 2009, 05:00:04 PM »
What about increases in agility granting skills/buffs/special moves? You could get things like short bursts of speed (increasing levels of this, from two-cell moves up to four-cell moves say), jumping over things directly in front of you, wall springs to let you jump over two or three cells, jumping through windows, etcetera.

AgingMinotaur

  • Rogueliker
  • ***
  • Posts: 805
  • Karma: +2/-0
  • Original Discriminating Buffalo Man
    • View Profile
    • Land of Strangers
Re: Representing agility
« Reply #2 on: August 21, 2009, 10:35:02 PM »
I made a prototype once that had a speed system, where there was a type of monster that moved half as fast as my character (I had two turns per turn the monster had). I found it a little cheap when I figured out how to damage the monster without getting hit myself.

There are solutions to this problem. In my system, the game always remembers which direction the player is facing. Whenever s/he moves in any other direction, if there is a hostile monster adjacent in the current facing direction, it gets a free turn, which it will almost invariably use to attack the player. This means that a higher speed still lets you run away or get extra attacks, but it thwarts the "attack once, retreat once" tactic, which I guess is what you have in mind.

An alternative system might be better for you, but I just thought I would share this, since it works well in my game.

As always,
Minotauros
This matir, as laborintus, Dedalus hous, hath many halkes and hurnes ... wyndynges and wrynkelynges.

purestrain

  • Rogueliker
  • ***
  • Posts: 172
  • Karma: +0/-0
    • View Profile
Re: Representing agility
« Reply #3 on: August 22, 2009, 04:53:32 AM »
There are solutions to this problem. In my system, the game always remembers which direction the player is facing. Whenever s/he moves in any other direction, if there is a hostile monster adjacent in the current facing direction, it gets a free turn

Does the player get a free turn too if the monster changes direction? Or are these npc-exceptions only (which i really dislike).

AgingMinotaur

  • Rogueliker
  • ***
  • Posts: 805
  • Karma: +2/-0
  • Original Discriminating Buffalo Man
    • View Profile
    • Land of Strangers
Re: Representing agility
« Reply #4 on: August 22, 2009, 05:06:17 AM »
There are solutions to this problem. In my system, the game always remembers which direction the player is facing. Whenever s/he moves in any other direction, if there is a hostile monster adjacent in the current facing direction, it gets a free turn

Does the player get a free turn too if the monster changes direction? Or are these npc-exceptions only (which i really dislike).
At the moment, npc-only, since I didn't design the AI to exploit scummy tactics. But the system might as well apply to all critters. It could have some weird side-effects, as time would in effect occationally speed up around battle. However, the ways the player could exploit it would be a lot less bullet-proof and demand more finesse than "attack once, retreat once", eg. attacking a weak monster (just to scare it away) as a feint to get two successive attacks against another creature.

As always,
Minotauros
This matir, as laborintus, Dedalus hous, hath many halkes and hurnes ... wyndynges and wrynkelynges.

Rusty

  • Newcomer
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Representing agility
« Reply #5 on: August 22, 2009, 02:01:27 PM »
So, the ideas presented so far have been:

  • Increasing agility unlocks special moves and skills like jumping and speed boosts (george)
  • Use speed system, but also implement facing so that characters get free attacks against other characters that try to "hack-and-back" (AgingMinotaur)

I'm not sure about george's idea since that means I'd have to spend time coming up with a bunch of skills and moves, which is problematic since this would be my first game that I'd really like to release for once. ::) Also, I'd have a finite set of skills mapped to a possibly unlimited range of agility values. I was sort of hoping for a system that lets agility affect your overall performance.

AgingMinotaur's idea is interesting, but I'm worried that it might have a bunch of weird effects. As exploitive as I made speed systems out to be, they sort of make sense on their own. Faster characters would be about to outrun and outmanoeuvre slower opponents. Also, this still doesn't address the level of granularity I'll probably have for agility values.

justinhoffman

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
    • Email
Re: Representing agility
« Reply #6 on: August 22, 2009, 07:14:35 PM »
I like that you are getting away from the crazy DND AC.  Also, removing randomness is a neat idea as well.  I've played some games that did this, and it can help make the game more tactical and predictable.

You can also have different actions take different amounts of time (this would be a more offensive take).  I suppose it depends on how you handle speed, but you could have agility reduce the time it takes to make a basic melee attack, quaf a potion etc.

Agility might not increase your speed per say, but it would increase your action speed to take a percent say 80% or something of your movement speed.

I have a really simple system of time right now.  Basically given a players speed, it calculates the time it takes to act given that speed.  It then gives that time to each monster on the level and they convert it to ap (action points).  They then spend that, if they have enough to act until they no longer have enough ap to spend.  I know there are a whole lot of implementations of time in roguelikes, but I think this way is super easy.

It would be pretty easy to make say an attack take 3/4's the time it takes to move or have a stat that reduces attack time while doing it in a more interesting way than angband variants, where you just attack multiple times in a row.

Granted, the player might not really *see* that attacks are taking 1/2 a turn or something that way.  It might be hard to notice that type of mechanic.  I guess it's debatable if that's a superior way.  Angbands implementation where you just make several attacks at a time is certainly more noticeable to the player, although you lose the natural progression you could have otherwise and have break points where at X agility you get 3 attacks per round and at X + Y agility you get 4 attacks and between that there is no real point.

I can list the ways dexterity effects the game I am working on if that helps.

Base amount of armor weight before penalties (multiplied by a modifier based on armor skill, with armor weight you can have begin to have penalties to stealth/spell caster, dodge, unarmed damage, and speed starting at a set percentage of your base armor weight)
To hit (based on primary weapon stat), not sure how you would handle this though but you could have armor piercing, where your tohit limits the mitigation armor provides an enemy.
Damage (based primary weapon stat, certain weapon types gain damage bonuses from agility.  A sword might get less dex bonus than a dagger and a mace might be pure strength)
Flat bonus to Dodge, you could do damage mitigation to ranged damage and certain spell types to avoid random factor.  You could have a base dodge rate based on agility and have that modified by dodge skill.
Flat bonus to stealth (gains an indirect bonus from dex's effect on armor weight penalties)
Flat bonus to recharging a magic item.

For a dragon ball Z type game, DEF might work against physical attacks.  And Dodge might provide mitigation vs certain types of ranged attacks.   Actually you could have both, say DEF applies 3/4s mitigation vs physical and dodge provides 1/4 and vice versa.

So say you had 60% mitigation from dodge and 20% from armor.  You might have 30% mitigation vs physical melee and 50% vs ranged attacks.

Also with speed, you really don't want to move 2x as fast as a monster, as you pointed out that's no challenge.  But you want some method where speed can be any variable.  So maybe you are moving at speed 25 and the monster is at 17.  Under a system like that you get an extra 4th turn to the monsters 3 about.  It gives a more natural progression.  Also if you make a physical attack take a fraction of movement for both you and monsters, you can separate things out a bit.  That would also lend to the type of mechanic where you might have a character with 2x speed, and 2x attack speed getting 4x attacks per round vs a slow tankish character that might do 4-5x damage.  That would be cool.

Another thing you could do is have movement resolve for the player after giving enemies a chance to act, while attacking takes first priority.  That would make it harder to abuse speed, as movement would resolve after the enemies use the time you give them.  So your attacks would resolve prior to monsters having a chance to act, and movement would resolve post monster action.  That would also resolve the movement abuse.  So say you move 2x as fast, you'd attack, then move away.  But the monster would have a chance to act before your movement resolves on your send turn.  You'd end up a space away but the monster would have attacked as opposed to you moving a space away, the monster then not attacking and moving one space closer to you.

Of course, you have to ask do you want to get rid of movement abuse?  If you have granular movement, some enemies might be half as fast as your character some might be 6/7ths as fast or 4/3rds as fast.  When you run into a slower mob, is it wrong to abuse movement?

That's all I have for ideas on agility, I hope some of those are useful.
« Last Edit: August 22, 2009, 11:42:00 PM by justinhoffman »

Z

  • Rogueliker
  • ***
  • Posts: 905
  • Karma: +0/-0
    • View Profile
    • Z's Roguelike Stuff
Re: Representing agility
« Reply #7 on: August 23, 2009, 09:55:19 AM »
I have a really simple system of time right now.  Basically given a players speed, it calculates the time it takes to act given that speed.  It then gives that time to each monster on the level and they convert it to ap (action points).  They then spend that, if they have enough to act until they no longer have enough ap to spend.  I know there are a whole lot of implementations of time in roguelikes, but I think this way is super easy.

I don't think it is that super easy, with all this AP conversion. Just remember a "time for next action" counter (T for short) for each creature (or another kind of event); the creature with the smallest T always acts first; the action increases T by a value dependant on the action type and the creature's speed. This is simpler IMO.

Quote
Granted, the player might not really *see* that attacks are taking 1/2 a turn or something that way.  It might be hard to notice that type of mechanic.  I guess it's debatable if that's a superior way.

I certainly use the knowledge about attack times when playing roguelikes. Crawl has a system with actions taking different amounts of time. ADOM also has a speed attribute which affects all actions (and a mode which shows how much time, or 'energy', did the last action take). ADOM's speed system implementation is needlessly complicated and has some strange artifacts (like, when I am running from a monster who has the same speed, it is not constantly in the same distance: sometimes it makes 2 moves for my 1 move, and sometimes it makes no move).

Time systems with actions taking different amounts of time, and different speed values for various monsters, are good, but simple systems, where each action takes the same amount of time and each creature has the same speed, except some exceptions which give numerically simple effects (e.g., doublespeed monsters, potion of doublespeed, weapon of doublespeed which allows attacking twice, and similarly half-speed stuff) are also good, because they allow easy tactical planning.

justinhoffman

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
    • Email
Re: Representing agility
« Reply #8 on: August 23, 2009, 05:13:25 PM »

I don't think it is that super easy, with all this AP conversion. Just remember a "time for next action" counter (T for short) for each creature (or another kind of event); the creature with the smallest T always acts first; the action increases T by a value dependant on the action type and the creature's speed. This is simpler IMO.

Well it's pretty simple really using an object oriented approach.

For the player making an action you'd just have something like this, where time is in inverse of speed and action mod is the modifier say for an attack could be .8 or something.

double time = (1.0/speed)*actionMod
foreach monster m in list
   m.act(time)

And in the monster class you'd just have a method act which handles the AI and a double ap which stores built up time;

ap += time;
while(ap > 1.0/speed){
 //decide what to do and set actionMod

  ap -= (1.0/speed) * actionMod
}

I dunno that seems super simple to me.  It would kind of cheat by putting ap into negative possibly if you had AI actions with an actionMod > 1.0 but that's no big deal.  I could see how it might not be preferable to have a monster take all it's turns in a row while not giving others a chance to act giving an edge to a priority queue when you have multiple monsters moving multiple times a turn.

Quote
I certainly use the knowledge about attack times when playing roguelikes. Crawl has a system with actions taking different amounts of time. ADOM also has a speed attribute which affects all actions (and a mode which shows how much time, or 'energy', did the last action take). ADOM's speed system implementation is needlessly complicated and has some strange artifacts (like, when I am running from a monster who has the same speed, it is not constantly in the same distance: sometimes it makes 2 moves for my 1 move, and sometimes it makes no move).

Time systems with actions taking different amounts of time, and different speed values for various monsters, are good, but simple systems, where each action takes the same amount of time and each creature has the same speed, except some exceptions which give numerically simple effects (e.g., doublespeed monsters, potion of doublespeed, weapon of doublespeed which allows attacking twice, and similarly half-speed stuff) are also good, because they allow easy tactical planning.

  Yeah, I never notice this in Crawl early on when it's like attacks take .9 of movement speed or something.  When it starts to get much faster it's noticeable.  But I still think attacking 5x in a row is more noticeable or getting in an extra headbutt or kick.

Z

  • Rogueliker
  • ***
  • Posts: 905
  • Karma: +0/-0
    • View Profile
    • Z's Roguelike Stuff
Re: Representing agility
« Reply #9 on: August 24, 2009, 03:24:31 AM »
OO does not matter here. I think the problem is whether you have a player-centric (player is special) or world-centric (player is just a creature with special intelligence) view. The method I described is natural for the world-centric view, treating the player so differently than monsters in the speed system looks strange. As you noticed, you get some artifacts (although I don't see any situation where they would be noticeable for the player, except if the monsters fight each other). Unoptimized pseudocode follows:

gametime = 0;
foreach creature m in list if(m.t < gametime) gametime = m.t;
foreach creature m in list if(m.t == gametime) {
  m.act(); // which chooses an action (by UI for players and AI for monsters), performs it, and includes m.t += actionMod / speed
  }

justinhoffman

  • Newcomer
  • Posts: 33
  • Karma: +0/-0
    • View Profile
    • Email
Re: Representing agility
« Reply #10 on: August 24, 2009, 06:22:59 AM »
OO does not matter here. I think the problem is whether you have a player-centric (player is special) or world-centric (player is just a creature with special intelligence) view. The method I described is natural for the world-centric view, treating the player so differently than monsters in the speed system looks strange. As you noticed, you get some artifacts (although I don't see any situation where they would be noticeable for the player, except if the monsters fight each other). Unoptimized pseudocode follows:

gametime = 0;
foreach creature m in list if(m.t < gametime) gametime = m.t;
foreach creature m in list if(m.t == gametime) {
  m.act(); // which chooses an action (by UI for players and AI for monsters), performs it, and includes m.t += actionMod / speed
  }


    To be honest I could get rid of artifacts by doing something similar.  Just sorting by ap stored making a pass allowing them to act, then repeating until none can act again ending with a sorted list again and the player gaining control.  Ultimately it's seems more or less the same then with the difference being set game time, vs player giving ap.  So yeah, I suppose it depends on if the player is center to the game world and allows monsters to act. Though this doesn't mean the player can't also be a monster, and any implementation is going to end up with the player being some sort of special case.

     It just seems more intuitive to me the other way, it's neat seeing this implementation though.

  Also technically, having a monster object with a method act is object oriented design =p.
« Last Edit: August 24, 2009, 06:25:03 AM by justinhoffman »

purestrain

  • Rogueliker
  • ***
  • Posts: 172
  • Karma: +0/-0
    • View Profile
Re: Representing agility
« Reply #11 on: August 24, 2009, 06:29:04 AM »
I would agility just use as modifiers for

- time to take a directional movement change (but without any extra attacks like mentioned before, circle running would take longer than moving straight ahead)

- time for travelling dangerous/difficult areas (e.g. stepping through a pit, moving through rocky terrain)

- chances of activating traps on cells (if traps are known)

- chances of falling through holes, time modifiers for moving over cells with holes (i would also implement stances like cautious movement vs. fast movement)

- minor combat modifiers

Rusty

  • Newcomer
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Representing agility
« Reply #12 on: August 24, 2009, 10:04:51 PM »
I'm still skeptical about speed systems. As I said previously, it seems that their effects are only noticeable and controllable when you have a low enough speed resolution, like say 1-4. How many people would notice the difference between a character with a speed of 11 and character with a speed of 12?

I think, really, what I'm looking for is a dodging system that isn't random, so that I don't have to suffer through "miss, miss, miss" sequences. I also want the damage reduction from dodging/agility differentiable from armour/toughness.

Also, I was talking about agility in a defensive context, which in most games means a random chance to take no damage when hit.

I was sort of inspired by this usenet thread. I'm not sure if it reached a conclusion or not. One interesting idea though was to turn dodging from a chance to take zero damage into a chance to take half damage. This would probably make "missing" less annoying since progress in terms of damage to the enemy is still being made.

Z

  • Rogueliker
  • ***
  • Posts: 905
  • Karma: +0/-0
    • View Profile
    • Z's Roguelike Stuff
Re: Representing agility
« Reply #13 on: August 25, 2009, 12:57:51 AM »
Subtle differences in speed are very visible and important when trying to run from an enemy (provided there is enough space to run).

If your speed is 12 and the monster's speed is 11, you can easily lose the monster's track and flee.

If your speed is 11 and the monster's speed is 11, you cannot lose its track, but you can pillardance. (Not sure whether it's the proper name, I mean that you can regenerate health by running around a pillar or whatever while the monster is constantly following you)

If your speed is 11 and the monster's speed is 12, pillardancing is rather impossible.

Running away might save your life, so if you are reasonably sure that no other monster will appear on your way, then it is worth it to run even if the difference of speed is 102 to 101. (1000 moves required to gain 10 spaces, but if this saves your two days long game, why not?)

stu

  • Rogueliker
  • ***
  • Posts: 138
  • Karma: +0/-0
  • Moop!
    • View Profile
    • Stu's Rusty Bucket
Re: Representing agility
« Reply #14 on: August 25, 2009, 12:51:11 PM »
what it sounds like you need is a real rpg system underneath and not a roll your own system.

it reads like you want to have an agile stat without having an agile stat.

I also dont understand when you say you want to use agility to differentiate between fast and slow. To me agility has nothing to do with fast/slow characters. Agility is like.. dexterity in disguise. A lot of stats can overlap but to me agility doesnt really overlap with speed, its more of a dextrous/flexability stat thing.

as to your original question "what is a good way to represent agile".. have an agility stat...

to me, implementing a speed system is something to be decoupled from characters, its a different thing from a speed stat (my roguelike is realtime).





--/\-[ Stu ]-/\--