nanoMMO

MMORPG sword skills in C++ that dash, launch and juggle

Five sword skills for our C++ MMORPG, with dashes the server walks the player along, blows that throw monsters into the air and keep them there, copies left behind, a flash, and a camera that goes in.

Watch on YouTube

Our MMORPG's sword gets five new skills. The C++ server can now move a player during a skill, along strides in the skills file, so that everyone sees a dash, and a blow can throw a monster into the air, keep it there with the next one and slam it down, for two seconds at most however many players take turns. Each monster's height goes to the raylib client, which tumbles it in the air, draws see-through copies of a player on a fast move, flashes the screen of the player using a skill and takes their camera in. Phantom Rush, Skyrend, Tempest Flurry, Cyclone and Severing Moon are entries in a text file, on a hotbar with a second row on Shift. This is episode 62 of a series about building an MMORPG from scratch in C++, with the focus on the engineering around the game.

Topics: Gameplay

The code

Each step on screen is a tag in the game's repository. The code at the end of the episode is ep062/end.

  1. 2:37ep062/step-1StridesBrowseChanges
  2. 23:31ep062/step-2LaunchesBrowseChanges
  3. 36:59ep062/step-3Tempest FlurryBrowseChanges
  4. 46:16ep062/step-4CycloneBrowseChanges
  5. 49:33ep062/step-5Severing MoonBrowseChanges

Transcript

Intro

0:00 Hello and welcome back to episode sixty-two, where the sword gets five new skills, which dash the player through monsters, throw them into the air and slam them down. Let's begin with a quick look at where we're going to be by the end of the episode.

0:14 By the end of the episode, Phantom Rush dashes through the skeleton we picked, leaving copies of us behind, and its cut lands a moment later, with our back to it. Skyrend throws the skeletons in front of us into the air, follows them up, and slams them back down, and Severing Moon draws back and holds still, before a single wide cut across everything in front.

0:34 The project has a website, with more about the series. The game's code is open source, on GitHub, and linked from there, and each episode has a page of its own, with the code at each of its steps.

Last time

0:47 Last time, the fighting in the game got some weight. A skill could land more than once, and each blow knocks a monster back a little as it lands. A blow that lands holds the player and what it hit still for a moment, the heavier the longer, on the client's own clock, which catches up after it. A monster lights up as a blow lands, and rocks back, away from whoever hit it. The blade got an edge that lights up, and cuts that hang in the air, each with a sound of its own, and holding Space goes round a chain of three swings.

Today

1:20 Here's the fighting as the game stands, at level four, in the Ashlands, whose skeletons are tougher than the ones in the Meadows. Each blow of the chain holds the player and the skeleton still for a moment, and pushes it back along the ground. The lunge in Thrust is the client drawing the body half a metre ahead and back, as the server holds the player where they started the skill until it's over. And however heavy the blow, a monster stays on the ground. Along the bottom, the hotbar has eight skills on the number keys, with one key to spare.

1:53 Today, the sword gets five skills of its own, longer than the ones we have, and each needs something the game can't do yet. First, strides, so that the server moves the player during a skill, for a dash that everyone near sees. The client gets two more kinds of fx: copies of the player left behind on a fast move, and a flash over the screen of the player using the skill. Then launches: a blow can throw a monster into the air, keep it there and slam it down, for two seconds at most. The camera of the player using a skill can go in closer, and with all of that, Phantom Rush, Skyrend, Tempest Flurry, Cyclone and Severing Moon are entries in the skills file. Right, let's get going, with a new version first, and then the strides.

Strides

2:38 This episode's code is a new minor version of the game, so in the top CMake file, the project goes to zero point sixty-two, and the login server turns away clients of any other. So far, the server holds a player where they started a skill until it's over, and when a move lunges forward, that's the client drawing the body ahead, and back again. A dash has to go much further than that, and everyone nearby has to see it, so the server is the one to move the player, as it does for a walk. In our proto file, a stride is where a skill has taken the player by a time into it: the time, in milliseconds, as the blows give theirs, and how far, in metres. It takes one of the eases the moves' keys use, which says how they get there from the stride before: smoothly, with a snap that's fast at first, or gathering speed. The distance is measured along the way the player faced as the skill began, and it's the server that moves them there. A skill's effect gets a list of strides, in order, and once the last one's done, the player stays where the last stride leaves them. While we're in here, two more kinds of fx, which the first of today's skills is going to use. Ghosts draw the player again where they were a moment ago, see-through and lit in the fx's colour, a twentieth of a second apart, one copy for each of the count. And a flash turns the whole view of the player using the skill towards its colour, and back. It's for their screen alone, as in a crowd, with everyone's flashes on it, our screen wouldn't stop flashing. And the count now counts copies too, as it does sparks and cuts. In the skills header file, parse skills gets strides on the list of what it checks, with the blows and the moves' keys. Eased was the client's, in moves, and it comes over here, into the content library, as the server needs it now too, and the server can't use anything of the client's. Given how far we are in time between two keys, as a share from zero to one, it gives how far along the way the ease has got, from zero to one as well. And ahead at says how far the skill's strides have taken the player, in metres, some milliseconds into it: from none at the start, eased towards each stride in turn, and the last one's distance once it's done. In skills, parse skills checks the strides much as it checks the blows. Each stride's time can't come before the one before it, or the error says the skill's strides go back in time. And a stride can't come after the skill is over, as the server doesn't get that far. A swing is as long as the weapon's swing, so the swings are left out of that check, as they are for the move's keys. Eased comes over from moves as it was. Snap is one, less the cube of what's left, so it starts fast and slows into the key. Gather is t cubed, slow at first, and the default is the smoothstep curve, slow at both ends. Ahead at goes through the strides in order, starting from no distance at no time. Once it finds the first stride still to come, it works out the time from the stride before to this one. How far we are through that is a share from nothing to one. Two strides at one time would make that a division by zero, so a stride at the time of the one before counts as all the way there. And it eases from the last stride's distance to this one's, by that share. A stride we're past becomes where we start from, and past them all, it's the last stride's distance. So a first stride that stays at no distance holds the player where they are until its time comes. And in moves, the client's eased goes, and moves includes the skills header instead, so the moves and the strides ease alike.

