Published on

Devlog #15 - Skills & Stats

Started off the week trying to get a bug fixed in BabylonJS as pointer down events do not fire when the pointer is down and it turned out to be my fault! I then went ahead and fixed the old sprite pivot point bug so now npcs, players, and enemies are positioning correctly.

From there I moved onto making the first skill books. What are skill books you might ask? Well, they are consumable items that teach you a skill. In FO we had skill shops that sold skills directly into your skill book, in FO2 we're going to have item shops selling skill books that you then use to add the skill to your skill book. Make sense? Good.

Took a detour to implement damage/health/etc popping up over head. It works!

Ok, now back to skills!

Ok, maybe not. I added sprite depth sorting by using the y position mapped into the z position. Depth sorting puts sprites in front of each other based on their y position.

Ok, now back to skills.

Wait, no, it looks like clicking sprites when they're rotated isn't working right. Oh, yep, it's broken. Let's ask the BabylonJS devs to fix it. https://forum.babylonjs.com/t/should-sprite-picking-work-with-rotation-angle/40768 And it was a real bug and they fixed it, the end.

Ok, now back to skills. And just like that, instant damage skills are working and thus Sucker Punch is working!

The selected actor info frame is now partially working as well. Things are moving along! Fixed a few bugs and added SHIFT + B to toggle all bags on the bag bar.

Now I'll go ahead and finish up all the numbers that pop up above an actor's head. We've got damage, healing, energy, xp. That's looking nice.

See that above? That's a Skill Shop. Skill Trainer Wu is currently only selling Thick Skin 1st Edition which is a consumable that teaches the skill Thick Skin Rank 1! So I've created the item, created the shop, wrote the code to handle adding it to the character's skill book, and voila we've got Skill Books.

Now that my character has learned Thick Skin Rank 1, we need to implement buffs! But before that, lets fill up Wu's shop a bit.

That's better, but I ran out of coins buying Skill Books! Back to the grind.

We now have all 9 skills from the first skill shop ready for sale! Where am I going to get Gems? Hmmm. Well, after getting buffs setup on the server side, I need to make those little icons appear under the character info frames.

And we've got buffs displaying! The countdown overlay is working and everything is awesome! It still need a few tweaks, but it's working.

All of these new skills require higher stats than I have, so that means it's time to code up adding stat points. First we need our purple plus button back up and running and we need 4 of them next to the main stats.

That's looking very familiar now. Let's implement the server side code for adding stat points and voila, we've got adding stat points! Hmm, where to put the total stat points available. Let's add a reset button and move things around a bit.

Uhhh...

That looks good to me. What do you think? But how much should a stat point reset cost? https://www.patreon.com/posts/how-much-should-83171988

Remember quests? We need to finish working on that code, but we need item stacks first. I added stack code to both client and server and we're at about 80% for stacks.

Mmm, look at all them turnips.

And then the week ran out. In the upcoming week I will be working on lots of little bits and pieces and I'll start work on the market!

See you next Friday!

Have Fun & Keep Gaming!