Jump to content
This site uses cookies! Learn More

This site uses cookies!

By continuing to use this site, you agree to allow us to store cookies on your computer. :)

thebk150

spell.launch() causing frame jutters w/ framelock

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?

 

 

 

Share this post


Link to post
Share on other sites

Spell.Launch does a lot more than a simple

Lua.LuaDoString($"CastSpellByName('{spell.NameInGame}()'");

So you might wanna try the latter

Share this post


Link to post
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.

Share this post


Link to post
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);

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...