6:12 On the server, in the world's header file, a player keeps where they stood as their skill started, as an x and a z, which the strides go on from. Measuring from there, and not from where they were a tick ago, means the steps can't add up to more or less than the stride says, however the ticks fall. And the world gets stride, which takes the player as far along the skill's strides as it's got to, from where they started it. In the world, act moves each player on through their skill each tick, adding the tick's time to how far into it they are. Now it strides them too, before any of the skill's blows land, so a blow at the end of a dash lands from where the dash took them. Start keeps where the player stands as the skill starts, after aim has turned them to face the monster they picked, if it's within reach. Then stride, which goes along the way the player faced as the skill started, which aim turned them to, and like a walk, stops where something's in the way. A skill without strides leaves the player where they are, which is all the skills we have so far. Otherwise, ahead at gives the distance, from how long they've been in the skill, in milliseconds as a float, which chrono's duration converts to for us. The place is that far from where they started, along their yaw, with its sine for x and its cosine for z, as a walk works it out, and clamp keeps it inside the land's edge. And walk takes them there, as it does each step of a walk. Where the place is somewhere they can't stand, such as the sea, it moves them along whichever of x and z it can, or not at all, so a dash stops at the coast. Each tick, the clients get the player's place as they always do, so everyone nearby sees the dash, with nothing new going over the network.

7:58 Now, let's write a quick test that a stride takes the player along the way they faced as the skill started. Its world is made the way the other world tests make theirs, with a default terrain and the tests' sword. It gets a skills file of the test's own, in a raw string, with a dash that holds the player for a second. Its first stride keeps them where they are for two hundred milliseconds, and its second snaps them four metres ahead over the next two hundred. The player joins knowing it, facing along z. The skeleton stands three metres off to the player's left, along x, so that they turn to it as they start. They pick it, and use the dash, which turns them to face it. For the first four ticks of fifty milliseconds, the first of which starts the dash, they stand, and then they dash four metres, through the skeleton and past it, along x, where it was as they started. So after those four ticks, they haven't moved at all. Two ticks later, a quarter of the way into the dash, they're past two metres, as the snap covers most of the way early, and not yet at four. Four ticks after that, they're four metres along x, and nowhere along z, so the dash went the way the player turned to as it started, and not the way they faced as they joined. And they stay there once it's over: a second later, they're out of the skill, and still four metres along, where the last stride left them. In the content's tests, the test that refuses skills that don't add up gets three more checks. A dash whose strides go forward in time, inside its nine hundred milliseconds, parses. Each of the two refusals after it changes nothing but the strides' times, so what's refused is down to them. With the two strides the other way round, it's refused, as its strides go back in time, and with the second one at one point two seconds, it takes a stride after it's over.

9:49 We build the tests at this step, in Docker, and run the new world test, then the content's test. Neither needs a database or Redis, so dash dash no deps starts the test container without them, and grep keeps the lines that say how each test did. The filters pick the tests by name, with a star for the rest of the name, and the double ampersand runs the content's tests once the world's have passed. The build takes a while, as the image compiles the whole game from scratch. The stride takes the player along x, to where the skeleton was and past it, and the content refuses strides out of order, or past the end of their skill.

Copies and a flash

