Friday, May 24, 2024

Teleports & Location-Swaps working

A rather productive Friday evening it has been. I've managed to expand the code that deals with special combat events, and successfully set up the code to handle both abilities that will teleport the user to a specific location, as well as the similar functionality for an intercept/protect ability that will swap two characters in locations.

There was a hiccup as I was testing, and sometimes things were working, and sometimes they weren't - and I could not for the life of me work out why that was the case for a while - until I looked into the database and saw that there was a column there that wasn't part of my editor interface, and I'd manually populated it, and my app code was already using it - a friend-or-foe percentage (which is rather cool really) but for my test ability, I'd already set it to 25%. Meaning that it would only hit an ally 25% of the time... so yeah, explains why it was sometimes working in testing, but mainly not...

Anyways.... the important part is that the RIGHT part of the code is functioning, which is rather cool indeed. Another two special case combat events handled nicely.

No code expectations tomorrow, but over the rest of the weekend, I'd love to tweak a few app layouts. I need a "cancel" button/thing on the menu that pops up to add a new ability to a hotkey, and there's a few similar and annoying things that I've been noticing as I test things that I should fix, and they are pretty discrete from other larger bits of code, so make for good candidates in a busy weekend.

Wednesday, May 22, 2024

Special Effects Work

Over the last two evenings, I've been focussed on getting Special Abilities working. Those are things that happen over and above a normal effect or ability during a combat sequence.

I might start with what's NOT a Special Ability. An ability that does some amount of damage to health, action or mana is not special. An ability that applies a certain effect to a creature or character is not special. What I'm treating as special is all the skill and abilities that will have some sort of outcome that is more interesting than simply a normal action taking place.

I'll talk to the special ability that I was working this evening, though most of my time was spent in getting the fundamentals working, adding more specials will be (hopefully) a bit easier - maybe. Today I was working on the Warcry in the Protection fighter tree. It's a skill that grants an ability to use in combat (also called Warcry) which is there to help manage threat. It's applied with a melee attack. If successful, it adds an additional 100 threat to all enemies in a smallish radius of where it happened. (I'm certainly going to tweak the 100 value in the future, but for now, it works).

So, a character makes an attack, if it hits, it does whatever normal damage is supposed to happen (which generates a bit of threat for that character) but additionally it also does the special part, which is adding the threat outside of a normal damage event. Ergo. Special.

I've found the right place to slot it into the combat turn sequence, it seems to be resolving nicely, and tomorrow I'm going to try to start working on more of these special effects.

What else is going to be considered a Special? Well, there's another Protection Tree skill called Intercept, where I'd like to have the fighter character basically push his way past an ally to put himself into the line of danger in front of another party member. That's again going to need the app to handle some things that are outside the normal scope of a combat turn sequence (ie, moving characters out of order). An ability that teleports the character would probably fall into a similar bucket. Perhaps some sort of Fear effect, though that might be able to be done directly in an effect being applied (I honestly can't recall the code for that at the moment). Summons would be another Special ability certainly - bringing in some completely new thing into the combat. Spell-casting interrupts again, might be able to be handled via the normal code, but might also need a Special to make them work. The sky is the limit and I think it's going to be great getting all these weird things happening.

One more thing that made me laugh this evening. I was testing this code, and got one of my characters to pop some threat out with a Warcry, then basically high-tail it away from all the creatures, to make sure they were all going to then chase him as they should. He did so nicely, and two of the small spiders I was fighting against chased him between my other party members and attacked, exactly as they should do. Then it came time for the large spider to activate, and it was not able to squeeze between the party members due to it's size - so it started a longer walk around some rocky obstacles on the map. It got as far as it had movement to get, then suddenly I saw webs on my fighter... I thought something had gone wrong, quickly checked the ability... and breathed a sigh of relief. It does in fact have a range on it. Spiders have just always used it as part of a melee action. This one moved as close as it's movement would allow it, then threw the debuff at the right threat character - and later in it's next activation, closed the distance and went to town as normal. 

Utterly brilliant to see things starting to just work spot on.

Monday, May 20, 2024

Character Skills and Pre-Requisites

I'm only halfway through the code this evening, with an hour or two left still, but I'm tweaked the character skills code to correctly understand skill pre-requisites, so that the trees work nicely as they should. 

 I have some more work to do in the data itself, as I've only really started creating the skill trees, and I know a lot of the views will change, but this is also a great excuse to show off what the Fighter Protection tree is likely to look like - probably, about, maybe.

Obviously there will be some skills based on threat management for this character, but also a mix of Activated and Passive skills that increase the survivability of this class. I'm yet to code up the functionality, but there's also an intercept skill I'd like to throw in there, letting this character charge-in-front-of and/or yank-out-of-the-way a companion to protect them.

The work I'll be focusing on over the next little bit will be to get the code working for these funky abilities that have some sort of special behaviour, over and above the basic functionality that I have written up already. I'd like to, but probably won't work out how to have the game understand all these at the same time, so that if the player turns a character to be game-controlled it'll do all the right things as needed. Again, love to, probably won't get it done in stride straight off the bat.

More on skill trees, and a deeper look into individual abilities in the future.

Wednesday, May 15, 2024

Character and Item Stats

It feels like I've renamed a thousand thousand properties in classes, updated a myriad of methods across the database, the editor and the app itself today, but although it was hideously mind-numbing, it went by pretty quickly and without too many hassles. A few typos that were quickly resolved proved about the most challenging.

Anyways, enough whining, the awesome news is that character stats finally update nicely, along all the places that they should. I know there's a few more small things to add, but the lions share is there, and working exactly as it should be.

As you can see, the character screen for my intrepid fighter character, Melee and Ranged stats are there, as is his armor, defence and saves - and as I spent this evening adding fields for the affinity schools, there's not really items with those stats in the game yet, so I added the buff to his sword to test that the code functioned. It did.

Huzzah.
 

Tuesday, May 14, 2024

Items, Stats and Buffs

So, yesterday, I was rather sure that I didn't have code to remove effect stats from player characters - turns out I do, it's tucked away neatly into the same function that adds effect stats to them, which is actually a really good place for it to be. Past coder me was smort. I also didn't think I had a bit of code to recalculate stats for effects and auras as items were equipped and un-equipped. That part was true, but I whipped one up today, and it's now being triggered in all the places it should be. It's rather inefficient, recalculating everything anytime a character puts something on or takes it off, but you know, right now, I can deal with that - and it's not noticeable at all, so that's a "make elegant later" problem.

In bugs that I did find this evening, 'cause, of course there are those, items aren't quite right with Armor vs Defence ratings. Like I did say yesterday, originally there was only going to be one stat, and so I think I need to find a few places to add some extra class property modifications to. Other than that, I'm really nicely surprised, but even after a really long and tiring day at work, this is great progress - and again, although there's bugs here and there, things mainly, for the most part, and I don't want to jinx it - are working.

Monday, May 13, 2024

Stats and Buffs

As it seems to be always of late, I thought I would get onto a simple bit of code this evening. Where I'd left off yesterday was that skills that gave abilities with a passive effect (I'm currently playing with a defensive stance as a skill in the Fighter Protection tree) would give a default buff to the defensive value of that character.

So, picking up, I got into working on skills that grant the ability, and that in turn has a passive effect connected to it. There was a bunch of tweaking code and structures to get that quite the way I wanted it and working. Next issue was that waaaaay back when, when I wrote the editor interface code for Effects, I did it for Armor, and called it defence. Since then, the game has evolved - and I need both a defence and an armor stat. So sleeves up, I got stuck into that and eventually changed all the bits of code where they were needed to handle those nicely. Then changes in the app to handle the new data.

Great, so I can finally see one of my test characters with an extra defence stat.... no. More trouble-shooting and testing. Turns out I mucked up some double and integer calculations in what was supposed to be a simple buff calculation. With that fixed, lets check that statline. Nope. More bug fixing. More checks, more troubleshooting a few more times.

The last bug that I've found is a gem. When the characters are loaded from the server, the buffs are applied before all the item are equipped. So, when my character is loaded up, his defence is 30. The buff should grant him an extra 10%. So it's flagged as having a value of 3. But then, after all his items are equipped, his defence is over a 100. That buff needs to change.

That finally brings me about to my bug. I did write code that APPLIES a new effect to a character, but rather amusingly, I've not needed one to REMOVE an effect. All my test buffs and debuffs simply wear off and vanish. They stop ticking health onto the character, or doing some form of damage and that's that. I will need to write code that remove a buff, recalculates it, and pops it back on with new stats. I think that it's something I'll be calling a lot (like after each item equipped/removed, buffs granted and so on) - but that's a project for tomorrow.

Anyhow, feels like an awful lot of things fixed tonight, so that's great.

Sunday, May 12, 2024

Character Skills, Abilities and Passive Effects

I managed to get some nice coding time in this afternoon and evening and the great news is that I did a lot of work around character advancement today. I've got what seems to be a nice algorithm for characters advancing levels with steadily growing XP requirements and such. That seems to work nicely now, and is connected to how many points that character should have available top spend on both stat points as well as skill points. If you've got available points, it will show up in the relevant screens for you to spend. points that are spent increasing stats or buying skills will then be saved to the server nicely and loaded up properly next time you log in.

I spent some time (but didn't crack) passive skills and how I want them to add buffs to the player automatically as they are loaded in from the server. I'm too tired tonight to see if it's not working as things aren't loaded in the app at the time it is expecting them to be, or if there's something else going wrong. My guess is the latter, and I suspect that I'll need to tweak some structure to get it to where it should be. I sort of think it's mostly there, but glitchy.

Anyhow. Great progress again, and it's putting as smile on my dial as I see stuff coming together and starting to click into place more and more.

Monday, May 6, 2024

Character Advancement and Levels Progress

I took a different leaf from the book today and worked on character levels, namely character advancement. I've already got places to hook the code in when XP is granted, so it was simple enough to pop in some code there to check whether they had gained enough XP to tick them over - and if so, to give them more mod points to spend on traits.

The good news is that it worked amazingly well - and there's not really any bad news. There were a few teeny bugs for a moment as I patched into code that I hadn't touched for well over a year and I had to remember what things did, but that was quickly sorted and to my great relief (and ever so slight smug feeling) things "just worked".

I will see if I can update the Character Screen to open up "Add Mod Points" buttons when Mod Points are available - which will also tie off initial character creation, where I have those, but want to change it - the user interface is very clunky there.

Teleports & Location-Swaps working

A rather productive Friday evening it has been. I've managed to expand the code that deals with special combat events, and successfully ...