Replies: 6
The goal of this post is to share my first attempt at creating a combat simulator that will estimate DPS given a specified ability rotation. I’m not a programmer by any means so my method with most likely come across as really naïve. I appreciate any suggestions to improve the process and any other comments on how this could be made more useful since at the moment, it is sort of theoretical and I’ve not figured out a really good practical use of it yet nor is it very accurate.
I used Matlab to simulate combat. My code is pretty messy at the moment so I’ve chosen not to share it publically yet but if you’re interested in taking a look just send me a PM. At the moment, I’m only tracking Target Health and Caster Magicka.
Acknowledgements
A special thank you to addon developers that have aided tremendously in my understanding of game mechanics in particular @Atropos for FTC, @SpellBuilder for LUI, @Kith for Srendarr, @Coolmodi for MitigationPercent and TemplarExecute. Thank you to @Nifty2g and @AfeliaHeart for help with testing. I would also to extend my gratitude to the community, especially that of TamrielFoundry, for the kind support and valuable discussions.
How it works
The combat simulator takes an ordered list of abilities and executes them in order. An example list is shown below.
[img] https://i.gyazo.com/77d4ce615a93e6b166fcb010ed658117.png [/img]
Going from left to right, the table includes:
- Ability Name
- Magicka Cost
- Current cooldown of the ability
- Maximum cooldown of the ability
- Time it takes to execute the ability with a LA weaved in
- Number of hits the initial does
- Damage of the initial hit
- Damage of the woven in LA
- Period of the DoT if it is a DoT. Channelled Focus is considered a DoT but it’s ‘Damage’ goes to Magicka
- The duration of the DoT.
- The damage that each tick of the DoT does
The first ability with a zero under Current Cooldown is selected as the highest priority ability and executed. The abilities Current Cooldown is then set to the Cooldown. Note that the cooldown of an ability may differ from the DoT duration of the ability. In the table above, I’ve set the Cooldown of Purifying Light to be 8 seconds even though the ability only last 6 seconds because I wanted it to synchronise with Elemental Blockade for my testing. Ability Cooldowns are obtained by casting the ability repeated (with LA weave if appropriate) and recording the time taken with another script. The Cost of abilities is just the value from the tooltip. The Damage and DoT damage can either be calculated or just observed in game. The Execution Time is the duration where another ability cannot be used.
Once the highest priority ability is chosen, damage calculation for the woven LA, if appropriate, and the initial hit is calculated. For damage calculation, a random number is obtained and if it below the critical chance, critical damage occurs otherwise the base damage is done to the target. In the example, all the abilities are DoTs with no initial damage (that is not a DoT). If an ability is a DoT the last three columns is added to a DoT table that manages when DoTs deal damage. Channelled Focus is added to a magicka recovery table that determines when to recovery magicka.
After resolving the highest priority ability, I process through the DoT table. That is to say, if any DoTs in the DoT table are meant to deal damage, damage is calculated. Similarly I have a magicka recovery table that executes after the DoT table. Finally, the next tick to calculate is determine by determining the minimum of the time to next ability (related to Execution Time), time to next DoT tick or time to next magicka recovery tick.
This procedure is repeated until the target health reaches zero.
Example 1 : Magicka Templar
To test whether my combat simulator is working I’ve used the ability table shown below:
[img] https://i.gyazo.com/77d4ce615a93e6b166fcb010ed658117.png [/img]
In words, the very simple test rotation here is to cast Channelled Focus followed by Elemental Blockade and Purifying Light. Puncturing Sweep is casted (4 times) until Elemental Blockade expires and then Elemental Blockade and Purifying Light are reactivated. After 3 Elemental Blockades rotations have been performed, Channelled Focus is re-casted. The duration of Channelled Focus is taken to be 26 seconds which is the sum of the actual skill duration (18 seconds) and the duration that the magicka return last once the skill fades (8 seconds). I’ve chosen to only renew Purifying Light after Elemental Blockade to allow an easier testing rotation and ensure that the maximum tooltip damage of Purifying Light is achieved. Solo testing was done on Slimecraw in Normal Wayrest Sewers. The damage values are the observed damage done on Slimecraw with Minor Sorcery active. Major Sorcery was not used. While LA should be boosted when Elemental Blockade is active (I was using a Maelstrom staff), I found that my LA was not consistently boosted because I had to keep running circles around Slimecraw to prevent his knockback cone so the LA damage is with Minor Sorcery but is not buffed by Elemental Blockade/Maelstrom staff.
For completeness, though it is probably not very important, I’m using five pieces of Twice-Born Star, 2 pieces of Valkyn Skoria, 3 pieces of Willpower (Jewellery with Spell Damage enchants) and a Precise Maelstrom staff. All abilities except for Channelled Focus is on the Staff bar. Channelled Focus is on my back bar which has two Torug swords.
Using my combat simulator, I have ran 10000 simulations. For each simulation, I record the Target Health as a function of time, Magicka as a function of time and a Combat Report which is sort of similar to the Combat Report in FTC. Each simulation takes me around 0.15 seconds, the entire 10000 simulations took approximately 25 minutes. Below you can see graphs of Target Health and Magicka as a function of time for the last simulation, as well as a Combat Report.
[img] https://i.gyazo.com/00a153e61e877ca688eb1eadbb3a4041.png [/img]
The graph of Magicka vs Time is pretty straightforward, the magicka recovery ticks every 2 seconds is pretty obvious and a smaller increase every 0.5 seconds due to Channelled Focus is observed.
[img] https://i.gyazo.com/b91b67761b374402fae08e1f698f232a.png [/img]
The key feature in the Target Health vs Time is the drop every ~9 seconds which corresponds to when Purifying Light goes off.
[img] https://i.gyazo.com/90ee100b759e8df9d715c25d3bf8eaae.png [/img]
For each simulation we can plot the DPS obtained for that run or more informatively a histogram can be created. A large number of runs end with Purifying Light going off hence the large central spike in the histogram.
[img] https://i.gyazo.com/7d0f540e3deb0c509b37b0ff052f7849.png [/img]
[img] https://i.gyazo.com/0aa37470d806f8d5f587f6e8990bffc6.png [/img]
While simulations are all pretty cool, undoubtedly some of you will want some actual comparison to actual parses and I could not disagree. Here is an example of me doing the test rotation on Slimecraw in Normal Wayrest.
(Note: I couldn’t figure out how to embed a video. Any help would be appreciated! )
And the accompanying Damage Report
[img] https://i.gyazo.com/4b0c384bf3c9f510373c5d5116ebb0e6.png [/img]
At the moment, my combat simulator does not take into account Burning Light, Valkyn Skoria’s Wrath, or Burning so my DPS from this example is approximately 13718. This is about a thousand lower than the central peak in the simulation DPS histogram. I’m not sure if this was an unlucky test or whether there is something fundamentally wrong about my assumptions. Or perhaps I’m expecting too much accuracy. In my mind, I thought I would get an error of less than a thousand.
It is noteworthy that I end the fight at about 15k Magicka which is in reasonable agreement with the simulation where I end at around that amount of Magicka.
Future Plan
I would like to get a few more parses on Slimecraw but getting a sufficient number to get a histogram would take a long time and I might not be sufficiently motivated to do that. While I don’t have too many practical ideas of how to use the combat simulator yet, I plan to test my theory of when to use Radiant Execution as discussed previously in [Thieves Guild PTS 2.3] Execution of Radiant Oppression. Also I hope to include more mechanics in particular Burning Light and Molag Kena. I would appreciate any ideas on how a combat simulator could be used to answer some theorycrafting questions.
-
This topic was modified 1 month ago by
Asayre.