applied skills vs. applied keywords
march 24, 2022
#skill
monitoring skills
In Blessfrey, entities like to know where effects come from.
For one, knowing the source of a killing blow allows for cute little feedback like the Binding of Isaac's death screen.
More importantly, it allows mechanics to interact more freely. If the bleeding status effect on a character is linked with the Cat Scratch skill, used by Bad Cat, that opens up possibilities. Maybe there could be a skill that reflects target's status effects back unto the original dealer. Maybe there could be an effect that negates skills from animal sources. Maybe a skill could heal an ally for even more you are both suffering from the same skill. The source is important if I want to do anything beyond the basic "cure bleeding."
how should the data be bundled?
Skills themselves contain keywords, references to the user and target, and any data that could possibly be needed. It's immediately obvious to just directly tack the still onto the back of an array on the target. It can never be that easy, though. Skills contain keywords, all of which have different durations and aren't necessarily in the tree at the same time. Also, there's not a lot of applications for cycling through all the applied skills, besides making something like Guild Wars's effects monitor and damage monitor.
There aren't a lot of cases where the game would be looking to remove any instances of "Cat Scratch." However, there would plenty of skills looking to remove bleeding or status effects.
It's a more direct approach to treat keywords and skills separately in the code. Characters can keep an array with references to the applied keywords instead of applied skills. The other data can be bundled with it as an array: [keyword, source, [tags]].
The keyword is the important part because, in bleeding's case, it's the main culprit for the actual health degeneration of the character. It also has its own duration, so there's no conflicts with holding onto bleeding even if all other keywords from its skill expiring. The source is just a noncommittal reference, so it and its data can be accessed as needed. Maybe the keyword and skill contain everything needed, but I'm going to pull out some frequently accessed attributes into tags to see if that helps with efficiency.
it'll be better this way
It's always a good idea to separate keywords from their governing skill. When skills and keywords are decoupled, each can run their course without interference.
Last updated April 7, 2022