10:28 On the client, a copy of the player is the player's own figure, posed as it was a moment ago, and the characters are what draws the figures. So in their header file, the characters get draw ghost, which draws a figure as it was, see-through and lit in a colour, without the outline the others get, as one of the copies a fast move leaves behind it. It's drawn after what's solid, as a copy doesn't hide what's behind it. In characters, the light a blow's flash gives a monster gets a neighbour, a copy's glow, which at one and a half on top of the sun's light is enough to bloom. Draw ghost draws the body alone, in the colour, with its weapon too, lit so that it glows. It poses the character as the figure says, which is how a copy gets the pose of a moment ago, and places it where the figure is, turned and tipped. It turns the shader's emission up to the glow, and draws the body, placed, tinted by the colour, whose alpha is how see-through the copy is. The weapon in the figure's hand, if it has one and the character has a hand to hold it, goes into the hand by its grip, is placed with the body, and drawn in that colour too. Then the emission goes back to none, for whatever's drawn next. In the fx header file, we include deque, the standard library's double-ended queue, which adds and drops at either end cheaply, and utility, for the pair each place on the path makes with its time. The copies a fast move leaves are a twentieth of a second apart, and draw ghosts draws them, with the characters, over what's solid. And each cast keeps a path: where the player's been, by the time of the cast's move. The server sends where the player is now, and nothing about where they were, so the client remembers where it drew them a moment ago, which is where the copies go. New places go on the back, and old ones come off the front, which is what a deque is good at. In fx, update moves each cast's time on, each frame, and now it adds to the path too. When the cast's time has moved on since the last place it kept, the player's place goes on the end, with the time. During a blow's hold, the cast's time goes at a twentieth of its speed, so the places it keeps then come close together. And places older than ten gaps, half a second, come off the front, keeping two at least, so that there's always a pair to go between. Draw flash draws a sheet of the colour just in front of the camera, over the whole view, at once and then fading. Our light is drawn three times as bright as its colour, so a sheet of it at the colour's own alpha would hide the view, while a sixth of it doesn't. It fades on a square, so it's gone quickly. The sheet faces the camera, square to the way it looks. Forward goes from the camera to what it looks at, and right is across forward and up, from their cross product. Up for the sheet is across right and forward, so the three are square to each other. Its middle is half a metre in front of the camera, and it's four metres across and four high, which at half a metre covers more than any view of forty-five degrees. The quad's four corners are the middle, out and up or down by those, all in the colour. It's drawn with the skills' light, over everything in the world, and it blooms with it. Then draw ghosts, which keeps track of whether it's found any copies to draw yet, as most frames have none. It goes through the casts, and the fx of each one's skill, with when each one starts and how long it lasts, in seconds. It's after the ghosts that are on: from their start to their end, plus the time it takes the last copy to catch up. The first time it finds one, it draws what raylib has batched up so far, stops writing depth, so that a copy doesn't hide the one behind it, and blends by alpha. Then the copies, the oldest first, as each goes over the one before. Each is another gap further back in time, and it's drawn while that time is within the fx. A copy is the player's figure, at that time into its move, so it's posed as the player was then, with nothing of the clip before it blended in. Where the player was then is on the path, between the two places either side of that time, as far between them as the time is. A deque can be read by its index, like a vector, so going through it in order is cheap. The older the copy, the fainter it is: the newest gets most of the colour, and the oldest a little, at a bit under half the colour's alpha at most, and the characters draw it. Once they're drawn, the batch is drawn again, and the blending and the depth go back as they were. And draw light draws the flash, when the cast is our own player's, and for nobody else's. In the renderer, the copies are drawn after the sea, and before the skills' light. They're see-through, like the light, but lit as the figures are, by the sun. And in foley, the copies and the flash both get a sound. At their loudest, the copies are at four tenths and the flash at six, under the shake's seven. The copies get a whoosh, air torn as the player goes past, faster than a swing's, in a band of noise that moves from two hundred hertz towards three and a half thousand as it swells, which sounds like this. The flash is a crack, a click of noise high up, with a thump below it, a tone that drops from a hundred and forty hertz to thirty-eight over half a second, like this.

Phantom Rush

15:43 Now the first of the sword's new skills, in the skills file. Phantom Rush is skill ten, from level one for now, like the others, and it's ready again after fourteen seconds. It holds the player for one and a half seconds, and reaches seven metres, for fifty-five damage to the monster they picked. It doesn't hit all of them, so it needs a pick, and turns the player to face it. It goes through the monster and past it, and then the cut lands. Its first stride holds the player where they stand for about a quarter of a second, while they crouch, and the second snaps them seven and a half metres ahead, in under a fifth of a second. That's further than the reach, so from wherever the monster was within it, the dash goes through it and out the other side. Its one blow lands at seven hundred and sixty milliseconds, a moment after the dash has stopped, with the player's back to the monster, and knocks it a metre. Its icon is Font Awesome's fast forward, and its blow holds the player and the monster for ninety milliseconds before the push's weight, as long as Earthsplitter's, as it hits hard. The move starts by gathering into a crouch, sixteen centimetres down by a quarter of a second. The chest is bowed and turned forty degrees to the right, the sword arm drawn back, so the blade's low behind, and the other arm reaching forward, with both knees bent. Gather starts slowly and speeds up into the key, the way you'd gather yourself before you spring. A tenth of a second later, it snaps into the dash: the spine and chest bow forward, the sword arm swings out in front, the other goes back, and the legs stride out in a lunge. The front leg goes forward fifty degrees, and the back knee straightens, pushing off. As the dash stops, it snaps on round: the chest turns sixty degrees to the left, and the sword is swept out flat across the body, the way it went through, with the knees deep, twenty centimetres down. The other arm goes back and out, and the legs are wide apart, the front knee bent eighty degrees. The next key holds that pose, sinking a couple of centimetres more, until the blow lands behind. It's a key without an ease of its own, so it gets the smooth one, slow at both ends, which suits a pose that barely moves. So the player is still, with the sword out and their back to the monster, as the cut appears on it. The chest turns a couple of degrees more, and the sword rolls on a little with it, so the pose doesn't look frozen, as a body that stops dead reads as the game stalling. The knees sink a few degrees deeper too. Then it snaps half way back up, the chest turned a little the other way and the sword arm lowered and out to the side, with the legs still a little bent, which leads back into the standing clip. It's standing by one point four five seconds, just before the skill lets go of the player at one and a half. Its fx come in shades of violet and a pale lilac. The edge lights up from a tenth of a second in, and a ring goes off where the player sets off, spreading out to a metre and sixty. Six copies, in a paler violet, follow the dash, with a pale trail behind the blade as it goes through. As the blow lands, two cuts hang across the monster, a metre up, at a slant of twenty degrees, with twenty-two sparks off it. A faint, pale blue flash goes over our screen for about a sixth of a second, and the camera gives a small shake, of twelve centimetres. And in the NPCs file, the trainer teaches skill ten as well, so a player who doesn't know it can learn it at any level, for now.

19:10 Let's see it in the game at this step, with two clients side by side: arthur's on the left, and on the right, gwen's, just past the skeletons. The server walks the player along the strides, a step each tick, and sends their place to the clients nearby as it would for a walk. So both draw the dash, and each draws the copies from the places it saw. The flash goes over the screen of the player who used the skill, and no other. With gwen's client as the one using it, the flash is on the right, while the left draws the dash from where arthur stands.

Launches

19:46 The next skill throws monsters into the air, which the server has to do, as it's the server that decides where a monster is. In our proto file, a blow gets a lift: how high off the ground it throws the monster, in metres. One that's already in the air goes up again, so that blow after blow keeps it there, for two seconds at most. And a negative lift dashes one in the air down, as fast as a fall from that high. A blow's hold grows with a throw, as it does with a push, by the height as well as the distance. The clients have to see a monster go up, so in our protocol's proto file, a monster gets a height: how high a blow's thrown it, in metres, while it's in the air. In the world's header file, gravity pulls a monster that's been thrown up back down, at fourteen metres a second, each second. That's more than the Earth's nine point eight, so that a monster falls back fast, and doesn't float. A blow without a lift of its own that lands on a monster in the air sends it up at two and a half metres a second, enough to keep it there a moment longer. A monster can be up there for two seconds at most, counted from when it was first thrown, however many players keep hitting it, and then it falls whatever hits it. After that, it stands its ground for two more, so that it gets to fight back. While a blow has it in the air, a monster keeps how high it is, in metres off the ground, and how fast it's going up, which slows as it goes, and is less than nothing once it's falling. Up there, it does nothing else until it lands. It keeps how long it's been in the air since it was first thrown up, and once it's down, how long until it can be thrown again. Throw sends the monster up to the height, or, already in the air, down for a negative lift, and a little further up without a lift. And fly moves it up or down as it flies, and says whether it's still in the air. Both are static, as they need nothing but the monster. In the world, land hits each monster in reach and in the skill's arc, and pushes it, and now it throws it by the blow's lift too. Throw is a ball thrown straight up: fast at first, slowing to the top, and back down. A monster is flying while it's off the ground, or on its way up from it. Its time is spent once it's been up for two seconds, or while it's down and still steady, and then nothing throws it up again, though a blow can still dash it down. A lift higher than the monster is throws it up to that height off the ground, however high it is already, so that blow after blow doesn't send it ever higher. The speed that takes it there is the square root of twice the gravity times the height still to go, which comes to a stop right at the top, and if it's going up faster already, it keeps its speed. A lift below nothing sends a monster in the air down, at the speed of a fall from that high. A blow without a lift gives one in the air the pop, if it's going up slower than that, and on the ground, there's nothing to do. Thrown, the monster drops the swing it was in the middle of. Fly runs for each monster on each tick. On the ground, it counts the steady time down, to nothing at the least, and says the monster's not flying. In the air, its time up there adds up, and once that's two seconds, it goes no higher: any speed upwards is taken away, so it falls from there. The height moves on by the speed, less half of what gravity takes off it over the tick, which is the sum for something thrown, and gives the right height whatever length the ticks are. And gravity takes the tick's share off the speed. When it reaches the ground, it stops there, its time in the air goes back to nothing, and it's steady for two seconds. In act, a dead monster's push still ends with it, but one thrown up still comes down, so a monster doesn't die and hang in the air. And a living monster that's flying does nothing else that tick: it doesn't chase, swing or wander until it lands. Last, in the server, each monster's height goes to the clients with the rest of it.

23:32 Next, a quick test that a lift throws a monster up, and that a blow in the air keeps it there. Like the stride's test, its world has a skills file of the test's own, in a raw string, with a single skill. It's a launch whose first blow, a tenth of a second in, throws the monster up to a metre and a half, and whose second, half a second later, has no lift. The skeleton stands a metre in front of the player, who picks it, and uses the launch. Then the world steps on, a tick of fifty milliseconds at a time. Three ticks in, the first blow has thrown it up, and it's rising, slowing as it goes. Over the next nine ticks, we keep the highest it gets, which is a metre and a half, to within ten centimetres, as a tick doesn't land on the top. By then, it's falling, when the second blow, without a lift, catches it, and we keep how high it was then. Two ticks later, it's still up, and going up again, from somewhere above the ground. Then it comes down, and a second later, it's on the ground and staying there, with a height and a speed of nothing. The second test is the limit of two seconds in the air, with two players, in a world of its own. Its skills file has another launch, and it's quick, four hundred milliseconds, with a single blow a tenth of a second in that lifts the monster a metre. Two players join, half a metre apart, and the skeleton gets a thousand health, so that it lives through all of it, and they both pick it, so that each one's launch goes for it. We keep the longest it's been up, and how long it's been up so far, both in seconds. For three seconds, sixty ticks, they take turns, one player each tick, throwing it up as fast as they can, and the server starts the launch whenever that player's last one is over. After each tick, we see whether it's up, add the tick to how long it's been up without coming down, or start again from nothing, and keep the longest of those. It's up for more than a second and a half at a time, so the launches keep it up, and it's down in a little over two seconds: the two at most, and the fall from where it was. Then a fresh world, for the time after it lands, with that launch again and a single player. Its skills file is the first world's, as a raw string again, and the player joins knowing the launch. It gets another of the tough skeletons, with a thousand health, which the player picks. The launch throws it up, and the world runs for a second, long enough for a throw of a metre to come back down. A second after the launch, it's down on the ground. That's an assert, which stops the test there if it isn't, as nothing after it would mean anything. The launch straight away leaves it where it is, on the ground, and not going up, as it's steady. Then the world runs for two more seconds, one at a time, which is the steady time, and after that, the launch throws it up as before. So it's the steady time that held it down, and not the launch.

