Feb 10, 2010 at 4:57 PM
Edited Feb 10, 2010 at 5:18 PM

I've been using EnhSim alongside RAWR for a long time. Due to changing raid/guilds, I'm now playing as elemental.

I plan to make changes to Enhsim and Rawr to support this. Mostly this is changes on Enhsim, on the Rawr side I plan to port the Enhancement module's Enhsim export into the Elemental module for ease of use.

Initial thoughts/ideas on things I plan to add/adjust:

  1. Missing talents: Booming Echos (Increased Flame/frost shock damage, lowered cooldowns), Elemental Mastery, and Thunderstorm.
  2. Remove option for "LvB only if FS has x ticks left", which doesn't appear to be implemented and is probably left from when LvB ate FS. Or, implement it but make sure it can be disabled.
  3. Ensure "LvB only if ED left less than x" can be disabled
  4. Add in T8/T9/T10 nuker set bonues
  5. Add appropriate Metas (If applicable)
  6. Add more spell caster trinkets
  7. Add Ashen Verdict caster ring

The existing Combat parameters and spell priority should work decently well as a starting point. I'm no pro at this stuff, the math and theorycrafting behind everything, but adjusting enhsim to be able to more closely handle "elesim" with the above changes is a lot closer than the "doesn't exist" sim I have today. If I get more trinkets, sets, procs, etc, implemented, perhaps someone else will see a good place that needs adjustment for accuracy. Right now I setup the parameters/priority to match elemental rotation and turn off MH/OH autoattack.

I plan to offer these changes up to everyone else so they can be merged in if the enhsim community feels they deserve to be done. Otherwise I'll maintain it for my own use :)

Feb 10, 2010 at 6:54 PM

Show me a working patch that doesn't interfere/conflict with the Enhancement side of things and I'll give you developer status to help keep the Elemental portion updated.


Feb 10, 2010 at 7:02 PM

I've been reading through and familiarizing myself with the code base this afternoon. Some of the stuff I thought was missing I've learned is still implemented, but simply hidden in the GUI (Probably as its considered too old or completely worthless to enhancement in 3.3).

I don't think there will be any interference with the enhancement side as it's mostly implementing new trinket models and sets. The biggest thing out side of that will be implementing Booming Echoes (Will need to switch to a different shock global cooldown for Flame/Frost, while Earth/Wind continue using the existing cooldown), and adding Elemental Mastery instant cast into LB/LVB/CL (as well as adjusting Elemental Mastery cooldown for T10 2pc). Another potential check box is something along the lines of "Don't cast CL/LB if LvB cooldown is less than x."

I won't have time to really begin writing anything till Friday night, but I'm optimitic that most of this can be implemented cleanly and quickly, giving elemental shamans a new tool built on the proven platform of Enhsim.

Apr 12, 2010 at 10:35 PM

this was a grand idea but I just haven't had the time to even try to do it :( Hopefully one day someone else will have the time and motivation to add in the last talent or two that's missing and the tier bonuses.

Apr 15, 2010 at 12:42 AM

