56 lines
6.9 KiB
Plaintext
56 lines
6.9 KiB
Plaintext
<!--210610,200429-->
|
|
<h1>skills aren't a manor; they're the DMV </h1>
|
|
april 7, 2022<br>
|
|
#gamedev #gamedesign #skill <br>
|
|
<br>
|
|
<h2>designing on autopilot </h2><br>
|
|
Phases are necessary for skills to be reactive. For instance, take Blessed Purity: <i>Cure 2 poisons from target. Heal for 35 per poison removed</i>. So the Cure keyword comes first, and Heal cannot activate until the Cure phase resolves. To lay out these phases, I partially copied Guild War's skill effects without much thought: <a href="https://wiki.guildwars.com/wiki/Initial_effect">initial effect</a> -> main function (not sure if there's even a name for this) -> <a href="https://wiki.guildwars.com/wiki/End_effect">end effect</a>. Most keywords are thrown into the main phase, anything that needs to happen immediately goes in initial, and anything that happens at the end goes in the end. <br>
|
|
<br>
|
|
Naturally, I had a lot of problems with flow. Some keywords (like Bleeding) can last up to half a minute, while others (like Attack) are executed instantly. When I let the skill run without breaks, the end effect executed long before earlier keywords finished up. When I forced keywords to execute one at a time, I had projectiles that awkwardly stuck around until an unrelated keyword timed out. <br>
|
|
<br>
|
|
It's time to actually turn my brain on and design with diagrams. <br>
|
|
<br>
|
|
<br>
|
|
<h2>building the skill like a manor</h2>
|
|
<a target="_blank" href="/static/img/ent/skillsarentamanor_SkillManor.png">
|
|
<img src="/static/img/ent/skillsarentamanor_SkillManor.png" alt="(diagram: Imagine the entire skill is a manor. The main phase is the main building, while the initial and end phases are additional wings. Within each section are rooms (or keywords). The entry and exit point of the keyword room are conditional statements. The space between wings represents the arbitrary entry and exit points of phases.)">
|
|
</a><br>
|
|
If a skill was a manor, phases would be wings, keywords would be rooms, and doors would represent conditional statements. There are three main sections to stand in for the beginning, middle, and end. It makes sense if you don't really think about it. After all, the flow looks so clean and linear. <br>
|
|
<a target="_blank" href="/static/img/ent/skillsarentamanor_SkillManorFlow1200.png">
|
|
<img src="/static/img/ent/skillsarentamanor_SkillManorFlow1200.png" alt="(diagram: All initial keywords activate in order, the initial phase is complete, all main keywords activate, phase complete, same for end keywords and effect.)"></a> <br>
|
|
<br>
|
|
<h2>criticism </h2>
|
|
The concept of a phase brings nothing to skills. In Blessfrey and even Guild Wars, "initial effect" and "end effect" are used more like conditions than integral structure. The majority of skills don't operate in phases anyway. <br>
|
|
<br>
|
|
Worse, my careless implementation runs every keyword sequentially, undermining any distinction phases had. There's zero difference between putting Cure in initial or in the first line of main. <br>
|
|
<br>
|
|
Some keywords need to know what skill they belong to, what skill other keywords belong to, and who their user and target are. The poorly understood flow of skills sometimes causes this information to be freed with the skill before it's needed. <br>
|
|
<br>
|
|
<br>
|
|
It makes me wonder what a phase even is. I can't label the boundaries of the phase in the diagram because it's so arbitrary. Do skills need phases at all? <br>
|
|
<br>
|
|
Keywords already have all the structure they need built into them. Keywords lock their effect behind an entry condition (like curing a poison) and guard the exit with another condition (like a duration of 30 seconds). It would make more sense if end effect keywords instead listened for the resolution of given keywords, while all other keywords are free to fire off simultaneously. <br>
|
|
<br>
|
|
<br>
|
|
<h2>skills should feel like going to the DMV</h2>
|
|
DMVs in my life have been all-day affairs of standing in lines that stretch around the building through the bad part of town, attended by only one service desk. Honestly, that's not too far off from my original skill design. I'm not referring to <i>those</i> DMVs, though. The new DMV in town is much more efficient, lets you sit as you wait, and (novel concept) has multiple service windows. That's a much better model for my skills. <br>
|
|
<a target="_blank" href="/static/img/ent/skillsarentamanor_SkillDMV.png">
|
|
<img src="/static/img/ent/skillsarentamanor_SkillDMV.png" alt="(diagram: The skill's DMV has an entry point that leads to the welcome kiosk where each keyword must register its trigger and exit cue. All keywords wait in the same waiting room. Whenever the DMV calls a trigger (like health below 33%), that keyword will be actively served by a clerk until satisfied.)"> </a><br>
|
|
<br>
|
|
Since my "DMV" will be a separate entity from the skill (basically an <a href="https://www.blessfrey.me/diary/entries/210402">event handler</a>), it can preserve its data as long as needed, even after the main skill script dies. Flow is also more controlled, since the skill cannot progress its own current state. <br>
|
|
<br>
|
|
As for flow, obviously, skills without triggers can fire off immediately. The DMV will connect to the <a href="https://www.blessfrey.me/diary/entries/210402">KnowledgeBase</a> and begin listening for any event topics that would trigger the keywords. Once a keyword's conditions are met, it will become active and be applied to the target. The DMV also sets up a timer for its duration or listens for exit cues to know when to remove the keyword. Some keywords will never activate, but they will be freed once they had their chance. If Blessed Purity cures 0 poisons, heal will receive a sad "0" and die quietly. <br>
|
|
<br>
|
|
Under the DMV model, the skill's flow becomes more circular. <br>
|
|
<a target="_blank" href="/static/img/ent/skillsarentamanor_SkillDMVFlow1200.png">
|
|
<img src="/static/img/ent/skillsarentamanor_SkillDMVFlow1200.png" alt="(diagram: Each keyword registers triggers and exit cues with the DMV. The DMV subscribes to the topics and listens for triggers and exit cues. A trigger is received and conditions are met, so the keyword becomes active. The keyword is applied. The removal conditions are met, so the keyword is freed. The DMV continues to listen until all keywords had their chance to activate.)"></a> <br>
|
|
<br><br>
|
|
<h2>superior design? hopefully </h2>
|
|
Never thought I'd prefer the DMV, but you can learn design concepts from anywhere. This design is far more complex to implement, but it's the first design that allows me to build skills from conditional keywords that trigger simultaneously or in any particular order. I'll finally be able to add the skills I have in my head. It'll take a lot of time and work, but can't wait to get this up and running. <br>
|
|
<br>
|
|
Anyway, if you're doing anything on autopilot, especially designing the core mechanic of your game, stop immediately! A little foresight and I'd be leagues ahead by now. Or maybe not? Probably. <br>
|
|
<br>
|
|
<br>
|
|
Last updated April 7, 2022
|
|
<br>
|