26:22 We build the tests at this step and run the two new ones, which need nothing but the world, so the container starts without a database again. The filter names both, with a colon between them, as Google Test takes a list of patterns. This step changed our protocol's proto file too, so the build makes its code again first, which takes a while. A lift throws the skeleton up to a metre and a half, and a blow in the air sends it up again. Two players taking turns can't keep it up for much more than two seconds, and it stays down for two after that.

Tumbling

26:54 On the client, in the animator's header file, a figure gets a lift, how high a blow's thrown it, in metres off the ground. In the animator, we include type traits, the standard library's header for questions about types, which the compiler answers as it builds. Follow moves a figure towards where the server says its player or monster is, smoothly, and it's a template, written once for both. Monsters have a height, and players don't, so this is an if constexpr. Its condition is worked out as the template is compiled for each type, and for players, the lines inside are left out, so nothing asks a player for a height it doesn't have. The condition is whether the type it's compiled for is the monster's. The figure's lift goes towards the monster's height by the share the position moves each frame, so it rises and falls smoothly between the server's ticks. In characters, placed puts the body into the world, turned and tipped over about its feet, and now up off the ground by its lift, which goes on the height of where it's moved to. The lift goes into the last step of the matrix, the move, so the turn and the tip still happen about the feet, and then the whole body goes up together. In the reactions' header file, a monster thrown up tumbles as it goes, now, along with lighting up and rocking back as each blow lands on it. It tips over by six tenths of a radian for each metre up, about thirty-four degrees. A blow is kept for two seconds now, long enough for a monster it threw up to come down again, tipped the way it sent it. In the reactions, update lets go of each blow once it's two seconds old, by when its monster is done rocking, and has come down from any throw. Apply sets each figure's lean from its blow, and up in the air, a monster tips over further the higher it's thrown, on top of the rock back, towards the way the last blow sent it. As it falls, its lift goes back to nothing, and the tip with it, so it comes down upright. Last, in fx, a blow that pushes or throws holds longer. The hold grows by half for each metre a blow pushes, and now for each metre it throws, up or down, as well, up to two and a half times as long.

A second row

29:04 Skyrend is going to be the tenth skill on the hotbar, which has a slot for each of the nine number keys. So the hotbar grows a row above it, on those keys with Shift, which keeps all the skills under one hand. In the hotbar's header file, a row is nine slots, a number key's worth, and there's room for two rows. In the hotbar, the constructor keeps at most that many skills, and compares with ssize, the size as a signed number, from C++20, as the most slots is an int and a size isn't. Build draws the slots, and each one gets a place in the order of the keys: the swing first, on Space, if there is one, and the rest on number keys, a row of them, then the row above. ImGui lays the buttons out left to right, and on down the window, so the order they're drawn in decides where they go. The row above is drawn first, from the tenth keyed skill on, and then the swing and the first nine, under it. The loop goes through those places, each with its slot. A slot past the swing and nine more is in the row above. Each button goes on the line of the one before, but for the swing's, which starts the row of numbers under the row above, when there is one. And the row above starts with a gap as wide as a slot, from a dummy, which takes up room and draws nothing, so that the row above starts over the one key, past Space. A slot's index in the keys counts from the one after the swing, and its label is Space for the swing, the number for the row along the bottom, and s for Shift before the number for the row above. A click uses the slot's skill, or the key whose index matches. In input's header file, hotbar key says which number key went down this frame, as a slot from zero, or, with Shift held, from nine, for the row above. And in input, Shift is either of the two keys, and with it held, the slot is nine further on.

Skyrend

