Thursday, October 18, 2012

Actions

Before I get going properly building the engine I want to have a pretty good idea of what it need to be able to do.

Every turn the user can perform an action. Their choices boil down to:

  • Moving.
  • Attacking.
  • Using an ability.
  • Using an item.
  • Performing an environment action.
  • Making an inventory change - this means picking something up, equiping items etc.
  • Wait.

Moving

Moving is fairly obvious. The characters move from one square to another adjacent square. I'm only going to do four way movement, both because I'm told it makes it easier for casuals and also because there may be at some point a (small) chance of me putting in animations and thats 4 less directions to have to create cycles for. Well 2 if I just flip the artwork.

I'm going to have pathfinding in there. I just need to decide how to implement it. I already have a reasonable A* pathfinder that works with tile based maps. It works fine for just the player character, but it has issues when there are lots of mobs, all heading towards the player. After reading this article 'The Incredible Power of Dijkstra Maps', I want to try to use Dijkstra maps, at least for the mob pathfinding anyway.

Attacking

Attacking another character without using an ability. Can be either ranged or melee. For a melee attack the attackee must be on an adjacent square, for ranged attacks they can be further away.

When a player uses an attack I want the attack to be able to not only have different types or damage, apply damage over time, have a potential to splash damage over an area, but to also trigger abilities. The properties of the attack would be stitched together from the player's equipment  status effect and stats. Each attack will have a primary damage type specific to the weapon, and this is what can crit, is use in some calculations, and has combat bonuses added to it.

Using an ability

What can abilities do?
First I have to decide on what the attacks and abilities need to be able to do. I did a rough brainstorm and this is what I came up with:

  • Damage enemies, with varying types of damage (eg slashing/crushing/piercing/fire etc).
  • Damage should be able to be over a duration.
  • Should be able to add status effects* to characters.
  • Should also be able to stun, root, fear or put character to sleep (sleep is a stun which breaks on damage) for a duration.
  • Damage should be able to be delayed.
  • Should be able to decide whether or not to affect the user.
  • Should be able to reposition both the active character and the character it is used on. Not just knockbacks, but tactical movements.
  • Should be able to target the environment, as well as characters.
  • Should be able to have a radius of effect. The power of the ability should be able to change depending on the distance.
  • Radius shouldn't just be circles.
  • Abilities should be able to trigger follow on effects. This is nice as it's potentially a way of mixing basic abilities together to make different exotic ones. This could be used to do the delayed damage/effects that I want too.
  • Should be resistible depending on the resistances of the target and the power of the ability, or not resistible.


Using an item.

Using an item can be viewed the same way as using an ability, except that the item is used from the player's inventory/equipment. There will be some abilities that are only available through equipment, like town portal (if I have them), teleport etc.

Performing an environment action.

This means things like opening doors and chests or pulling levers.

Making an inventory change.

This means picking something up, dropping things, equipping items etc. I am tempted to make dropping items free.

Waiting.

Do no action for a turn. The most frequent use of this is in games where the characters regenerate their health over time, so an injured player can wait a time until their health returns.


*Status effects

A status effect is an effect that can be applied to a character. It lasts for a duration and affects the character. I want status effects to be able to:

  • Affect stats. This can be by percentage or absolute.
  • Do damage or heal over time.
  • Do additional damage on hit/being hit, either for or against the character with the effect. These could just be abilities.
  • Trigger abilities on hit, being hit, ability use or move. These can have a percentage chance.
  • Trigger ability on end.


No comments: