April 27, 20205 yr 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?
April 27, 20205 yr I’m completely baffled that everyone in there mother wants to use a ingame lua inject banner
April 27, 20205 yr Spell.Launch does a lot more than a simple Lua.LuaDoString($"CastSpellByName('{spell.NameInGame}()'"); So you might wanna try the latter
April 27, 20205 yr Author Thanks for the pointer! I figured it was doing quite a bit if one invocation was taking 300 ms on a 6700k.
April 27, 20205 yr 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.
April 27, 20205 yr Author 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);
April 27, 20205 yr Author 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.
Create an account or sign in to comment