Skip to content
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

raidboss: updates to UCOB #5395

Merged
merged 11 commits into from
May 27, 2023
Merged

raidboss: updates to UCOB #5395

merged 11 commits into from
May 27, 2023

Conversation

wexxlee
Copy link
Contributor

@wexxlee wexxlee commented May 20, 2023

Added some additional triggers for tank cleaves/busters, some minor cleanup, and new triggers for QM, Blackfire, Heavensfall, and Grand Octet. Also added clockwise/counterclockwise to resources/outputs, since it tends to come up reasonably often.

Copy link
Owner

@quisquous quisquous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all these updates! I've got a few small comments here and there, but nothing major.

ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts Outdated Show resolved Hide resolved
ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts Outdated Show resolved Hide resolved
ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts Outdated Show resolved Hide resolved
ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts Outdated Show resolved Hide resolved
ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts Outdated Show resolved Hide resolved
let bahaDirIdx;

for (const mob of data.combatantData) {
const mobDirIdx = Math.round(4 - 4 * Math.atan2(mob.PosX, mob.PosY) / Math.PI) % 8;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this positionTo8DirOutput?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

positionTo8DirOutput returns the direction name from dirNumToName, but we actually need the array index (or, more precisely, the direction number), because we use the direction number in naelDirIdx and bahaDirIdx to calculate the safe spot (based on opposite-Bahamut, possible adjustment for Nael).
If we wanted to use positionTo8DirOutput here instead of directly calling Math.atan2, we could grab the direction name, but then we'd have to do an indexOf lookup to get back to the direction number, which feels clunky.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an aside, given that we seem to use relatively common variants of positionTo8Dir now in various fights, perhaps these (and, optionally, their 4Dir and 16Dir variants?) would be good candidates to add to a function library, so we're not repeating this each time? If you agree, I'd be happy to submit a PR, but not sure where would be the right place for them to live.

Copy link
Owner

@quisquous quisquous May 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it'd be better to have positionTo8Dir instead of positionTo8DirOutput and you could look up from there and use it in all places? Personally I think it's fine to re-do the number=>string lookup, but the math part would be nice to keep in one spot.

Agreed that it'd be good to put these in common locations. I think a good common location could just be util.ts. We could make some new file for "common raidboss functions" or "raidboss helpers" too (since watch combatants might be a better fit in there than util). One problem is that a couple of fights have conflicting ideas of what 0 means (there's like ~2-3 that want to have 0=NW and most are 0=N) and so those would need to be refactored/renamed as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Let's pause this PR for now, and I'll open up a new one to add some functionality to util. If & once you're good with it and land it, I can revise this PR to use the new functions and then do a follow-on PR for the other fights.

ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts Outdated Show resolved Hide resolved
ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts Outdated Show resolved Hide resolved
ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts Outdated Show resolved Hide resolved
@wexxlee wexxlee marked this pull request as draft May 22, 2023 02:16
@wexxlee
Copy link
Contributor Author

wexxlee commented May 22, 2023

Marking as draft for now to work on landing some position-related stuff to util.ts.

quisquous pushed a commit that referenced this pull request May 24, 2023
@quisquous Per our discussion on #5395 / discord, here's some
direction-related helpers to be added to `util.ts`.

I opted to export all of the functions in a single `Directions` object,
rather than to export each function individually. Let me know if you'd
prefer to have them live in `Util{}` or some other preference.
github-actions bot pushed a commit that referenced this pull request May 24, 2023
…lpers (#5402)

@quisquous Per our discussion on #5395 / discord, here's some
direction-related helpers to be added to `util.ts`.

I opted to export all of the functions in a single `Directions` object,
rather than to export each function individually. Let me know if you'd
prefer to have them live in `Util{}` or some other preference. 0c55ccc
@wexxlee wexxlee marked this pull request as ready for review May 26, 2023 16:07
@wexxlee
Copy link
Contributor Author

wexxlee commented May 26, 2023

@quisquous This is now updated to use the new Directions helpers from util.ts and should be ready for re-review (I think that was the only remaining open issue).

After some further thought, I moved the three arrays of output strings (output8Dir, outputCardinalDir, and outputIntercardDir) into Directions, rather than keeping them as separate exports. It avoids having messy/long imports in the specific fight files and in user_config.ts, and I couldn't really think of a good reason to keep them separate.

export type DirectionOutput8Map = { [key in DirectionOutput8]: OutputStrings };
export type DirectionOutputCardinalMap = { [key in DirectionOutputCardinal]: OutputStrings };
export type DirectionOutputIntercardMap = { [key in DirectionOutputIntercard]: OutputStrings };
export type DirectionOutput16Map = { [outputString: string]: OutputStrings };
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last change request for me is that I don't know that these types are that useful anymore. It'd probably be worth just moving the { [outputString: string]: OutputStrings }; down to the various output8Dir types, e.g. const output8Dir: { [outputString: string]: OutputStrings }; = [ and removing these exports at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... I liked the idea of explicit typing, but it didn't hold up when it came time to actually use them in the outputStrings{} in triggers. Alas.

I do think it's worthwhile still to keep the explicit typing on the lookup arrays (e.g. output8Dir: DirectionOutput8[]), but I agree it makes sense to remove them on the outputStrings objects like you suggest. If that works for you, this is good to go.

@quisquous quisquous merged commit c231d22 into quisquous:main May 27, 2023
@quisquous
Copy link
Owner

Thanks for all the changes and the helper functions!

github-actions bot pushed a commit that referenced this pull request May 27, 2023
Added some additional triggers for tank cleaves/busters, some minor
cleanup, and new triggers for QM, Blackfire, Heavensfall, and Grand
Octet. Also added clockwise/counterclockwise to resources/outputs, since
it tends to come up reasonably often. c231d22
github-actions bot pushed a commit that referenced this pull request May 27, 2023
Added some additional triggers for tank cleaves/busters, some minor
cleanup, and new triggers for QM, Blackfire, Heavensfall, and Grand
Octet. Also added clockwise/counterclockwise to resources/outputs, since
it tends to come up reasonably often. c231d22
github-actions bot pushed a commit to SiliconExarch/cactbot that referenced this pull request May 27, 2023
Added some additional triggers for tank cleaves/busters, some minor
cleanup, and new triggers for QM, Blackfire, Heavensfall, and Grand
Octet. Also added clockwise/counterclockwise to resources/outputs, since
it tends to come up reasonably often. c231d22
github-actions bot pushed a commit to SiliconExarch/cactbot that referenced this pull request May 27, 2023
Added some additional triggers for tank cleaves/busters, some minor
cleanup, and new triggers for QM, Blackfire, Heavensfall, and Grand
Octet. Also added clockwise/counterclockwise to resources/outputs, since
it tends to come up reasonably often. c231d22
@wexxlee wexxlee deleted the ucob-changes branch June 15, 2023 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants