Silver Key - discrete actions

june 21, 2024

hi all,
Phase II of Silver Key is progressing steadily. the player has a face now.

this month, i built a discrete action system. discrete actions are any action the player can perform that have a predefined ending and can't be done continuously. this includes attacking, dodging, and using items. its a broad category, but theres a lot of behavior that can be defined across all of them, and that will save a lot of time.

the anatomy of an action

action diagram

the system is built around the player's animations. each animation has a wind-up, strike, and recovery.

during the wind-up, the player is locked into the action they are about to do. this is mostly just a delay, keeping actions from happening instantly and providing a bit of time for the enemy to interrupt the player, or vice versa.

the strike is the phase where the action is actually performed. in the case of an attack, enemies hit by the weapon during this phase will take damage. in the case of a used item, its effects will realize now.

the recovery is the time it takes for the player to return to their default state after the skill is complete. if the skill is part of a combo, the game will listen for another attack button press and return to the wind-up phase if it receives one. if the player pressed the attack button early during the strike phase, it will remember that during the recovery phase and initiate the combo, allowing for quick successive strikes.

each combo is simply a list of skills, and when the player progresses the combo, they simply proceed down the list.

i referenced Johnny Rouddro’s video: Godot 4 Hack and Slash #1 Active Skill when building it out.

current progress

features completed this month:

  • player model updated
  • weapons can be equipped and unequipped
  • sword has a 3-hit combo, hammer has a 2-hit combo
  • the player can lock on to enemies

features to be completed for Phase II

  • spear and bow weapons
  • animations for equipping and unequipping
  • shield
  • two new enemies

im still on track to release Phase II in august.

thank you for reading, and ill see you in july!
- ciaran

a wolf washing their paws in the sink ↑ back to top ↑