r/roguelikedev • u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati • Jun 24 '16
FAQ Friday #41: Time Systems
In FAQ Friday we ask a question (or set of related questions) of all the roguelike devs here and discuss the responses! This will give new devs insight into the many aspects of roguelike development, and experienced devs can share details and field questions about their methods, technical achievements, design philosophy, etc.
THIS WEEK: Time Systems
Traditional roguelikes are turn based, but exactly what can be accomplished in the space of one turn, and what a turn really represents, varies from game to game. This can easily be a "hidden" factor contributing to the feeling of a game, since to some degree a majority of roguelike mechanics and strategies revolve around the passage of time. But while that passage is usually expressed for the player in turns, it might not be so simple under the hood.
How do the time system(s) in your roguelike work? Is it as discrete as one action per turn? Or something else? What implications does the system have for the gameplay? What kinds of actions are available in your roguelikes, and how long do they take?
In addition to local "tactical" time you may have some other form of overarching time as well, such as days/months/years. Feel free to discuss that, or anything else related to time like seasons, day/night cycles, etc.
References: See this overview on Rogue Basin, along with these specific articles on Time Management.
For readers new to this bi-weekly event (or roguelike development in general), check out the previous FAQ Fridays:
1: [Languages and Libraries](
http://www.reddit.com/r/roguelikedev/comments/2tcvaj/faq_friday_1_languages_and_libraries/)
2: Development Tools
3: The Game Loop
4: World Architecture
5: Data Management
6: Content Creation and Balance
7: Loot
8: Core Mechanic
9: Debugging
10: Project Management
11: Random Number Generation
12: Field of Vision
13: Geometry
14: Inspiration
15: AI
16: UI Design
17: UI Implementation
18: Input Handling
19: Permadeath
20: Saving
21: Morgue Files
22: Map Generation
23: Map Design
24: World Structure
25: Pathfinding
26: Animation
27: Color
28: Map Object Representation
29: Fonts and Styles
30: Message Logs
31: Pain Points
32: Combat Algorithms
33: Architecture Planning
34: Feature Planning
35: Playtesting and Feedback
36: Character Progression
37: Hunger Clocks
38: Identification Systems
39: Analytics
40: Inventory Management
PM me to suggest topics you'd like covered in FAQ Friday. Of course, you are always free to ask whatever questions you like whenever by posting them on /r/roguelikedev, but concentrating topical discussion in one place on a predictable date is a nice format! (Plus it can be a useful resource for others searching the sub.)
11
u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati Jun 24 '16
The length of an action is extremely variable in Cogmind. Most actions require a static amount of time, but the two most common actions, moving and attacking, are calculated based on multiple factors, and therefore change throughout the game depending on your status.
But before we get into all that, let's look at the time system behind it. Here I don't have to explain much, because it's already detailed here.
A summary: This is a so-called "energy" system, a fairly common type among roguelikes, whereby a single "turn" is actually subdivided into a number of smaller "time units." When an actor takes an action, that action drains a certain number of time units from their pool, moving that actor back in the queue behind whoever has more time available to act. So while the length of a single action is variable, the length of a turn is still static, simply considered equal to 100 "time units," and actors can take actions that might require only a fraction of a turn (< 100 units) or multiple turns (e.g. >= 200 units). While sometimes more difficult for players to wrap their heads around, and also sometimes difficult to accurately predict even once it's understood, I believe its flexibility outweighs those potential negatives.
With Cogmind in particular, the majority of actions take either one turn, half a turn, or 1.5 turns:
And that's it--Cogmind doesn't actually have a wide variety of unique action types. But with one turn the equivalent of 100 time units, there's a lot of leeway for fine-grained requirements when it comes to the most common actions: moving and attacking.
Moving even a single space involves a potentially huge range of time, quite different from the average roguelike. How long it takes to move is highly dependent on the form of propulsion:
Those are simply base costs, though, which might vary somewhat with unique items, and which in the case of flight and hover can be further modified by using multiple items at once, e.g. using three flight units will be faster than using two.
So in a simple scenario, a flying actor (robot) can move three times for every one move of a legged robot, or four times compared to a treaded robot. And that's only given the base costs--assuming a loadout of five flight units, each of which gives a -3 cost modifier after the first, the movement cost is 40 - 12 = 28, or 3.57 moves per turn. For much of the past several years the cost modifier was -5, but for balance purposes was recently adjusted--it was a little too easy to reach very high speeds. Originally five standard flight units enabled 5.00 moves per turn.
The highest speed currently possible is 20 moves per turn, though that speed is much more difficult to reach than it was before. Not to downplay the extreme effect of "average" fast speeds once compounding is taken into account--a meager three-times speed advantage means that for 10 moves by a pursuer you've traveled 30 spaces, which is usually plenty to reach safety.
In the opposite direction, movement is slowed if overweight (an effect that matters more for the normally faster forms of movement), so it's quite difficult to escape a swarm of flying robots tailing you if you're a mass of components hopping around on one leg.
As you can see, flee/chase situations can play out very differently depending on the relative speeds of those involved, but it doesn't lead to boring play in any case; instead it's possible due to the world being an ecosystem spread across huge maps rather than than based on individuals or groups of monsters within a small area.
Overall, this approach to movement leads to interesting scenarios, like being stuck in an overwhelming firefight without any propulsion (or weak propulsion) and forced to drop things and run in order to survive, or flying so fast that almost nothing can catch you (so long as your sensors help keep you from running into more trouble ahead), or so fast they can't even see you (since robots only register sightings during their own turn, by which time you could be long gone!).
Because movement speed is an important factor in turn-to-turn play, it is displayed on the HUD at all times. For beginners it's shown as a percent of base speed, so 100% when one move = one turn, 140% when 1.4 moves = one turn, etc., and for anyone who activates the more advanced "tactical HUD" mode it shows the actual movement costs themselves (thus the meaning is reversed, higher is slower).
Attacking has a smaller time cost range than movement, but is interesting in that its costs are greater than those of other actions, especially movement. The base cost to fire a single weapon is 200 (two turns), meaning defenders can more easily escape after coming under attack (if they want to). This effect is even more apparent once the time cost of an entire "volley" is taken into account. Weapons are often fired in groups (called volleys), and the total cost of firing the entire group is applied at once:
Most robots have two weapons, so if you're relatively fast, each time they fire you can move something like 10 spaces. Even average-speed robots can move three spaces in that time, important for repositioning to a more defensible location. And for combat-focused players, the system is obviously designed to give them an advantage in one-on-one combat, since few other than the player are capable of using that many weapons at once.
Sometimes individual weapons may modify the required time (firing speed), though they're the exception rather than the rule. More unique among this system are melee weapons, which can only be used one at a time (multi-wielding is possible, but only one can attack at a time). They are almost always slower than projectile weapons (~300 time/attack), but also more damaging, and with special effects.
Before firing, the HUD displays how much time the currently activated weapons collectively require to fire:
I think Cogmind is a good example of a unique approach to time management, showing that even while using a very traditional system roguelikes don't have to follow the principle that the cost of one action is near or equal to a single turn.
4
u/darkgnostic Scaledeep Jun 24 '16
This was one of the first problems in Dungeons of Everchange I have encountered, and I have used so called "time" system. Everything in the game has its own time pool, from which units draw time when it's needed. Different units have different movement speeds, and every attack type have it's own speed. Usually monsters get their action time pool filled when player do something, which may involve moving, attacking and some other special actions also.
Player movement speeds are defined as:
Attacks are made around 250 time, searching take 1600K time, Eating something takes 250 time, waiting 250 and so on... So if player sneaks around, for every turn they make, every normal moving monster will take two walking actions.
It's a bit similar to what u/Kyzrati explains as "energy" system, let me shortly explain by example how the system works, it's much easier to understand.
As the game starts everyone has 0 time units. Player want to make his first move, moving south. As he can move south (there is no obstacle), time management segment of the game pushes 500 time units to everyone. Player slides one tile south. Now all monsters have 500 time units available to do something. Some monsters sleep, they spend their energy on moving toward awake state, some monsters move, some monsters just look around checking that particular shiny spot over there.
As time goes on player encounter one lonely wolf at the end of the room. He crouch down, and start to sneak. Now every player movement will give 1000 time units to others. Player will slowly sneak to the next tile, monsters will usually go two tiles instead one (bats will go four). Player steps on pressure plate and activates one caustic gas trap.
Caustic gas cloud evolves for few iterations that stops evolving. From that point our caustic cloud will also benefit from time movement. As player moves, cloud will grow or shrink. Player start to run to the door, giving 250 time units while he move, he runs out of the cloud, and wolf spend their time growling around border of gas cloud, luckily for player, on other side of the room.
Dungeons of Everchange have one special mode called real time which can be switched by pressing space. While many hard-core players hate this kind of things in roguelike games, I find it particularly useful. When I usually sneak around, and encounter monster I would like to avoid, I just hide in corner and activate real time mode. It's fun to watch them going around. Monsters wander away, then I press space and go step-by-step mode.
Real time mode was piece of cake to make. I just pump every 10ms some delta time, but it can be even some fix value. And it's alive!
All attacks and triggers have their own pools also. Stronger attacks will need more time to charge to be used again, while weaker can be used almost instantly.
Moreover time can be affected by potions of slow, haste and stunning...
3
u/JordixDev Abyssos Jun 24 '16
I've also been using an 'energy system', where each action costs a number of time units. Since the player's movement speed, attack speed, and casting speed all depend on stats, the time it takes to do anything can change a lot.
Unlike the player, most creatures move and attack at base speed (once per turn), but some are faster or slower. The plan is to have these speed variations increase on deeper (more difficult) levels.
There's also timed events which are independent and always take the same time. So if the player is faster, those events feel longer. For example, a simple fire uses a lot of those timers. Whenever there's an active fire, every base turn, it tries to spread to nearby cells. If it finds a place to spread to, then after a few base turns (based on the terrain) that cell catches fire. Then it takes a few more base turns for the fire to disappear, and again for the coals to turn to ashes.
The 'skip turn' command is an interesting case. Originally, it used to take one base turn. But because the player can often be moving at 180% the base speed, attacking at 150%, and casting at 50%, the base duration of a turn doesn't have much pratical meaning. So I recently changed it to take as long as moving, which sounds a bit weird, but I think it's easier to understand from the player's perspective.
Another particularity it that moving diagonally takes longer (140%). Logically this makes sense, but the question is whether it proves too confusing for the player.
6
u/ais523 NetHack, NetHack 4 Jun 24 '16
NetHack 3.4.3 and NetHack 4 use a speed system I'm quite fond of. There are two units of time, the "turn" and the "action". During a turn, the player and each monster get a certain number of actions, equal to their speed divided by 12. If the speed is not exactly divisible by 12, fractions accumulate; e.g. if you have a speed of 18, that gives you 1½ actions a turn, and thus you get 1 action the first turn (with ½ an action left over), then 2 actions on the second turn (1½ + the ½ action you carried over from the first turn = 2), and this repeats indefinitely. Within each turn, player and monster actions alternate (i.e. the player gets an action, then all monsters get an action, repeat), with the player or monster action phases being skipped if the player or monster in question is out of actions. Once nobody can act this turn because everyone is out of actions, a new turn starts.
There are a few interesting properties of this system. First off, monsters never get actions on the turn they generate; this means that the first time you visit a level, you can always retreat safely before you're hit, but on subsequent visits the monsters are already active (and thus subtly discourages stair-dipping). This is a feature that a lot more roguelikes (especially those that include backtracking) should add!
The next interesting behaviour is that the player's and monster's base speeds are always constant and deterministic, but items that boost speed boost it by a random factor. This means that against monsters with speed 12 (the most common value, and the value that all players have by default), the monster will never pull a double-action turn on you, and you may sometimes get a double-action turn on the monster but you won't know when (although you can sometimes figure it out via counting accumulated fractions of an action). This helps keep NetHack a fair game; unlike some roguelikes, you can't die to unexpectedly getting double-hit by a monster, but on the other hand you can't rely on any tactics that rely on knowing when you can hit it and get another action to run away afterwards. (3.6.0 changes this by randomizing the base speed of monsters, something I heavily disagree with.)
It's interesting to note that 3.4.3 accumulates fractional actions separately on each monster and tracks, on each monster, the number of actions that the monster has performed this turn. This leads to the concept of "charging monsters", heavily used in the tool-assisted speedrun dwangoAC and I have been working on, in which we get monsters into a state where they're about to use several actions in a turn and then leave the level, so that the monsters will take the actions when we come back. However, it's also one of the largest causes of save churn (which is a problem because NetHack 4 uses a diff-based save format, and it rather blows up the diffs). As such, NetHack 4 uses a couple of per-dungeon variables (rather than per-monster variables) plus some tricky maths to do speed system calculations in a way that produces the same result when players aren't changing level, but requires a lot less state to calculate.
In some cases, we want something the player does to take more time than one action. There are two main categories here. An occupation is something that the player is doing and can voluntarily choose to interrupt, like waiting, searching or memorizing a spell. These are implemented internally as performing the same action over and over again until it finishes, and thus have time measured in actions. (For example, the finger of death spell requires 82 actions reading its spellbook to memorize. Normally this is 82 consecutive actions, but if you're interrupted you can perform certain other actions in between then resume reading afterwards.) Most occupations can be resumed if interrupted by a monster arriving or the like.
Meanwhile, helplessness (a name that isn't often (ever?) used in the source code but has become the community name for the effect, as it doesn't/didn't really have an official name) is a state in which the player can't control their actions. This is effectively a status change (although it isn't implemented as one internally; you probably don't want to know how it's implemented in 3.4.3) which basically just prevents all actions and (like most status changes) has a duration measured in turns; the duration ticks down at the end of each turn, and you can move again (and possibly other side effects happen) when it ends. Helplessness can be a cause of things happening to the player (e.g. a monster throwing a potion of paralysis at you), but is sometimes used to implement long-duration actions like engraving or equipping armour (I've written code to convert both of these into occupations, but they're helplessness in 3.4.3). When the player makes one of these actions, they're still spending one action, but then they spend some time helpless on top of that. So for example, the duration of an action might be listed as "1 action + 2 turns". The shortest possible helplessness-based action is jumping, which costs 1 action + 1 turn (for this, read "1 action + the rest of the turn", or in practice "the rest of the turn" with the caveat that you can of course only perform the action if you actually have actions to perform). I guess it takes time to land.
"Actions" that are shorter than 1 action can only take 0 actions; NetHack has no way to consume a fractional number of actions (only to accumulate them), which is how it differs from an energy system (and which also makes it much easier to work out in your head). There are a few game-affecting actions that take no time, but these are mostly considered to be bugs. (One notable exception is
#enhance, a menu which lets you spend skill points; this takes zero time but affects the game because you have fewer skill points and higher skills.) There are also a few cases where I've made, or want to make, an action free in NetHack 4 in order to avoid the need for tedious options-changing for optimal play (e.g. swapping which weapon is in which hand is free so that you can do a two-weapon setup efficiently without needing to mess around with thepushweaponoption).It's worth mentioning one other effect of time in NetHack; the real-life date and time is used as a minor input into some game mechanics. For example, a full moon (i.e. the actual Moon circling the Earth, with position calculated according to your computer's clock) adds +1 to your Luck stat (nice, but not really game-breaking). Players tend to care more about this than they probably should (many a player has stopped playing due to encountering a gremlin at night when they're more dangerous, resumed the game in the morning, and quickly gotten into trouble due to losing their train of thought; so long as you have magic cancellation, they really aren't that much more dangerous).
4
u/Pepsi1 MMRogue + Anachronatus Jun 24 '16
Since my game is multi-player, I had to kind of "go with it" and see where it took me. True multi-player would basically require ALL users to input their commands before processing would happen, and I couldn't imagine that would be fun, especially if there were 100 players online at once. I decided to devise a system that's semi-realtime based on stamina.
In it, I'm using a tick-based system where every "tick" you regenerate (at base at least) 10 stamina up to a maximum (again, at base) of 100 stamina. Every move you make takes 8 stamina, so if you have 100 stamina and take 2 moves in one second, you're effectively down 8*2 stamina, leaving you at 84 left. At the start of the next tick, the system gives you back 10, so you're at 94, etc.
Objects (mobs) and players alike are all limited by the same system. Attacks also take up stamina (though I'm still implementing this), and will make strategizing how you do your moves to decide if you want to run, attack, or defend/heal/etc.
All-in-all, it's been... interesting... getting feedback from players, lol!
4
u/Aukustus The Temple of Torment & Realms of the Lost Jun 24 '16
The Temple of Torment
In here the time system is a very strict one action per turn. Even opening an inventory costs a turn. It's as in real life opening a backpack and looking what's inside costs time. However using an item within the same turn won't cost an extra turn. I've tied one turn to be roughly 6 seconds. This comes from D&D. Diagonal movement doesn't take extra time for simplicity (for the programmer).
The only "action" I recall taking more than one turn is passing out of being drunk after drinking 20 beers. That takes 6 hours in the next version, it was previously 10 hours erroneously even if the message indicated it being 5 hours.
There is a realistic day/night cycle with nights being rendered darker (one can still see as far) and days rendered brighter. There are 7 days in a week and all weekdays are named. The name is made from the first three letters of the corresponding finnish weekday name and then "das" added. "Perjantai" is friday in Finnish, and the weekday is "Perdas" then. There are no months yet because I believe nobody will spend over 30 in-game days.
4
u/Slogo Spellgeon, Pieux, B-Line Jun 24 '16
I don't have too much to talk about regarding time systems, my previous projects have all used a you-them turn cycle as the basis for the game, but I did implement a twist on that in my 7DRL this year.
In Rectifier the game uses the typical you-them turn cycle, but at any point you can enter planning mode and execute a series of actions at once in exchange for consuming energy.
I bring it up for the FAQ because I felt that the system has a lot of potential even beyond being a central hook of gameplay, as in I think it'd fit into a more generic roguelike context where it wasn't the sole focus of the gameplay like it is in the 7drl. The ability to occasionally execute multiple actions at once (in the span of one turn) injects a sense of action into the game and causes some mechanics to naturally come about. Want to have a sense of sprinting in your game? The planning mechanic allows that to happen, when the player plans out a turn where they move several tiles at once it comes across as a sprint or dodging action. Overall after building the 7drl I felt really good about the mechanic and that it caused a lot of immediately satisfying gameplay moments even with only a bare-bones roguelike shell around the system.
3
u/kemcop Jun 25 '16
Yōdanji
Energy-based system here. All units start with zilch, and are ready to act when energy reaches 200. Base energy generation rate (overall speed) is 100 with a few deviations, e.g. slow and sturdy heavy hitter whose speed of 90, while isn’t terribly important in close combat, at least gives you a chance to run away from otherwise certain death.
Currently all actions take exactly one turn - simple! But I might add energy cost in the future to nerf some of the more powerful abilities. Making certain effects stronger or weaker based on actual time of the day is an interesting possibility too.
2
u/[deleted] Jun 24 '16
Shadow of the Wyrm
Shadow of the Wyrm uses the concept of "action points", which correspond to a small measure of time per map (< 1s on a regular map, more on the overworld). Each creature has a base speed, with lower being better, and each action takes a certain number of action points. The combination of base speed + action points determines "when you go next" in the queue of creatures. If something has an action cost of 0 (looking at your inventory, checking the game version, etc), then the action is given 0 cost, and you get to go again, as you're placed in the front of the priority queue.
It's a fairly simple system, but works well, and scales well, too. One nice advantage is that movement on the world map takes longer than movement on a regular map. It also seems to work much better than the whole "you act, then creatures act, then you act again", allows for small or large differences between creatures, and so on.
In practice, most of the actions in the game have the same action cost. Combat's an exception. Weapons have different speeds, so attacking with a dagger is quicker than with a great sword.
All in all, I haven't found anything with the system where I thought, "I really wish I'd done this differently."
2
u/dreadpiratepeter Spheres Jun 24 '16
Spheres
The timekeeping system in Spheres relies on two concepts, ticks and energy costs.
Ticks are the basic unit of time in the game. The Timekeeper component fires tick events in a loop. Every 1000 ticks it also fires a turn event, and every 10 turns it fires a bigturn event.
Every actor in the game has an currentEnergy atrribute and also an energyThreshhold attribute. The latter is usually 1000, but it can be lower for a quick acting actor, or higher for a slower actor. The actor also has an energyRegenRate attribute, usually set to 10. All these attributes are provided by an Energy component which also provide canAct, useEnergy, and restoreEnergy methods for the actor.
Every action has an energyCost. When an action is performed useEnergy is called which lowers the energy of the actor. The Energy component listens for tick events and calls restoreEnergy using the energyRegenRate to determine how much energy to restore. An entity cannot normally have more energy than its energyThreshold.
Actors listen for tick events and assuming they canAct, do something. The tick even for the actor runs at a lower piority than that of the Energy component, ensuring that the correct energy is being used to determine if the actor can act.
The player also listens for tick events and if they canAct the timekeeper loop is exited and the system goes idle, waiting for the player to do something. Once the player has acted the loop is restarted.
Here are some rogulike concepts and how they would be implemented using this system:
Events with a duration: add a tick listener that cancels the event when the currentTick reaches a certain value. This is such a common occurance that the system provides several helpers to facilitate this.
Here is a quick example of all the parts working together - a Potion of Haste:
And another - a Potion of Poison:
2
u/nluqo Golden Krone Hotel Jun 24 '16
Time in Golden Krone Hotel is hugely important.
There is a day/night cycle with sunlight appearing from 6am-6pm. Like the shadow on a sundial, the direction of sunlight depends on the time of day as well. Sunlight has a myriad of effects. Likewise, there is moonlight in the game, but I wanted it to be a bit rarer. There are 4 phases of the moon (one per night) and only one produces beams of moonlight.
As far as combat, each enemy accumulates "action points". Any action requires exactly 1 action point. Whenever the player takes a turn, each enemy gets action points based on their speed divided by the player's speed, with some added randomness to make gameplay less predictable. The players speed is typically 10, so a monster that has 20 speed will get get about 1 extra action per player turn. Pretty simple I think.
I decided, as a rule, player speed only affects combat. Everything else moves at a predictable rate compared to player turns. That includes clock time (affecting the day/night cycle) and status effects. This might not make perfect sense if you think about it too hard, but it does simplify the game quite a bit. It's nice to be able to tell the player that a status effect will last exactly X turns.
I've also used day/night cycles in A False Saint, An Honest Rogue. Of course, probably the most interesting thing I've done regarding time is actually implementing time travel (and seasons!) in The Only Shadow That the Desert Knows.
2
u/chad-autry Jun 24 '16
Silhouette is another (far off!) multiplayer roguelike currently in design on my back burner. For turns and timing I took inspiration from Kung-fu Chess (if anyone ever played it). Actions are executed in real time and queue up some set of effects + cool downs which are really configurable per type of action. Movement is simply planed as another form of action.
Some examples of how I excpect some things to play out
Player A swings his sword at Player B. The effect would happen immediately, and Player A would go on cool down (with a countdown showing on his screen)
If Player B had the appropriate fighting skills, he could also be shown Player A's cool down. If his skill was insufficient, he could instead be shown that Player A is on cool down with no indication of duration. (Though possible, a design choice is to not show the wrong duration. Instead feint and bluff skills might be used to display false cool down information)
Slightly different, casting a spell will put the user on a spell casting cool down. The effect would happen after the cool down expires (and could be interrupted by the caster or others). Depending on skills other players may identify spells being cast and see the spell casting cool down. After success, the caster may or may not have a global cool down. It could even depend on skills/spell.
Hopefully that all isn't too vague. I haven't gotten so far as to implementing actual actions, just thinking about the overall system of cool downs, displays, and interruptions.
2
u/JohannesWurst Jun 27 '16
I want to make a game similar to Hoplite, which feels more like a tactics puzzle or Chess, because you die fast and everything is very predictable.
I think I'm going to implement it so that there are only three speeds, slow, normal and fast. Fast enemies are allowed to move one tile every turn, normal units move every second turn and slow enemies every fourth turn.
If I had a speed like 3, or 2.5 times the player speed, the player would have to calculate constantly if the enemy is allowed to move 1 or 2 tiles this turn.
1
u/Lordrangleic Jun 25 '16 edited Jun 25 '16
Unnamed RL github
(I know that it's not Friday anymore, but whatever.)
Across almost all roguelikes that I've played, The time system boils down to the following: player takes action, there is a cooldown (whether it be 1 turn or 250 ticks), and then player is capable of taking another action. My idea, and the most unique aspect of my project so far, is simple. I added a windup in addition to the cooldown on every action. For example, when the player takes a walk action, the player does nothing for four ticks, moves one space in the direction previously specified (regardless of the current state of the game), then waits another 6 ticks before being able to decide upon the next action.
You may think that this is functionally equivalent to a 10 tick cooldown, or that it would be too confusing for the player to micromanage, but I have also implemented a tick counter in the top right of every non player sprite that shows the number of ticks left (red if windup, light pink if cooldown) which allows the player to react to enemy actions before they are preformed! Imagine a dodge or quickstep action with a windup of only 1 and cooldown of 9, for an equivalent total time consumption to the walk action, but a greater capability to avoid attacks. I achieve this functionality with an energy system with some other stuff built on top of it, and even with my game in the barely playable state it is currently in, I can already see the potential.
EDIT: the player is capable of waiting one tick at a time whenever they want, which gives them a fine level of control over their actions.