-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#1852] Allow for choosing a skill's ability on the character sheet #1854
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ather than during the intermediary roll dialog.
…s visually grouped with the skill name rather than the modifier.
b024649
to
d6bc18d
Compare
I feel like this makes the character sheet a tad too noisy - is performing the selection in the roll dialogue really not possible? Alternatively, could the chevrons be hidden until mouseover, or some other visual signal be used? |
It's of course possible since that's how it works currently. But it complicates our rolling pipeline, causing us to have to essentially re-prepare the roll again once the dialog is confirmed in case the ability used in the initial preparation changed. |
What preparation logic is carried out before the dialog is shown? |
The whole roll formula and all of its data are prepared before hand because it is needed in case the dialog is skipped and to display the proper initial values in the dialog itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to add the ability selection to the skill config dialog also.
So, just to make sure I understand this change correctly, what are the new workflows for:
|
You select the ability to use for the skill on the sheet, then roll it. There's no distinction between default or non-default, it will use whichever ability is currently selected when you click to roll it. |
Hm, then I feel like this is a case where code simplification is being done at the expense of user-friendliness:
|
Can you expand on this? Which part of the roll workflow is being split off, and which two dialogs are you talking about? |
We can (and probably should) add the ability configuration to the skill configuration dialog, Jeff made a similar comment. I recognise that this is a change to how variable ability skill rolls are performed, though I don't really agree with the implication that it's strictly less user friendly. It's just different, and it has different trade-offs. For example, having the ability selection in the intermediary roll dialog means that it's impossible to perform a fast-forward skill roll with a non-default ability. With this change, fast-forward and non-fast-forward rolls can both have a different ability selected in a consistent way. One other big point of contention I think I have is with the framing of the intermediary roll dialog as 'the skill check roll dialog'. It's titled as such, but this dialog is actually shared across all ability checks, saving throws and attack rolls, and it's intended for generic modifications to any roll. You'll notice that skill rolls are an aberration here with the option to change something specific like the ability modifier used. Finally, this feature to adjust the ability modifier used as part of skill checks is actually relatively new. There was no way to do this in the system before (via the UI). With the benefit of hindsight I believe this feature implemented in its current state would not have been approved in the first place (I was the one that approved it), given some of the tech debt it has incurred. So rather than removing the feature entirely, this PR is an attempt to retain it while also smoothing back out some of the wrinkles it has caused in our rolling pipeline. I'm open to any alternative proposals here that might solve this issue in a different way. |
Assuming this is off the table due to the associated technical cost and the fact that it does not address fast-forward rolls, do you have any additional suggestions? The only things I've been able to come up with currently are:
I think I'd only consider (2) if it could be implemented cleanly, and there are some additional UX considerations that come with that option. |
DDB does so by changing the color of the skill to blue. What if there were keybinding shortcuts for resetting the skill's ability to default? However just having option (2) seems like a decently clean solution that mostly satisfies everyone. |
So, I initially wrote up a long-winded reply explaining what my observations, areas for code improvement, etc. If you still want me to give that, I can, but after writing it all out, I figured it might be better to just get straight to the point. The root of the problem here is that the roll customization dialogue is created rather late in the skill check process, because it's tied to the So why not extract this logic out? From what I can see, the primary purpose of the Splitting this dialogue logic out would simplify both the D20Roll class and the Just to be clear, I'm not against a default ability selector in a skill's configuration dialogue (which would impact fast-forwarded rolls); I'm against placing them directly on the character sheet, then indicating to users that the selectors are suitable for one-off rolls. *with some exceptions |
I'm trying to understand how factoring out the dialog code would solve the core issue of having to re-prepare the roll data if the ability used changes halfway through the roll process. Are you suggesting that we move the dialog to the start of the process in some way? So we immediately check the click event for whether the roll is fast-forwarded or not. If not, we display the dialog first, then do roll preparation after, or if the roll was fast-forwarded we skip the dialog and go straight to roll preparation? I think it would work but it would mean that we cannot show a preview of the actual bonus values in the dialog. I think it's also quite a disruptive change to the roll workflow that I suspect will break a lot of modules. I won't discount it for that but I think it would mean that we don't do this in 2.1. |
…some now-redundant code.
Yes. As I see it, the
Just to make sure I'm understanding things correctly, where is the re-preparation is being done? Do you mean the logic in |
Yes, We then have to splice the bonus back into the partially-resolved |
Yeah, I definitely feel like this is due to misplaced responsibilities. The The broader idea here is to invert the control flow. Instead of having the In pseudo-code: function rollSkill(...) {
if (fastforward) {
let roll = new SkillRoll(data, options)
} else {
// Could also be a regular function, `skillRollfromDialog(...)`
let roll = await SkillRoll.fromDialog(data, options)
}
return roll.evaluate()
}
class SkillRoll extends D20Roll {
dialogueFunction = (data, options) => {
// Create the dialog, then when it closes, return the roll it constructed.
const dialog = new SkillRollDialog(data, options)
const roll = await dialog.render(true)
return roll
}
constructor(data, options) {
// Assemble skill roll formula and terms.
...
}
static async fromDialog(data, options) {
await this.dialogueFunction(data, options)
}
}
class SkillRollDialogue extends FormApplication {
async _onChangeInput(event) {
// Or whatever method is called when a from field is changed.
// Update the roll, then re-render the dialogue to display the new roll.
this.roll = new SkillRoll(this.data, this.options)
await this.render(true)
}
} As a side benefit, this greatly reduces the the complexity of the current rolling logic, since features like "Elven Accuracy", etc. aren't being handled in multiple places by multiple functions. |
Yeah, bringing the dialog forward in the pipeline would work. Even if we do that though, the experience for fast-forward rolls isn't as good: You have to open the skill dialog, change the ability score, close the dialog, then make the roll. It erodes any of the time-saving you might have wanted from fast-forwarding the roll in the first place. So while I understand the concern that the proposal in this PR might make things worse for non-fast-forward rolls, I'm not sure that overall it's a strictly worse design. Ideally we'd have a solution that has the best of both worlds. Either way, I think this has to be parked for now as it has been taking too long and we have other priorities to get to in 2.1. |
I guess I don't quite see why this needs to be implemented for fast-forward rolls. To me, the whole point of the fast-forward process is to say, "I'm ok with the defaults, and have no need to customize them for this roll". |
100% agree and I think it should be the logic in general when it comes to fast forward roll to use the default preset settings. Possibly external modules such as https://github.com/misthero/dnd5e-custom-skills can allow you to prepare multiple versions of the same skill and "customize" the fast forward rolls. |
Unblocks #1760 & #1650