30:51 Now Skyrend, which needs all of that, in the skills file. It's skill twelve, as eleven is going to be the one after it, and it's ready again after eighteen seconds. The skill lasts two point three seconds, and hits each monster within three metres, for seventy damage, shared between its blows, all of them, in a slice a hundred and forty degrees wide in front. It's three blows, one on the way up, one in the air and one on the way down. The rising cut, at four hundred and thirty milliseconds, throws them up to two point four metres. The cut in the air, a third of a second later, has no lift, and catches them still rising faster than the pop would send them, so it leaves them going up. The last one dashes them down, as fast as a fall from three metres, and knocks them a metre and twenty back. From just after the rising cut to nine hundred milliseconds, past the cut in the air, the player strides a metre and twenty after them. Its icon is the meteor, and its blows hold for seventy milliseconds each, before the weight of each push and lift. The move starts low: by three tenths of a second, gathering, the body's twenty-six centimetres down. The chest is bowed and turned forty degrees to the right, the sword drawn back low behind, with the wrist turned sixty and the other arm forward, and the knees bent ninety and eighty degrees. It's the lowest crouch of the five skills, as the jump out of it is the highest. Then a snap up, as the cut rises: the sword arm goes straight up, a hundred and seventy degrees, the chest leans back, and the body comes up thirty centimetres. The other arm goes out to the side, for balance. By six hundred and forty, the body is a metre and sixty up, after the skeletons, two hundred milliseconds after leaving the ground. The chest is turned fifty degrees to the left, and the sword is out to that side at shoulder height, with the wrist turned eighty, and the other arm out the other way. The legs fold under the body, the knees at a hundred and ten and a hundred and twenty degrees, as a jump would tuck them. At seven sixty, at the top of the jump, the cut in the air snaps across the other way. It's the second blow, without a lift, and the move keeps the body a little higher still, at a metre seventy-five, so the player meets the monsters at the top. Then, gathering again, both hands go up over the head, with the forearms folded back, so the sword's behind the head for the slam. Gathering here holds the body near the top for a moment before it falls, as that ease is slow to start. The slam snaps down in two tenths of a second, to thirty-six centimetres below standing, which is a kneel, with the spine and the chest bowed thirty degrees each, and the arms down in front. The legs are as Earthsplitter's slam has them, the back knee down at a hundred and ten degrees and the front leg reaching forward. The next key holds that until one point six five seconds, a kneel held for nearly half a second while the ring and the rocks go out. It eases a few centimetres up out of the kneel, with the arms and the legs as they were, and then the move rises. It's standing by two and a quarter, a twentieth of a second before the skill ends. The jump is the client's own, in the move, while the server keeps the player on the ground, where the strides take them, so the body goes up with the monsters, and comes down where the player is. The fx are gold, the colour of a meteor, starting with the edge, which lights up from a quarter of a second, for over a second, a trail follows the rising cut, and three copies follow the spring upwards. A cut hangs across the monster we picked as it rises, nearly upright, at eighty degrees, with eighteen sparks off it, as the rising cut lands. Two flat cuts go across it two point six metres up, for the one in the air, with a trail for each swing. And as they come down, a ring spreads out to nearly four metres, eighteen rocks are thrown up, with thirty-six sparks, a warm flash goes over our screen, and the camera shakes by up to thirty centimetres. And the trainer in the NPCs file gets twelve on its list.

34:48 Let's see it in the game at this step. Skyrend has the first slot of the row above, on Shift and one, as the tenth skill on the hotbar. The rising cut throws the skeletons in front up, and the server flies them under its gravity, while they do nothing else. The cut in the air catches them still on their way up, and the last blow's negative lift dashes them down. Each tick, the server sends each monster's height with the rest of it, and the client tips one over the higher it is, the way the last blow sent it. Once they're down, nothing throws them up again for two seconds, and they come back at us.

The camera goes in

35:23 The next skill is eight quick cuts, close up, and from where our camera sits, a few metres behind the player and above, they come out small. So for a skill of our own, the camera can go in. In our proto file, zoom is one more kind of fx: the camera of the player using the skill goes in by the size, in metres, and back out. Like the flash, it's for that player's screen alone. In the fx header file, zoom says how far in our own camera goes, in metres, for a skill we're using. In fx, it takes a quarter of the fx's time to go in, and the last thirty-five percent to come back out. Other players' casts are left out of it. For each fx of our own, u is how far through it we are, from nothing to one, on the cast's clock, which keeps going through a blow's hold, so the camera doesn't stop with the picture. Anything but a zoom that's on is left out. Smooth is a lambda for the smoothstep curve, from nothing to one, with t clamped to that, so it's flat on either side. The zoom is the size, times a curve in over the first quarter, times one out over the last stretch. In between, both are one, so it holds there. In the renderer, we include algorithm, for min. Toward goes from the camera to what it looks at, which is the player. The zoom is six tenths of that distance at most, so however big the fx, the camera stops well short of the player, and doesn't go past it. The camera moves in that far along toward, before the shake, which still moves it and what it looks at together.

Tempest Flurry