Ok, I got motivated :(

I made an attempt at implementing Booming Echoes. My noobish first attempt ways didn't see an easy way to run two "joined" cooldowns... so...

I duplicated the existing shock_cooldown_ as booming_echo_cooldown_. I added a booming_echo_multiplier. All three shocks will trigger addLowPrioEvent for both shock_cooldown_ and booming_echo_cooldown_ using the same randomLag value. Earth shock checks shock_cooldown_ still (But triggers both cooldowns), and Flame and Frost check booming_echo_cooldown_. The damage for flame (direct only, not DOT) and Frost is multiplied by booming_echo_multiplier (similar to concussion multi).

Two issues have resulted: The new cooldown seems to have substantially increased run down. And although the total dps of a simulation without Booming Echoes matches a simulation, the DPS for Earthshock is shown as being 30-40 higher, with small drops in other areas.

Here's the run against my config, final dps values: 

                    DPS                 PPM       MPS
white               3694.93   35.11%    105.56
windfury            1286.47   12.22%    8.16
flametongue         891.37    8.47%     63.50
stormstrike         474.72    4.51%     6.22      34.28     11.05%
lava lash           336.95    3.2%      6.36      17.52     5.65%
magma totem         395.25    3.76%     2.09      38.87     12.53%
earth shock         277.40    2.64%     3.48      43.16     13.91%
flame shock         396.82    3.77%     3.42      40.07     12.92%
lightning bolt      1096.86   10.42%    9.56      70.06     22.59%
fire nova           231.63    2.2%      3.97      60.22     19.41%
lightning shield    308.98    2.94%     1.37      0.00      0.00%
necrotic touch      287.38    2.73%     75.04
spirit wolves       360.60    3.43%     0.41      3.41      1.10%
fire elemental      485.91    4.62%     0.17      2.64      0.85%
  melee             265.48    54.64%    5.33
  fire shield       17.92     3.69%     6.59
  fire nova         129.29    26.61%    2.66
  fire blast        73.21     15.07%    2.75

DPS                 10525.26
MPS                 310.22
MP2min              37226.13
MRPS                281.52
Out of mana time    3.64%

elapsed simulation time: 5000.00h
elapsed real time: 21.03s
Here's my build's run, with Booming Echoes = 0:
                    DPS                 PPM       MPS
white               3694.57   35.11%    105.56
windfury            1287.29   12.23%    8.17
flametongue         889.77    8.45%     63.37
stormstrike         474.25    4.51%     6.21      34.23     11.00%
lava lash           330.78    3.14%     6.24      17.19     5.53%
magma totem         394.38    3.75%     2.08      38.73     12.45%
earth shock         309.60    2.94%     3.90      48.40     15.56%
flame shock         390.40    3.71%     3.37      39.41     12.67%
lightning bolt      1091.33   10.37%    9.52      69.76     22.42%
fire nova           220.60    2.1%      3.78      57.32     18.43%
lightning shield    308.69    2.93%     1.37      0.00      0.00%
necrotic touch      286.37    2.72%     74.82
spirit wolves       360.27    3.42%     0.41      3.41      1.10%
fire elemental      485.89    4.62%     0.17      2.64      0.85%
  melee             265.50    54.64%    5.33
  fire shield       17.92     3.69%     6.59
  fire nova         129.27    26.6%     2.66
  fire blast        73.20     15.07%    2.75

DPS                 10524.19
MPS                 311.10
MP2min              37331.44
MRPS                282.34
Out of mana time    3.80%

elapsed simulation time: 5000.00h
elapsed real time: 176.40s
simulation speed: 102039x
As you can see, the elapsed time is considerably longer, the total DPS is approximately the same (Did multiple runs), but the Earth Shock dps differs (Also consistant).
But within the frame work of the existing Enhsim, I'm not familiar with any other method to handle the cooldowns. Flame and Frost have to run on a different cooldown than Earth, but all three have to trigger both cooldowns. I'm thinking the overhead from two cooldowns is somehow responsible?
Example flame shock code:
bool FlameShock::cast() {

	if (sim.booming_echoes_cooldown_->cd_ || dots_ > max_dots_left_) {
		return false;

	if (!sim.requestMana(FLAME_SHOCK_MANA,
		1.0f - sim.shamanistic_focus_mana_ - sim.requestElementalFocus() - sim.mental_quickness_mana_ - sim.convection_mana_ - mana_reduction_)) {
			return false;

	sim.stats_.flame_shock_mana_ += sim.useMana(FLAME_SHOCK_MANA,
		1.0f - sim.shamanistic_focus_mana_ - sim.consumeElementalFocus() - sim.mental_quickness_mana_ - sim.convection_mana_ - mana_reduction_);

	/* Cooldowns need to have the same randomLag */
	int64 cooldown_lag = sim.randomLag();
	sim.shock_cooldown_->cd_ = true;
	sim.booming_echoes_cooldown_->cd_ = true;
	sim.addLowPrioEvent(sim.shock_cooldown_->cooldown_, sim.shock_cooldown_, 0, cooldown_lag);
	sim.addLowPrioEvent(sim.booming_echoes_cooldown_->cooldown_, sim.booming_echoes_cooldown_, 0, cooldown_lag);

	sim.global_cooldown_->cd_ = true;
	sim.addLowPrioEvent(std::max<int64>(100, (GCD - gcd_reduction_) / sim.spell_haste_divider_), sim.global_cooldown_, 0, sim.randomLag());

	if (roll() < sim.spell_miss_) {

		COMBATLOG_EFFECT("Flame shock miss")

		procList(sim.p_flame_shock_miss, sim.p_flame_shock_miss_count, P_SPELL | P_SHOCK | P_FLAME_SHOCK | P_MISS);
	else {
		sim.stats_.flame_shock_sp_ += sim.spellpower_;
		if (roll() < sim.fire_crit_) {
			f32 dps = sim.fire_damage_reduction_ * ((FLAME_SHOCK_DAMAGE + sim.spellpower_ * FLAME_SHOCK_COEFFICIENT) *
				sim.spell_crit_multiplier_ * sim.concussion_multiplier_ * sim.fire_damage_multiplier_ *
				sim.shock_damage_multiplier_ * sim.booming_echoes_multiplier_);
			sim.stats_.flame_shock_crit_damage_ += dps;

			COMBATLOG_EFFECT("Flame shock crit " << dps)

			procList(sim.p_flame_shock_crit, sim.p_flame_shock_crit_count, P_SPELL | P_SHOCK | P_FLAME_SHOCK | P_CRIT);
		else {
			f32 dps = sim.fire_damage_reduction_ *
				sim.concussion_multiplier_ * sim.fire_damage_multiplier_ *
				sim.shock_damage_multiplier_ * sim.booming_echoes_multiplier_);
			sim.stats_.flame_shock_damage_ += dps;

			COMBATLOG_EFFECT("Flame shock hit " << dps)

			procList(sim.p_flame_shock_hit, sim.p_flame_shock_hit_count, P_SPELL | P_SHOCK | P_FLAME_SHOCK | P_HIT);

		dots_ = dots_per_cast_;
		dot_fire_damage_multiplier_ = sim.fire_damage_multiplier_;
		dot_spellpower_ = sim.spellpower_;
		dot_spell_crit_multiplier_ = sim.spell_crit_multiplier_ * dot_spell_crit_bonus_multiplier;

		//if flame shock is already active, we move the existing event
		if (dot_event_) {
			sim.stats_.flame_shock_uptime_ += sim.now() - proc_start_time_;
			proc_start_time_ = sim.now();
			sim.que_.moveEvent(dot_event_, FLAME_SHOCK_DOT_INTERVAL / sim.spell_haste_divider_);
		//otherwise add a new event
		else {
			sim.addLowPrioEvent(dot_event_, (FLAME_SHOCK_DOT_INTERVAL / sim.spell_haste_divider_), this);
			proc_start_time_ = sim.now();
		next_dot_time_ = sim.now() + (FLAME_SHOCK_DOT_INTERVAL / sim.spell_haste_divider_);

	return true;
Apr 15, 2010 at 9:50 PM

Ok so the runtime doesn't seem to be because of my changes. I realized I was comparing against changeset 39574 (where I made my changes)

When I compared an uncustomized 39574 build against mine, the run time was similar.

However the difference in dps for Earthshock remained, with the total average dps still being equal to

Apr 15, 2010 at 10:58 PM

Yay fixed.

I realized the events were clipping each other, since there's no way to kill an event.

  1. Sim fires Earth Shock, which kicks two events out, one for booming and one for shocks.
  2. 6 seconds later, booming event would allow flame shock to fire, which kicked two events out, one for booming and one for shocks
  3. Immediately after, the original shock cooldown from ES would fade, so another ES would fire back to back with flameshock.

That's one sample scenario, the clipping could have happened multiple ways. When booming echoes was actually active, Flame Shock would trigger extra cooldown resets for ES every 4 seconds.

I moved both cooldowns into shock_cooldown_. I still kick off both events. If both the shock cooldown and booming cooldown are active, it sets booming cooldown to false and leaves shock as true. If shock is true but booming false, then shock is set to false.

After that, the earthshock dps dropped back to the expected value.

Apr 15, 2010 at 11:40 PM

patch uploaded!

Apr 16, 2010 at 8:59 PM
Edited Apr 16, 2010 at 9:56 PM

I'm probably regarded as an idiot by now, but please excuse my rustiness :)

More learning! I learned about the qui_ object today, and the fact that I CAN delete and move events.

I'm making a new patch that will work this way for booming echo cooldowns.


Version 2 created! ignore version 1. I realized after uploading there is 1 small error. In ShockCooldown::event, where it says (booming_cooldown_ - cooldown_) should be (cooldown_ - booming_cooldown_)

Also I realized the difference between Debug and Release builds and that that was the cause of longer runs. I feel like such a noob.

Aug 21, 2010 at 2:28 AM

Did this get anywhere?

With the recent changes in the Cataclysm Beta, it's starting to look like we need a Sim system for Elemental as well, as it's too complicated to model in Excel any longer (multiple conditional casts, more cooldowns, and cooldown resets)

Aug 22, 2010 at 11:36 PM

I stopped working on it due to an obviously lack of interest or feedback. I had booming echoes and elemental mastery working though.

The sim can easily be adapted for elemental, both now and in Cata, once you learn how it works and get familiar with it. Maybe I'll put more interest in it when the beta begins to calm down a little more.

Aug 22, 2010 at 11:48 PM

Well, it's looking like we're going for a multiple conditional priority system, which will be fairly hard to model in excel, especially when considering talents like Reverberation. More details can be found here: http://www.totemspot.com/forum/viewtopic.php?f=8&t=153

Aug 23, 2010 at 1:48 AM

It's even more complicated than that. It doesn't look like you've had a chance to work Fulmination and Earth Shock in yet.

Aug 23, 2010 at 1:58 AM
Edited Aug 23, 2010 at 1:59 AM

The flowchart is out of date, but the 12th post has a rough list of rotation rules http://www.totemspot.com/forum/viewtopic.php?f=8&t=153#p1246

  1. Keep Flame Shock Up
  2. Keep Lightning Shield up
  3. Cast Lava Burst when off cooldown (can be reset by Lava Surge)
  4. Cast Earth Shock when at 6 or more Lightning Shield charges and the Flame Shock dot time remaining is greater than your shock cooldown
  5. Cast Unleash Elements when your next fire spell in 6 seconds is Lava Burst
  6. Cast Lightning Bolt

What programming languages are involved? I can do a shout out on twitter & totemspot to see if there are any other coders that can pitch in.

Aug 23, 2010 at 2:15 AM

EnhSim is in C++ currently.

Just a note: You shouldn't ever need to recast Lightning Shield, because Fulmination only drops it down to 3 charges, using up to 6 (Max 9, uses 6, leaves 3). Of course, there's still a 10-minute duration, depending if new charges reset the duration or not.

Aug 23, 2010 at 2:20 AM

I don't expect condition 2 to actually require anything, but on encounters that trigger shield charges it is hypothetically possible to reduce your shield to zero, and the mana restore function of CL/LB is dependant on having LS up as well (I might move it up to #1 rather than #2).

Aug 26, 2010 at 3:59 AM

Ferret sorry for the lack of feedback but I don't play elemental so it makes it hard for me to verify how accurate your coding would compare to in-game results. 

Let me talk over some things with Bink and maybe we can all benefit from incorporating Elemental into EnhSim for Cataclysm.

Aug 26, 2010 at 9:13 AM

I brought it up to Ziff, he thought the best path here would be to split it and make a separate project and after thinking about it, I agree. The upkeep involved in keeping both sides working in the same code would be rough. Tinkering with something in the enhance side could mess with the ele side without even knowing. Splitting would probably be easier from an elemental development point of view too, as they could keep the core mechanics, and just dump everything enhance specific. That's one problem with the code currently, is there's a lot of stuff in there that is no longer used, and even more that won't be used when Cataclysm hits. As I told Bink, I'd be willing to help with on the ele side of things, but as I've never run and don't plan on ever speccing elemental, I don't really want to take responsibility for lheading such a movement.

Aug 26, 2010 at 6:46 PM

I've listed Bink as a coordinator.  If separating the project would work better then it can be split.  I don't know what is involved with starting EleSim as a separate project and I don't know if it is necessary or not.

All I know is that the hardest thing about any of these projects is finding people willing to work on the code so if pooling resources between enhancement and elemental has more people capable and willing to play with the

code then keep them together or make elemental a separate module inside of EnhSim the way that Rawr is broken into separate modules.  Elemental and Enhancement conflict with each other too often on the boards and in general

and I would love to see us all using the same tool and working together on it. 


Ok, sorry, that was way too touchy feely, whatever works best for all parties involved.  Now must get Pizza.

Aug 26, 2010 at 10:34 PM

Right now for WotLK, the primary things missing from EnhSim to support Ele were the set bonuses, Booming Echoes (It took me three tries but I got it lol, mostly just learning about EnhSim's internals) and Elemental mastery. I got the two talents done, but I never got around to working on the elemental set bonuses.

I don't know why so many of the elemental talents were implemented in the past, including ones an enhancement shaman would never have like Shamanism (Tier 10 talent).

Cata is going to require moving, updating and ripping out a ton of both the ele and enh talents, plus adding new ones in. It's a good idea to decide on a direction now. Since there's overlap of the two trees regardless, working on a couple more talents in elemental shouldn't be much work. Changes to the baseline spells affect both specs, so that has to be handled anyways.

Aug 26, 2010 at 11:29 PM
Edited Aug 27, 2010 at 12:01 AM

Originally Tukez wanted to support both enhancement and elemental but lost steam after getting the sim running well for enhancement.  Then we took it open source to keep it updated and the elemental stuff was never completed.  I'd much rather have both models supported by a single sim, I like the concept of a sim for all dps shaman.  Jessamy sent me this link and I think it sums things up pretty well.  http://elitistjerks.com/f30/t69809-cataclysm_thread_there_not_bear_asses_collect/p406/#post1717489  From reading that post lets just try to keep everything in one model. Sure it might create a bit of extra work every now and then but I also don't think we would have had the issue with the flame shock glyph if elementals had been using EnhSim to model their performance.  Mistakes like that will always happen but the more eyes on things the more likely they are to be caught in time.