Jump to content

spell.launch() causing frame jutters w/ framelock


thebk150

Recommended Posts

I'm writing a simple combat routine for an Enhancement shaman in 5.4.8 and am running into an issue that I'm hoping someone can provide a bit of insight.  I'm using Marsbars' video as a framework.  I have a while loop that runs when _IsRunning is true and invokes a function that has cascading 'if' statements that checks which spell to run.  Before the combat routine function is called, I lock the frame and immediately unlock the frame after running spell.Launch().

 

The issue is that every time a spell is launcher, the client locks up for 1/3 of a second.  I've added a simple timer to time how long the .launch() function is taking and it appears to be taking ~300 ms per invocation which makes sense why I'm seeing frame jutter as everything needs to execute faster than 16.67 ms. 

...
        var watch = System.Diagnostics.Stopwatch.StartNew();
        FlameShock.Launch();
        Logging.WriteFight("Iteration took " + watch.ElapsedMilliseconds + "ms");
...
[F] 12:18:13 - Iteration took 306ms
[F] 12:18:13 - [Spell] Cast Stormstrike (Stormstrike)

 

Is there a better way to invoke the use of spells?  Am I way off base and in over my head with how I'm implementing my combat routine?

 

 

 

Link to comment
Share on other sites

Depends on what you're doing inside the framelock. From what you showed in your example just launching the spell with no checks besides that took 300ms.
If you optimize your stuff, you should be able to keep iterations below 50ms for all spells.

Link to comment
Share on other sites

I'm planning on leaving most interrupt logic out and having that be manually done.  I'm also planning on having a manual toggle between single-target and AoE so there shouldn't be too much positional check stuff going on.

As far as the above, I'm attempting to invoke spells using Lua instead of spell.launch now.  Just to make sure I have it working, I've added a

Lua.LuaDoString("CastSpellByName('Lava Lash')");

That always runs unconditionally.  I've verified that is spelled correctly on my current game client but it does not cast.

 

I've also tried the following:

wManager.Wow.Helpers.SpellManager.CastSpellByNameLUA("Lava Lash");
wManager.Wow.Helpers.SpellManager.CastSpellByIdLUA(60103);

 

Link to comment
Share on other sites

Never mind I'm a complete idiot.  I was building the dll to the wrong directory, rookie mistake.  Everything is working way better now and iterations through my basic combat logic are taking 7-8 ms.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...