Skip to content

Commit

Permalink
Merge pull request #616 from FFXIV-CombatReborn/lecture1
Browse files Browse the repository at this point in the history
spelling, grammar i forgot to hit save
  • Loading branch information
CritoCantCode authored Feb 13, 2025
2 parents c67b8b9 + 78321ce commit cdd1bc0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions new_docs/RSRDemystified.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# A Lecture on How RSR Does What It Does, Demystification
# A Lecture on How RSR Does What It Does: Demystified
## Rotation Solver Reborn (RSR) in Brief, Purpose

Hopefully you know that Rotation Solver Reborn (RSR) is a Dalamud plugin for FFXIV that assists users in performing rotations. By default, the plugin makes a best effort attempt to provide an optimal action choice for the user, but also provides the ability to be shown the action instead of performing it itself. How RSR makes this determination is the core purpose of this document. This may assist you in understanding why RSR does what it does. I will only be using pseudocode examples throughout this document, and trivializing some portions of the program for the sake of brevity and neccessity. Any asterisks you see are indications of such leaps.
Hopefully you know that Rotation Solver Reborn (RSR) is a Dalamud plugin for FFXIV that assists users in performing rotations. By default, the plugin makes a best effort attempt to provide an optimal action choice for the user, but also provides the ability to be shown the action instead of performing it itself. How RSR makes this determination is the core purpose of this document. This may assist you in understanding why RSR does what it does. I will only be using pseudocode examples throughout this document, and trivializing some portions of the program for the sake of brevity and necessity. Any asterisks you see are indications of such leaps.

## RSR is Not Smart

If you do not have a strong understanding of programming - or, if you are lost in the current AI wave - then you might be under the impression that RSR is somehow making strategic decisions (considering all known and *quid sit* quantites to come to a determination that will benefit the user) when in reality it is making prescriptive choices. It does not decide anything. Let's get into the anatomy of that which is the primary concern of the average reader: the rotation.
If you do not have a strong understanding of programming - or, if you are lost in the current AI wave - then you might be under the impression that RSR is somehow making strategic decisions (considering all known and *quid sit* quantities to come to a determination that will benefit the user) when in reality it is making prescriptive choices. It does not decide anything. Let's get into the anatomy of that which is the primary concern of the average reader: the rotation.

During this section I will be building out a diagram of RSR's "brain" using the Default Machinist Rotation as my running example.

## The Anatomy of a Rotation
It is first worth getting out into the open that, in the simplest of terms, RSR does what it does because a human told it too. It does these things based off the following:
It is first worth getting out into the open that, in the simplest of terms, RSR does what it does because a human told it to. It does these things based off the following:

### The GCD / Ability Loop
As a FFXIV player you should understand that there are two kinds of actions: spells/weaponskills (GCDs) and abilities (oGCDs). It should be further understood that putting oGCDs inbetween GCDs is called "Weaving." You generally do not want to use more than 2 oGCDs per GCD. Let's piece together the first layer of our RSR brain diagram.
As a FFXIV player you should understand that there are two kinds of actions: spells/weaponskills (GCDs) and abilities (oGCDs). It should be further understood that putting oGCDs between GCDs is called "Weaving." You generally do not want to use more than 2 oGCDs per GCD. Let's piece together the first layer of our RSR brain diagram.

```mermaid
stateDiagram-v2
Expand Down Expand Up @@ -104,11 +104,11 @@ MCH_Default : MachinistRotation {
}
```

