Tuesday, October 28, 2025

Game Controlled Characters and Logic

A while back, I posted that I'd done a bit of tweaking on game controlled settings and being able to set up characters to fight automatically using the same logic that monsters have - and I circled back to that, firstly by adding a toggle on the character screen to set each character to be game controlled (it was previously available in the game settings).

I also then updated the game server and database to be able to save that data, so if you set characters to be automatically controlled, they'll stay that way until you change them back.

With that done, I finally decided to sift through the code to work out why my healer was casting healing spells on the monsters I was fighting - while my other characters were doing their thing successfully. And that led me down a rabbit-hole of bugs and almost correct logic - as well as a bunch of abilities and effects that had slightly incomplete data. As I'd created a bunch of this data (and all the editor logic associated with them) a long time ago, I would generally add some functionality and then test it with the newest function available, or the monster that used it - that sort of thing.

So it turns out that some of the game abilities and effects didn't have quite all the information that they needed for my code to function. One of these was a flag "intended for enemies" which tells the character or monster if this particular ability should be used on its friends, or its foes. My editor defines that as a new field from the target selection values. But it was added after I'd already added a bunch of effects - like the healing spell my caster was throwing about.

So..... I've not gone back and updated all the effects and abilities in the game, and I think that added all the information that they needed, which then let me get into the code properly to see what was happening during the selection processes.

And wouldn't you know it, turns out there were some logic gaps there too. Not massive fall-through-the-cracks ones, but things were just wrong enough to look like they were working, when in fact they were doing the wrong things. Amusingly, in monsters, who generally only have one or two abilities, this was much less noticeable. Anyhow. I think they're all fixed nicely now - you know, until I find something else that's going wrong.

I think I'll add in a more detailed selection on how you'd like the game to play your characters - after all, I already have that logic built in for monsters, and it's just a few dropdown selectors away.
 

No comments:

Post a Comment

Game Controlled Characters and Logic

A while back, I posted that I'd done a bit of tweaking on game controlled settings and being able to set up characters to fight automati...