37:00 In the skills file, Tempest Flurry is skill eleven, ready again after sixteen seconds. It holds the player for two point four seconds, reaches two point four metres, and does seventy-two damage to the monster picked, shared between nine blows: eight cuts from all sides, and a thrust that throws it up. The cuts come a hundred and thirty milliseconds apart, from three hundred, each pushing twelve centimetres, so the monster gives way a step at a time, eight of them, up to twelve hundred and ten. And then the thrust, at one point five two seconds, knocks it a metre and twenty back, and throws it up to one point six metres. With nine blows, each gets a ninth of the damage, eight each. The player steps in as the monster gives way: ninety centimetres over the eight cuts, smoothly, and another seventy with a snap, into the thrust. Its icon is a sword between two curved blades, and its blows hold for fifty-five milliseconds, a little over a swing's, as there are so many of them. A cut that pushes twelve centimetres holds a few milliseconds longer, about fifty-eight, and the thrust, which pushes and throws, nearly two and a half times as long. During each hold, the player and the monster move at a twentieth of their speed, and catch up after it, so the flurry still ends when the server says. The move goes between four poses, one for each way a cut can go, and each key lists all the joints its pose bends. A joint a key leaves out goes back to the standing clip under the move, so a pose has to say all of it each time it comes round. First comes the wind-up, by under a fifth of a second, gathering, with the hips eight centimetres down. The chest leans back a touch and turns thirty-five degrees to the right. The sword arm is up a hundred and fifty degrees, over the right shoulder, with the forearm folded forty. The wrist is turned seventy, so the blade lies back along the swing to come, and not straight up out of the fist. The other arm is out in front and to the side, for balance, and the legs stand a little apart, the knees soft. The cuts' keys from here are snaps, a hundred and thirty milliseconds apart, each landing with its cut. The first cuts down across the body, from over the right shoulder. The chest bows and turns forty degrees to the left, the sword arm comes down to forty-five degrees and across, and the other arm swings back the other way. The front leg goes forward fifty degrees, with the knee bent, into a lunge, which drops the hips fourteen centimetres. The second goes back up to the wind-up, the first pose again, which makes it a rising cut, from low on the left up over the right shoulder, and the legs come back under the body. The third swings out flat to the left, with the chest turned fifty degrees that way, and the body back down into the lunge. The arm swings out at shoulder height, with the wrist turned eighty, so the blade lies flat along the cut. Tempest Flurry doesn't hit all, so however wide the swing, the cut lands on the monster we picked, and on no other. And the fourth comes back across to the right, flat again, with the chest turned fifty degrees to the right, the arm rolled the other way, and the forearm straight, while the legs come back under the body. So the four go down, up, and flat both ways, and no two cuts in a row come from one side. Then the four poses again, in that order, with their numbers as they were, so the second four cuts are the first four over. The fifth comes down across the body, as the first did, with the lunge again. The sixth rises back up over the shoulder. By now, the pushes of twelve centimetres have moved the monster about as far as the player has stepped in after it, which keeps it within the reach of two point four metres for all eight cuts. The seventh swings flat to the left again. At higher levels, the extra damage a level brings, five a level, and what the gear adds, are shared out between the blows along with the rest. And the eighth goes flat back across, the other way. Between them, the eight holds come to nearly half a second, which the cast's time makes up after each one, running faster than usual until it has. With the slashes at their angles, the cuts look like they come from all sides, and the hips dip a few centimetres on the ones that lunge, which keeps the body from looking stiff. Then, gathering for the thrust, the sword arm goes back thirty degrees, with the forearm folded right back, so the blade is drawn back level at the hip, and the other arm comes up in front, to aim with. A key that gathers starts slowly and speeds up into the pose, so the draw-back looks like it builds before it springs. The thrust snaps out, with the chest leaning in, the arm nearly straight ahead, with the forearm almost straight and the wrist at seventy-eight, the other arm thrown back, and the legs in the lunge. It's the heaviest of the nine blows, with a push of a metre and twenty and a lift of one point six, so it gets the longest hold. It holds there until one point nine seconds, easing back a few degrees. The last key has no turns, so the move eases back from the thrust to the standing clip, and the player stands again by two point three five. Blue is Tempest Flurry's colour: the edge, lit for most of it, a pale trail behind the blade for all eight cuts, and our camera going in by a metre, for the whole flurry and the thrust. Each cut leaves a slash across the monster we picked, a metre up, one point eight metres long, at the slant its fx gives it, as it lands. The first, down across the body, is at forty-five degrees, the rising one at minus forty, sloping the other way, the flat ones nearly level, at five degrees, and minus five. The two flat ones still slope a little, opposite ways, so they read as two cuts. The second four are near the first four, at fifty, a little steeper than the first, minus forty-five, a little steeper than the second, and the last two both level, at nought, one a moment after the other. The slashes last three hundred and eighty milliseconds each, so two or three of them hang in the air at once. Forty blue sparks fly off the monster over the cuts, and a trail follows the thrust. As it lands, a pale glow goes off on the monster, violet sparks fly up off it, and a blue ring spreads out under it. A faint flash goes over our screen, and the camera gives a small shake, of fifteen centimetres. And in the NPCs file, the trainer teaches skill eleven too.

43:16 In the game at this step, Tempest Flurry takes our camera in by a metre. The server lands its nine blows on the skeleton we picked, pushing it a little each time, while it strides the player after it. Each cut holds the picture for a moment, and the thrust throws the skeleton up, which the server keeps in the air until gravity brings it down. Skyrend is on Shift and two now, as Tempest Flurry took the first slot of the row above.

Cyclone

43:51 Now Cyclone, in the skills file, skill thirteen, ready again after fifteen seconds. A cast of it lasts two point one seconds, and hits each monster within two point six metres, all the way round, for sixty damage shared out. It lands a blow each time round, three of them, a little over a third of a second apart, each pushing forty centimetres, and a last wide cut throws them off, a metre and sixty away and seventy centimetres up. While it spins, the player strides five metres on, smoothly, from four hundred milliseconds to one point six seconds, so it goes through a group, hitting whatever is within reach each time round. The hurricane is its icon, and its blows hold for fifty milliseconds, a swing's, so the spin doesn't stall. The spin is all in the hips, the root of the skeleton, so turning them turns the whole body, legs and all. The move winds up first, gathering, with the hips turned fifty degrees to the left, the chest twenty more, and both arms out wide. The sword arm is out to the right at shoulder height, with the wrist turned so the blade points out flat, and the knees are bent for the turn. The spin is the hips turning to minus a thousand and thirty degrees by one and a half seconds. From the wind-up, that's a thousand and eighty degrees: three whole turns, as a key's angles go from one to the next however big they are. The last fifty degrees snap the hips on to three whole turns from where they stood, with the wide cut across to the right, in a lunge, which holds for a moment. The chest is turned fifty degrees to the right, with the arm swept across in the follow-through of the last cut, and the front leg fifty degrees forward. Both keys keep the hips at minus a thousand and eighty, three whole turns, so the body doesn't turn any further while the cut holds. And it's standing by two point oh five, with the hips still at minus a thousand and eighty. Three whole turns look like none, while going back to nothing would spin the player back round three times the other way. Cyclone's colour is crimson, for the edge, a pale trail behind the blade all the way round, for the whole spin, three copies, and forty motes swirling up. A ring goes off with each of the three blows of the spin, a little over a third of a second apart, each spreading out to two point six metres, the skill's reach. A flat cut, three point two metres wide, hangs where they're thrown off, with thirty sparks, and a small shake of the camera, fourteen centimetres, a little more than Phantom Rush's. And thirteen goes on the trainer's list, in the NPCs file.

46:17 In the game at this step, the server strides the player five metres on, while the client spins the figure round three times. Each blow lands on whatever is within two point six metres of where the strides have taken the player by then, so a skeleton near its path can be hit more than once. The last blow throws it off, and up a little, tipped over as it goes.

Severing Moon

46:38 The last of the five is Severing Moon, skill fourteen, with the longest cooldown of the five, twenty-two seconds. It's the longest of the five, at two point six seconds, and hits each monster within four and a half metres, in a slice a hundred and sixty degrees wide in front, for ninety-five damage. The player holds a drawn-back stance, then cuts once across all in front, whose one blow, at one point oh six seconds, knocks them two point two metres back and sixty centimetres up. The step through comes after the cut, so that a monster close in front is still in front of the player, and inside the arc, as the blow lands. So the strides hold the player still until the cut, and then snap them a metre and forty on, through where it went, in about an eighth of a second. On the hotbar, it's a moon, and its blow holds for a hundred and ten milliseconds, before the weight of its push and its lift, which makes it the longest hold of any blow, about a quarter of a second. The move draws back, gathering, for half a second, into a deep stance, twenty-two centimetres down. The chest is turned sixty degrees to the right, the sword arm back, with the blade behind, the other arm reaching forward, and the knees bent eighty-five and seventy degrees. Then it holds nearly still until nine hundred and fifty milliseconds, sinking a few centimetres and turning a few degrees more, which reads as the player gathering their strength. The hips are turned twenty degrees to the right as well, under the chest, which winds the body up for the cut. Holding a pose that long without a key to move it would freeze the figure, so a second key a little deeper gives the stance a slow settle. The cut snaps across in a tenth of a second, from the stance to the follow-through, the chest turning to seventy degrees to the left, with the sword arm swept out flat. The legs come up out of the stance into a lunge, the front leg fifty-five degrees forward, and the hips unwind, as the cut's key leaves them out. The follow-through holds until one point five five seconds, so that the cut reads as finished. It's the longest held pose of the five skills, half a second, while the crescent flies out. By one point nine five, it's nearly up, with the sword arm lowered and the chest turned back, and it's standing by two point five five, just before the skill lets go of the player at two point six. The fx are a pale violet, and our camera goes in by a metre and twenty while the player's drawn back. Fifty motes swirl up round the player in the stance, and a pale glow sits on the tip of the blade while the edge lights up. As the cut lands and the player steps through, three copies follow, with a trail, and the flash on our screen, with a crescent flying out six metres, which is the moon of its name. Three cuts hang across the monster we picked, now that the cut lands while it's still in front, with thirty sparks off it, as the blow knocks it back. A ring goes out to four metres around the player, and the camera shakes by up to thirty centimetres, as much as Skyrend's slam. And the trainer teaches all five of the sword's new skills now.

49:34 In the game at this step, while the player is drawn back, our camera goes in, and the server holds the player still until the cut lands, then snaps them through after it. The blow knocks what's in front more than two metres back and throws it up a little. On our screen, the hold is a quarter of a second, the longest of any blow, with the shake and the flash on top.

Several players

49:55 Now, three players at once, at the final step, in the middle of the Ashlands: arthur's client, and two more players logged in from clients of their own, gwen and percival. Their blows reach the server as everyone's do, and the server lands them alike, whoever's blow it is: a launch throws a monster up, and any blow that catches it in the air keeps it there. However many players take turns at it, its time up there adds up from when it first left the ground, and at two seconds, it comes down, whatever hits it. Once it's down, it stands its ground for two more, and a launch does nothing to it then, so that it gets to fight back. Each client draws the others' copies and cuts from what the server sends, and its own player's flash and zoom, and no one else's.

Wrap-up

50:40 So, today, skills got strides, which the server walks the player along, so that everyone nearby sees a dash. The client draws see-through copies of the player where they were a moment ago, and a flash over the screen of the player using the skill. A blow can throw monsters up, keep them there and dash them down, for two seconds at most, with each monster's height on the wire, and the client tumbles them as they go. Our own camera can go in for a skill, and five sword skills put all of it to use, on a hotbar with a second row on Shift.

Playing it

52:06 Let me know in the comments which of the five you'd use first, or what you'd like to see next, and if you want to follow along with the series, subscribe to the channel. I hope you find this useful, and thanks for watching.