Again, quite simple. A human could read down this list and follow these orders. If you can press Reassemble, press it. If you can't, press SplitShit. If you can't press SplitShot (say, because it's cool down), press Ricochet. If you can't press Ricochet, press GaussRound. If at any time you succeed at pressing one of the buttons, return to the top.
Again, quite simple. A human could read down this list and follow these orders. If you can press Reassemble, press it. If you can't, press SplitShot. If you can't press SplitShot (say, because it's cool down), press Ricochet. If you can't press Ricochet, press GaussRound. If at any time you succeed at pressing one of the buttons, return to the top.

That means our Machinist, as written, would use Reassmble twice (wasting one charge) then use SplitShot. Skip Reassemble (no charges), skip SplitShot(GCD is cooling down), and use Ricochet. Right back down the list, and use Ricochet again. Then SplitShot, then Ricochet, then GaussRound because it skipped over the still cooling down Reassemble, SplitShot, and out of charges Ricochet.
That means our Machinist, as written, would use Reassemble twice (wasting one charge) then use SplitShot. Skip Reassemble (no charges), skip SplitShot(GCD is cooling down), and use Ricochet. Right back down the list, and use Ricochet again. Then SplitShot, then Ricochet, then GaussRound because it skipped over the still cooling down Reassemble, SplitShot, and out of charges Ricochet.

Not a great rotation. However, one of the final missing pieces is the intricate web of logic that goes into a much more ffective rotation. Everything before this point should be enough to demystify how RSR works from an end user rotational point of view. There is no magic, there is no AI at work. It is simply a recipe of can I do it, and if not, what can I do next instead?
Not a great rotation. However, one of the final missing pieces is the intricate web of logic that goes into a much more effective rotation. Everything before this point should be enough to demystify how RSR works from an end user rotational point of view. There is no magic, there is no AI at work. It is simply a recipe of can I do it, and if not, what can I do next instead?

### Logic and Conditionals
What gives the facade of a higher order of intelligence over a simple recipe is the amount of work the rotation author does or does not put into the rotation. A rotation that will clear normal, simple content could be quite normal and simple. A rotation that performs at a level useful in EX+ is much more complex. Consider the following:
Expand Down Expand Up @@ -156,15 +156,15 @@ MCH_Default : MachinistRotation {
}
```

You can see from the brief expasnion of pseudocode above that there is a mixture of limited, simple, and multifaceted logic. This example here being a greatly parred down MCH rotation from what is live. Such rotations and logic are built iteratively and based off the experience or research of the author. This also doesn't include the settings that live within the rotation file either.
You can see from the brief expasnion of pseudocode above that there is a mixture of limited, simple, and multifaceted logic. This example here being a greatly pared down MCH rotation from what is live. Such rotations and logic are built iteratively and based off the experience or research of the author. This also doesn't include the settings that live within the rotation file either.

### A note on the Interface versus the Mechanism
When it comes to writing rotations the author will generally be interacting with something that can be referred to as an Interface. Not to be confused with a UI; an Interface in programming is a layer intended to be used by another programmer for purposes of extending the capabilities of that program. The rotations that you can find in #3rd-party-rotations in the Discord are examples of authors producing rotation files that use this Interface. It standardizes what the author can write and interact with. It also remvoes the need for the author to build the entire plugin from source.
When it comes to writing rotations the author will generally be interacting with something that can be referred to as an Interface. Not to be confused with a UI; an Interface in programming is a layer intended to be used by another programmer for purposes of extending the capabilities of that program. The rotations that you can find in #3rd-party-rotations in the Discord are examples of authors producing rotation files that use this Interface. It standardizes what the author can write and interact with. It also removes the need for the author to build the entire plugin from source.

What is my point here? You see in the pseudocode above where it says `MCH_Default : MachinistRotation`? This is telling us that MCH_Default is our rotation - our interaction with the Interface - and it is sitting over the MachinistRotation "Mechanism." Which the moment you cross that colon into the Mechanism you get into the guts of the RSR machine. Things like the targetting system, the conditional system, all the little lights and switches you can flick throughout RSR. This is the beast that is contended with when a question outside of things like "why does the dragoon dot wear off?" go.

## Final Thoughts
If you made it this far I want to thank you for taking the time to read, or at least skim through the content I've written here. As always this document is only as good as it is young, so there will be drift in time. Further, espcially there at the end, I hope it inspires you to consider writing rotation content for RSR. While it may seem pretty big at first I gaurantee you rotation writing is only as complex as you make it, and potentially a good way to get into coding if you haven't before. I might even produce a series on how to get started some day. Or I might not, that's the beauty of RSR.
If you made it this far I want to thank you for taking the time to read, or at least skim through the content I've written here. As always this document is only as good as it is young, so there will be drift in time. Further, espcially there at the end, I hope it inspires you to consider writing rotation content for RSR. While it may seem pretty big at first I guarantee you rotation writing is only as complex as you make it, and potentially a good way to get into coding if you haven't before. I might even produce a series on how to get started some day. Or I might not, that's the beauty of RSR.

Take care and remember someone has to press all these buttons,

Expand Down

0 comments on commit cdd1bc0

Please sign in to comment.